A full-stack food delivery application built with modern web technologies. This project features a responsive frontend and a robust backend API for managing users, food items, and food partners.
- React 19 - UI library
- Vite - Build tool and development server
- React Router DOM - Client-side routing
- Axios - HTTP client for API requests
- CSS3 - Styling
- Node.js & Express - Server framework
- MongoDB & Mongoose - Database
- JWT - Authentication
- bcrypt - Password hashing
- Multer - File uploads
- ImageKit - Image management
- CORS - Cross-origin resource sharing
Zomato/
├── backend/
│ ├── src/
│ │ ├── app.js # Express app configuration
│ │ ├── controllers/ # Business logic for routes
│ │ ├── models/ # Database schemas
│ │ ├── routes/ # API endpoints
│ │ ├── middlewares/ # Express middlewares
│ │ ├── services/ # Utility services
│ │ └── db/ # Database connection
│ ├── server.js # Server entry point
│ └── package.json
│
└── frontend/
├── src/
│ ├── components/ # Reusable React components
│ ├── pages/ # Page components
│ ├── routes/ # Route configuration
│ ├── styles/ # CSS stylesheets
│ ├── App.jsx # Main App component
│ └── main.jsx # React entry point
├── vite.config.js
└── package.json
- User registration and login
- Browse food items
- Save favorite foods
- Reels feed
- Partner registration and login
- Create and manage food items
- Partner profile management
- Secure JWT-based authentication
- Image upload and management
- Password encryption with bcrypt
- CORS-enabled API
- Node.js (v14 or higher)
- MongoDB
- npm or yarn
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Create a
.envfile in the backend directory:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/instagood
JWT_SECRET=your_jwt_secret_key
IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key
IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key
IMAGEKIT_URL_ENDPOINT=your_imagekit_url_endpoint- Start the server:
node server.js- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.envfile in the frontend directory (if needed):
VITE_API_URL=http://localhost:5000- Start the development server:
npm run devThe application will be available at http://localhost:5173
POST /register- Register a new userPOST /login- User loginPOST /partner-register- Register a food partnerPOST /partner-login- Food partner login
GET /- Get all food itemsPOST /- Create a new food itemGET /:id- Get food item detailsPUT /:id- Update food itemDELETE /:id- Delete food item
GET /profile- Get partner profilePUT /profile- Update partner profile
The application uses JWT (JSON Web Tokens) for authentication:
- Tokens are issued upon successful login
- Tokens are included in request headers:
Authorization: Bearer <token> - Passwords are hashed using bcrypt before storage
The frontend uses a modular CSS approach with theme variables:
variables.css- Color and spacing variablestheme.css- Theme configurations- Component-specific CSS files for isolated styling
Image uploads are handled using:
- Multer - Middleware for file uploads
- ImageKit - Cloud-based image management and optimization
npm test # Run tests (not yet configured)npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint