A comprehensive e-commerce platform for fresh product delivery with advanced user management, real-time notifications, and a powerful admin dashboard. FreshCart connects local fresh produce sellers with customers through an intuitive and efficient platform.
- Product Catalog: Browse fresh products with categories and filters
- Shopping Cart: Add/remove items with quantity controls
- Order Management: Track order status in real-time
- Secure Checkout: Multiple payment options
- Product Reviews: Rating and feedback system
- Multi-factor Authentication: Email verification
- Role-Based Access Control: Granular permissions
- Session Management: Secure token-based authentication
- Data Encryption: Sensitive data protection
- Business License Validation: Strict format enforcement (2 letters + 6 digits)
- Mobile-first approach
- Cross-browser compatibility
- Optimized for all device sizes
- Touch-friendly interfaces
- Personal Information: Name, phone, date of birth, gender, profile picture
- Address Management: Add, edit, delete multiple addresses (home, work, other)
- Security Settings: Email verification, password management
- Profile Updates: Real-time profile editing and updates
- User Management: View, activate/deactivate, and manage all users
- System Statistics: Real-time user counts and system metrics
- Email Verification: Admin can verify user emails manually
- Role Management: Change user roles and permissions
- Analytics: User growth and system performance metrics
- Notification System: Real-time notifications for admin actions and system events
- Product Approval: Manage and approve new product submissions
- Store Management: Approve and manage store registrations
- Content Moderation: Review and moderate user-generated content
- Store Management: Registration, profile, and settings
- Product Catalog: Add, edit, and manage product listings
- Order Processing: Real-time order tracking and fulfillment
- Inventory Control: Stock level monitoring and alerts
- Sales Analytics: Performance metrics and reports
- Business Hours: Custom scheduling and availability
- React 18 with Vite - Fast and efficient UI rendering
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Firebase - Authentication and real-time database
- WebSocket - Real-time notifications and updates
- React Query - Server state management
- Formik & Yup - Form handling and validation
- Node.js - JavaScript runtime
- Express - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - Secure authentication tokens
- bcrypt - Password hashing
- Socket.IO - Real-time bidirectional communication
- Multer - File upload handling
- Nodemailer - Email services
FreshCart/
βββ frontend/ # React frontend application
β βββ public/ # Static files
β βββ src/
β βββ assets/ # Images, fonts, etc.
β βββ components/ # Reusable UI components
β β βββ common/ # Common components (buttons, modals, etc.)
β β βββ forms/ # Form components
β β βββ layout/ # Layout components
β β βββ ui/ # Basic UI elements
β βββ contexts/ # React context providers
β βββ hooks/ # Custom React hooks
β βββ pages/ # Page components
β β βββ admin/ # Admin-specific pages
β β βββ auth/ # Authentication pages
β β βββ seller/ # Seller dashboard pages
β β βββ user/ # User account pages
β βββ services/ # API service layer
β βββ utils/ # Utility functions
β βββ App.jsx # Main application component
β βββ main.jsx # Application entry point
β
βββ backend/ # Node.js backend server
β βββ config/ # Configuration files
β βββ controllers/ # Route controllers
β βββ middleware/ # Custom middleware
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ services/ # Business logic
β βββ utils/ # Utility functions
β βββ server.js # Main server file
β βββ socket.js # WebSocket configuration
β
βββ .gitignore
βββ package.json
βββ README.md
- Node.js (v16 or higher)
- MongoDB (v5.0+)
- npm (v8.0+) or yarn
- Firebase account
- Git
-
Clone the repository
git clone <repository-url> cd FreshCart/backend
-
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the backend directory:MONGODB_URI=mongodb://localhost:27017/freshcart JWT_SECRET=your-secret-key PORT=5000
-
Start the server
npm start
-
Navigate to frontend directory
cd ../frontend -
Install dependencies
npm install
-
Firebase Configuration Update
src/firebase.jswith your Firebase credentials:const firebaseConfig = { apiKey: "your-api-key", authDomain: "your-domain.firebaseapp.com", projectId: "your-project-id", storageBucket: "your-bucket.appspot.com", messagingSenderId: "your-sender-id", appId: "your-app-id" };
-
Start the development server
npm run dev
POST /api/auth/register- Register new userPOST /api/auth/login- User loginPOST /api/auth/refresh-token- Refresh access tokenPOST /api/auth/logout- Invalidate sessionGET /api/auth/me- Get current user profile
GET /api/users/me- Get current user profilePUT /api/users/me- Update profileGET /api/users/me/addresses- Get user addressesPOST /api/users/me/addresses- Add new addressPUT /api/users/me/addresses/:id- Update addressDELETE /api/users/me/addresses/:id- Remove address
GET /api/products- List all products (Public)GET /api/products/:id- Get product details (Public)POST /api/products- Create new product (Seller/Admin)PUT /api/products/:id- Update product (Owner/Admin)DELETE /api/products/:id- Delete product (Owner/Admin)GET /api/products/seller- Get seller's products (Seller)
GET /api/orders- Get user's orders (Customer)POST /api/orders- Create new order (Customer)GET /api/orders/seller- Get seller's orders (Seller)PUT /api/orders/:id/status- Update order status (Seller/Admin)
GET /api/admin/users- List all users (Admin)PUT /api/admin/users/:id/status- Update user status (Admin)GET /api/admin/analytics- Get system analytics (Admin)GET /api/admin/notifications- Get system notifications (Admin)GET /api/admin/products/pending- Get pending product approvals (Admin)PUT /api/admin/products/:id/approve- Approve product (Admin)PUT /api/admin/products/:id/reject- Reject product (Admin)
- Browse and purchase products
- Manage profile and addresses
- Track orders in real-time
- Write product reviews
- View order history
- All customer permissions
- Manage store profile and products
- Process and fulfill orders
- View sales analytics
- Handle returns and refunds
- Full system administration
- User and role management
- Content moderation
- System analytics
- Platform configuration
- Order status updates
- System announcements
- Product approval alerts
- Admin notifications
- WebSocket integration
- Detailed product listings
- Category organization
- Inventory tracking
- Approval workflow
- Secure checkout
- Order tracking
- Payment integration
- Invoice generation
- Returns handling
- Authentication: JWT with refresh tokens
- Password Security: bcrypt hashing
- Authorization: Role-based access
- Data Protection: Input validation
- Rate Limiting: API throttling
- CORS: Strict origin policy
- CSRF Protection: Anti-forgery tokens
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Project Link: https://github.com/yourusername/freshcart
π§ Under Active Development π§
- User authentication
- Role-based access control
- Admin dashboard
- Real-time notifications
- Product management
- Order processing
- Advanced analytics
- Mobile app development
- Multi-language support
- Payment gateway integration
- User authentication & authorization
- Role-based access control
- Admin dashboard
- Real-time notifications
- Product management
- Order processing
- Seller dashboard
- Store management
- Advanced analytics
- Mobile app development
- Multi-language support
- Payment gateway integration
- Advanced search & filters
- Review system
- Mobile app (React Native)
- AI recommendations
- Delivery integration
For support and questions, please open an issue in the GitHub repository or contact the development team.
FreshCart - Making fresh product delivery smart and accessible! π₯¬π