A modern, full-stack e-commerce platform for fresh grocery delivery. FreshlyGo brings the convenience of online shopping directly to your doorstep with a seamless user experience, secure payments, and a dedicated seller dashboard.
Visit the live application: https://freshlygo-frontend.vercel.app/
- π Browse and search fresh groceries and products
- π Add items to cart and manage quantities
- π³ Secure checkout with Stripe payment integration
- π Multiple address management
- π¦ Order tracking and order history with delivery status
- β Best sellers and category-based browsing
- π§ Newsletter subscription
- π Dark mode support
- π Seller dashboard with order management
- β Add and manage product listings
- π View order history and analytics
- π Secure seller authentication
- πΌοΈ Product image upload with Cloudinary integration
- π Dedicated delivery agent dashboard
- π View all pending Cash on Delivery (COD) orders
- π¦ Pick up orders for delivery
- πΊοΈ Track delivery with status updates (Picked Up, In Transit, Delivered)
- β Auto-confirm payment upon delivery for COD orders
- π° Prominent COD amount display for easy collection
- π Add delivery notes and remarks
- React 19 - UI library
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Axios - HTTP client
- React Hot Toast - Notification system
- React Compiler - Optimized performance
- Node.js & Express - Server framework
- MongoDB & Mongoose - Database
- JWT - Authentication
- bcryptjs - Password encryption
- Stripe - Payment processing
- Cloudinary - Image hosting
- Multer - File upload handling
- CORS - Cross-origin support
- Cookie-parser - Cookie management
- Nodemon - Development hot reload
Before you begin, ensure you have installed:
- Node.js (v16 or higher)
- npm or yarn
- MongoDB (local or cloud - MongoDB Atlas)
- Git
-
Navigate to the server directory:
cd server -
Install dependencies:
npm install
-
Create a
.envfile in the server directory with the following variables:PORT=5000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key CLIENT_URL=http://localhost:5173
-
Start the backend server:
npm run dev
or
npm start
The server will run on
http://localhost:5000
-
Navigate to the client directory:
cd client -
Install dependencies:
npm install
-
Create a
.env.localfile in the client directory:VITE_API_URL=http://localhost:5000 VITE_STRIPE_PUBLIC_KEY=your_stripe_publishable_key
-
Start the development server:
npm run dev
The application will be available at
http://localhost:5173 -
To build for production:
npm run build
FreshlyGo/
βββ client/ # React frontend application
β βββ src/
β β βββ components/ # Reusable React components
β β βββ pages/ # Page components
β β βββ context/ # React context for state management
β β βββ assets/ # Static assets and constants
β β βββ App.jsx # Main app component
β β βββ main.jsx # Entry point
β βββ package.json
β βββ vite.config.js
β βββ index.html
β
βββ server/ # Node.js/Express backend
βββ controllers/ # Route handlers and business logic
βββ models/ # MongoDB models
βββ routes/ # API route definitions
βββ middlewares/ # Custom middleware (auth, etc.)
βββ configs/ # Configuration files (DB, Cloudinary, etc.)
βββ index.js # Server entry point
βββ server.js # App configuration
βββ package.json
POST /api/users/register- Register new userPOST /api/users/login- User loginGET /api/users/profile- Get user profile
GET /api/products- Get all productsGET /api/products/:id- Get product detailsPOST /api/products- Add new product (Seller)
POST /api/cart/add- Add item to cartGET /api/cart- Get cart itemsDELETE /api/cart/remove/:id- Remove item from cart
POST /api/orders/create- Create new orderGET /api/orders/user- Get user ordersGET /api/orders/seller- Get seller orders
POST /api/address/add- Add new addressGET /api/address- Get saved addresses
| Variable | Description |
|---|---|
PORT |
Server port (default: 5000) |
MONGODB_URI |
MongoDB connection string |
JWT_SECRET |
Secret key for JWT tokens |
CLOUDINARY_* |
Cloudinary API credentials |
STRIPE_SECRET_KEY |
Stripe secret API key |
STRIPE_PUBLISHABLE_KEY |
Stripe public API key |
CLIENT_URL |
Frontend URL for CORS |
SELLER_EMAIL |
Seller login email |
SELLER_PASSWORD |
Seller login password |
DELIVERY_AGENT_EMAIL |
Delivery agent login email |
DELIVERY_AGENT_PASSWORD |
Delivery agent login password |
| Variable | Description |
|---|---|
VITE_API_URL |
Backend API URL |
VITE_STRIPE_PUBLIC_KEY |
Stripe public key |
The application uses JWT (JSON Web Tokens) for secure authentication:
- Tokens are stored in HTTP-only cookies
- Separate authentication flows for users, sellers, and delivery agents
- Protected routes require valid tokens
- Automatic token refresh mechanism
-
Order Placed: Customer selects "Cash on Delivery" at checkout
- Order created with status: "Order Placed"
- Payment status: "Pending"
- Order visible in delivery agent dashboard
-
Pickup: Delivery agent picks up the order
- Order status: "Picked Up"
- Agent assigned to order
- Order moves to agent's "My Deliveries"
-
In Transit: Agent starts delivery
- Order status: "In Transit"
- Agent can add location/delivery notes
-
Delivered: Agent marks delivery complete
- Order status: "Delivered"
- Payment status automatically β "Received via COD"
- Confirmed payment amount displayed
- Customer order updated with delivery completion
- Pending Deliveries: All COD orders ready for pickup with prominent COD amount display
- My Deliveries: Orders assigned to agent with filtered status view (In Transit, Delivered)
- Delivery Details: Complete order info with customer details, address, timeline, and delivery confirmation form
- Status Tracking: Real-time order status updates visible to both agent and customer
FreshlyGo uses Stripe for secure payment processing:
- PCI-compliant payment handling
- Support for multiple payment methods
- Payment confirmation and webhook handling
Product images are managed through Cloudinary:
- Automatic image optimization
- CDN delivery for fast loading
- Easy image upload from server
The frontend is deployed on Vercel and automatically deploys on push to the main branch.
The backend can be deployed on platforms like:
- Heroku
- Railway
- Render
- DigitalOcean
- AWS
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new 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
This project is licensed under the ISC License.
Created and maintained with β€οΈ for seamless grocery delivery experience.
For any issues or inquiries, please open an issue on the repository or contact the development team.
Happy Shopping with FreshlyGo! π