Fresh meals. Fast delivery. No stress.
ChopLife Kitchen is a full-stack Nigerian restaurant ordering platform built to provide a smooth food-ordering experience for customers and a practical operations dashboard for restaurant staff.
Customers can browse meals, customize orders, check out as guests, choose a payment method, receive an order number, and track their order. Restaurant staff can manage orders, menu items, categories, customers, restaurant settings, and order status from a protected admin dashboard.
Built as a real-world portfolio project โ focused on usability, responsive UI, API design, authentication, database integration, and restaurant operations.
Frontend: https://choplife-lime.vercel.app
- ๐ Modern Nigerian food-focused restaurant storefront
- ๐ Menu search, category filtering, sorting, and availability filtering
- ๐ Persistent shopping cart with quantities, extras, and special instructions
- ๐ค Guest checkout โ no account required
- ๐ฑ WhatsApp-friendly order confirmation and sharing
- ๐ฆ Order tracking with a visual status timeline
- โก Automatic order refresh for near real-time tracking
- ๐ JWT-protected admin dashboard
- ๐ Admin statistics for orders, revenue, pending orders, and completed orders
- ๐ฝ๏ธ Full menu and category management
- โ๏ธ Restaurant settings management
- ๐ฐ Server-side order total calculation to prevent client-side price tampering
- ๐ฑ Fully responsive across mobile, tablet, and desktop
- Features
- Tech Stack
- Architecture
- Project Structure
- Prerequisites
- MongoDB Setup
- Environment Variables
- Run Locally
- Seed the Database
- API Overview
- Admin Access
- Payment Model
- Deployment
- Known Limitations
- Future Improvements
- Why I Built This
- Modern, mobile-first restaurant storefront
- Home, menu, food details, cart, checkout, and order tracking pages
- Search by food name
- Filter by category
- Sort menu items
- Filter available items
- Add extras to menu items
- Add special instructions
- Cart persisted in
localStorage - Guest checkout with form validation
- Order confirmation with order number
- Shareable WhatsApp order message
- Public order tracking using
/order/:orderNumber - Visual order status timeline
- Automatic tracking refresh
- Responsive design from small mobile screens to large desktops
- Protected admin authentication
- Dashboard statistics
- Order management
- Order status workflow:
Pending โ Confirmed โ Preparing โ Ready โ Out for Delivery โ Delivered
- Cancelled order state
- Create, update, and delete menu items
- Manage menu extras
- Manage ingredients
- Toggle item availability
- Mark items as popular
- Create, update, and delete categories
- Enable or disable categories
- View customer information derived from order history
- Update restaurant information and delivery settings
- Manage WhatsApp contact information and social links
- Layered backend architecture
- REST API built with Go and Gin
- MongoDB persistence
- JWT authentication
- Bcrypt password hashing
- Role-based admin middleware
- Server-side price calculation
- MongoDB indexes for important queries and unique fields
- Consistent API response envelope
- Loading states, empty states, confirmation dialogs, and toast feedback
- Real API actions throughout the dashboard instead of placeholder buttons
- React 19
- TypeScript
- Vite
- Tailwind CSS v4
- React Router
- Zustand
- React Hook Form
- Axios
- Lucide React
- Go
- Gin
- MongoDB Official Go Driver
- JWT
- Bcrypt
- MongoDB
- MongoDB Atlas for production
- Local MongoDB for development
- Vercel for the frontend
- Render, Railway, or Fly.io for the backend
- MongoDB Atlas for production database hosting
โโโโโโโโโโโโโโโโโโโโโโโ
โ React Frontend โ
โ Vite + Tailwind โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
Axios / REST API
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ Go + Gin API โ
โ โ
โ Routes โ
โ Controllers โ
โ Services โ
โ Middleware โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
MongoDB Driver
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ MongoDB โ
โ โ
โ Users โ
โ Menu Items โ
โ Categories โ
โ Orders โ
โ Settings โ
โ Counters โ
โโโโโโโโโโโโโโโโโโโโโโโ
The frontend sends:
- Menu item IDs
- Quantities
- Selected extras
- Special instructions
The backend then looks up the current menu data and calculates the order total itself.
This means the API does not trust prices coming directly from the browser.
choplife-kitchen/
โ
โโโ frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ common/
โ โ โ โโโ layout/
โ โ โ โโโ menu/
โ โ โ โโโ cart/
โ โ โ โโโ admin/
โ โ โ
โ โ โโโ pages/
โ โ โ โโโ admin/
โ โ โโโ layouts/
โ โ โโโ hooks/
โ โ โโโ services/
โ โ โโโ store/
โ โ โโโ types/
โ โ โโโ utils/
โ โ
โ โโโ vite.config.ts
โ
โโโ backend/
โ โโโ cmd/
โ โ โโโ seed/
โ โโโ config/
โ โโโ controllers/
โ โโโ services/
โ โโโ models/
โ โโโ middleware/
โ โโโ routes/
โ โโโ database/
โ โโโ utils/
โ โโโ main.go
โ
โโโ README.md
Make sure these are installed:
- Go 1.22+
- Node.js 20+
- MongoDB Community Server
ChopLife uses local MongoDB during development.
Make sure the MongoDB service is installed and running on your computer.
The default connection string is:
MONGODB_URI=mongodb://localhost:27017The application uses the choplife database:
MONGODB_DATABASE=choplifeYou can verify that MongoDB is running through MongoDB Compass or mongosh.
For production deployment, MongoDB Atlas can be used instead.
Example:
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.netCreate the file from .env.example:
PORT=8080
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=choplife
JWT_SECRET=change_this_secret
JWT_EXPIRY_HOURS=72
CLIENT_URL=http://localhost:5173
WHATSAPP_NUMBER=2348012345678VITE_API_URL=http://localhost:8080/api
VITE_WHATSAPP_NUMBER=2348012345678- Replace
JWT_SECRETwith a strong random secret. - Set
CLIENT_URLto the exact deployed frontend origin. - Use your real WhatsApp business number.
- Never commit
.envfiles or production secrets to GitHub.
The project can be run on Windows using Command Prompt or PowerShell.
cd backend
copy .env.example .env
go mod tidy
go run ./cmd/seed
go run .Backend:
http://localhost:8080
Open another terminal:
cd frontend
copy .env.example .env
npm install
npm run devFrontend:
http://localhost:5173
Run:
cd backend
go run ./cmd/seedThe seed script creates starter data including:
- 7 food categories
- 13 menu items
- Menu prices
- Ingredients
- Extras
- Restaurant settings
- Delivery fee and minimum order settings
- Default admin account
The seed operation is designed to be safely re-run without creating duplicate starter records.
Base URL:
http://localhost:8080/api
Successful response:
{
"success": true,
"data": {}
}Error response:
{
"success": false,
"message": "Human-readable error"
}| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Create an admin account |
| POST | /auth/login |
Login and receive JWT |
| GET | /auth/me |
Get current admin ๐ |
| Method | Endpoint | Description |
|---|---|---|
| GET | /menu |
List menu items |
| GET | /menu/:id |
Get one menu item |
| POST | /menu |
Create menu item ๐ |
| PUT | /menu/:id |
Update menu item ๐ |
| DELETE | /menu/:id |
Delete menu item ๐ |
| Method | Endpoint | Description |
|---|---|---|
| GET | /categories |
List categories |
| POST | /categories |
Create category ๐ |
| PUT | /categories/:id |
Update category ๐ |
| DELETE | /categories/:id |
Delete category ๐ |
| Method | Endpoint | Description |
|---|---|---|
| POST | /orders |
Place guest order |
| GET | /orders/:orderNumber |
Track public order |
| GET | /orders |
List orders ๐ |
| GET | /orders/stats |
Dashboard statistics ๐ |
| PUT | /orders/:id/status |
Update order status ๐ |
| Method | Endpoint | Description |
|---|---|---|
| GET | /settings |
Get public restaurant settings |
| PUT | /settings |
Update settings ๐ |
After seeding the database, the default development admin is:
Email: admin@choplife.com
Password: Admin@123
Admin login:
/admin/login
Important: Change the default password immediately in any real deployment.
The current project supports two payment options:
Customers place an order and payment is collected when the order is delivered.
A simulated online payment flow created for portfolio/demo purposes.
The demo payment system:
- Does not process real money
- Does not collect card details
- Simulates a successful payment
A real integration with Paystack, Flutterwave, or Stripe can be added later without redesigning the core order system.
The frontend is deployed on Vercel.
For deployment:
- Push the project to GitHub.
- Import the repository into Vercel.
- Set the project root to
frontend. - Use the following build command:
npm run build
- Output directory:
dist
- Configure the API URL:
VITE_API_URL=https://your-backend-url/apiDeploy the backend directory and configure:
PORT=8080
MONGODB_URI=your_mongodb_atlas_uri
MONGODB_DATABASE=choplife
JWT_SECRET=your_production_secret
JWT_EXPIRY_HOURS=72
CLIENT_URL=https://your-frontend-url.vercel.app
WHATSAPP_NUMBER=your_whatsapp_numberFor production, use MongoDB Atlas and set MONGODB_URI to your Atlas connection string.
These are intentional MVP decisions:
- Online payment is currently simulated for demo purposes.
- Admin JWT is stored in
localStorage. - Admin registration is available for initial setup and should be restricted in production.
- Delivery pricing currently uses a configurable flat fee.
- Customers do not have dedicated accounts; customer information is derived from order history.
Potential future improvements include:
- Real Paystack or Flutterwave payment integration
- Zone-based delivery pricing
- Customer accounts and order history
- Promo codes and discounts
- Inventory tracking
- Restaurant staff roles and permissions
- Email/SMS order notifications
- Advanced sales and revenue analytics
- Order receipt generation
- Automated deployment and CI/CD
ChopLife Kitchen was built to demonstrate how a real business workflow can be translated into a complete full-stack web application.
The project covers the complete flow from:
Customer browsing โ Cart โ Checkout โ Order creation โ Database persistence โ Order tracking โ Restaurant administration
It combines a polished React frontend with a structured Go backend and MongoDB database instead of treating the project as a simple static food website.
This project is primarily intended as a portfolio and learning project.