FeelyFeely Marketplace Documentation
Welcome to the comprehensive documentation for the FeelyFeely Marketplace application - a full-stack React-based marketplace platform.
Table of Contents
- Overview
- Project Structure
- Getting Started
- Technology Stack
- Architecture
- Development Guide
- Deployment
- API Reference
- Contributing
Overview
FeelyFeely is a marketplace application that allows users to:
- Browse and search marketplace items
- Manage homes, places, and events
- Create and manage business listings
- User authentication and profile management
- Real-time chat functionality
- Location-based services with maps
- Payment processing with Paystack
Project Structure
ff-ui/
├── src/
│ ├── client/ # Frontend React application
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── stores/ # Zustand state management
│ │ ├── types/ # TypeScript type definitions
│ │ ├── assets/ # Static assets (images, icons)
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # Utility libraries
│ │ ├── utils/ # Helper functions
│ │ ├── App.tsx # Main App component
│ │ ├── main.tsx # Application entry point
│ │ └── index.css # Global styles
│ └── server/ # Backend Express server
├── public/ # Public static files
├── dist/ # Build output
├── scripts/ # Build scripts
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── vite.config.js # Vite build configuration
├── tailwind.config.cjs # Tailwind CSS configuration
└── README.md # Project readme
Getting Started
Prerequisites
- Node.js (version 18 or higher)
- npm or yarn package manager
- MongoDB database
- Git
Installation
-
Clone the repository:
git clone https://github.com/FeelyFeely/ff-web-ui.git
cd ff-web-ui -
Install dependencies:
yarn install
# or
npm install -
Environment Setup: Create a
.envfile in the root directory with the following variables:NODE_ENV=development
MONGODB_URI=your_mongodb_connection_string
SESSION_SECRET=your_session_secret
PAYSTACK_PUBLIC_KEY=your_paystack_public_key
PAYSTACK_SECRET_KEY=your_paystack_secret_key
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key -
Start the development server:
yarn dev
# This starts both the client and server in development mode -
Open your browser: Navigate to
http://localhost:3000to view the application.
Available Scripts
yarn dev- Start development server with hot reloadingyarn build- Build the application for productionyarn preview- Preview the built applicationyarn start- Start the production server
Technology Stack
Frontend
- React 19 - UI library with latest features
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- React Router - Client-side routing
- Zustand - Lightweight state management
- React Query - Server state management
- React Hook Form - Form handling
- Leaflet - Interactive maps
- Socket.io Client - Real-time communication
Backend
- Express.js - Web framework for Node.js
- MongoDB - NoSQL database
- Session Management - Express sessions with MongoDB store
- Socket.io - Real-time communication
- Multer - File upload handling
- CORS - Cross-origin resource sharing
Development Tools
- ESLint - Code linting
- TypeScript - Static type checking
- Nodemon - Development server auto-restart
- Concurrently - Run multiple commands
- TSC-Alias - TypeScript path mapping
External Services
- Paystack - Payment processing
- Google Maps - Location services
- Anthropic Claude - AI chat functionality
- Plausible - Privacy-focused analytics
Architecture
Client Architecture
The client follows a component-based architecture with the following key patterns:
1. Pages Structure
pages/
├── Main/ # Landing page
├── Market/ # Marketplace pages
├── Homes/ # Home listings
├── Places/ # Places and locations
├── Events/ # Event listings
├── Business/ # Business management
├── User/ # User profile and account
├── Collection/ # User collections
└── EarthMapper/ # Map visualization
2. State Management
- Zustand stores for client-side state
- React Query for server state and caching
- Local storage for persistence
3. Routing
React Router 7 with:
- Nested routes for organized page structure
- Protected routes for authenticated users
- Lazy loading for performance optimization
Server Architecture
The server follows an Express.js pattern with:
- Route handlers for API endpoints
- Middleware for authentication, logging, and CORS
- Session management with MongoDB store
- Socket.io for real-time features
Development Guide
Code Organization
Component Guidelines
- Use functional components with hooks
- Follow TypeScript naming conventions
- Implement proper prop interfaces
- Use composition over inheritance
State Management
- Use Zustand for client state
- Use React Query for server state
- Keep state as local as possible
- Use derived state when appropriate
Styling Guidelines
- Use Tailwind CSS utility classes
- Create reusable component variants
- Follow responsive design principles
- Use CSS variables for theming
TypeScript Best Practices
- Define strict interfaces for props
- Use union types for variants
- Implement proper error boundaries
- Use generic types when appropriate
Key Features Implementation
1. Marketplace Functionality
The marketplace supports multiple categories:
- Products (Market)
- Homes and real estate
- Places and venues
- Events
Each category has:
- Listing pages with filtering
- Detail pages with full information
- Category-specific search
- User reviews and ratings
2. User Authentication
- Session-based authentication
- User profiles and preferences
- Organization accounts
- Role-based permissions
3. Real-time Features
- Live chat functionality
- Real-time notifications
- Socket.io integration
- Presence indicators
4. Payment Integration
- Paystack payment processing
- Secure transaction handling
- Payment status tracking
- Multiple payment methods
5. Location Services
- Google Maps integration
- Leaflet maps for property visualization
- Location-based search
- Interactive map features
Testing Strategy
Unit Testing
- Component testing with React Testing Library
- Hook testing for custom hooks
- Utility function testing
- Type checking with TypeScript
Integration Testing
- API endpoint testing
- Database integration testing
- Payment flow testing
- Authentication testing
Performance Testing
- Bundle size optimization
- Loading performance
- Memory usage monitoring
- Network request optimization
Deployment
Production Build
-
Build the application:
yarn build -
Environment Configuration: Set production environment variables:
NODE_ENV=production
MONGODB_URI=production_mongodb_uri
# Other production variables -
Start production server:
yarn start
Docker Deployment
-
Create Dockerfile:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"] -
Build and run:
docker build -t feelyfeely-app .
docker run -p 3000:3000 feelyfeely-app
Environment Variables
Production environment requires:
- Database connection strings
- API keys for external services
- Session secrets
- Payment gateway credentials
- Analytics tracking codes
API Reference
Authentication Endpoints
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutPOST /api/auth/register- User registrationGET /api/auth/profile- Get user profile
Marketplace Endpoints
GET /api/market- Get marketplace itemsPOST /api/market- Create new listingGET /api/market/:id- Get specific itemPUT /api/market/:id- Update listingDELETE /api/market/:id- Delete listing
Search and Filtering
GET /api/search- Global searchGET /api/filter- Apply filtersGET /api/categories- Get categories
Real-time Events
connection- User connectsmessage- Chat messagesnotification- System notificationsdisconnect- User disconnects
Contributing
Getting Started with Development
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Write tests for new functionality
- Run the test suite:
yarn test - Submit a pull request
Code Standards
- Follow TypeScript strict mode
- Use ESLint configuration
- Write meaningful commit messages
- Include tests for new features
- Update documentation as needed
Pull Request Guidelines
- Provide clear description of changes
- Include screenshots for UI changes
- Ensure all tests pass
- Update relevant documentation
- Request appropriate reviewers
Additional Resources
For questions or support, please refer to the project's GitHub issues or contact the development team.