This is the final capstone project for the Meta Back-End Developer Certificate on Coursera. It demonstrates a role-based REST API for Little Lemon restaurant using Django, DRF, MySQL, and token authentication.
📁 Project Structure Note To align with the capstone requirements:
The main Django "myproject" is named: littlelemon
The Django "myapp" used for models, views, and APIs is: restaurant
You may notice minor typos in internal folder names or comments (restraunt, etc.), but functionally and structurally everything matches the expected project setup.
- Django 5
- Django REST Framework
- MySQL
- Djoser (for token-based authentication)
- Role-based access (Manager, Customer, Delivery Crew)
- Unit Testing
- ✅ Menu Item Management (
/api/menu-items/) - ✅ Table Booking System (
/api/bookings/) - ✅ Cart & Order Management
- ✅ User Registration & Authentication (via Djoser)
- ✅ Group-based Permissions
- ✅ Token-based Auth
- ✅ Fully testable with Insomnia/Postman
git clone https://github.com/your-username/little-lemon-back-cap.git
cd little-lemon-back-cappython -m venv env
source env/bin/activate # Windows: env\Scripts\activate
pip install -r requirements.txt- Create a MySQL user and database manually:
CREATE DATABASE littlelemon;
CREATE USER 'rahul'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON littlelemon.* TO 'rahul'@'localhost';- Update
settings.pywith your MySQL credentials:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'littlelemon',
'USER': 'yourname',
'PASSWORD': 'yourpassword',
'HOST': 'localhost',
'PORT': '3306',
}
}python manage.py migrateUse the provided sample_data.json file to preload menu items and bookings:
python manage.py loaddata sample_data.jsonpython manage.py testAll 4 tests should pass ✅
- Use Djoser’s token auth system.
- To test, create users and retrieve their token at
/auth/token/login/.
| Endpoint | Access | Description |
|---|---|---|
/api/menu-items/ |
Public (GET), Manager CRUD | Menu management |
/api/bookings/ |
Authenticated | Booking system |
/api/cart/ |
Customer only | Cart operations |
/api/orders/ |
Customer/Manager | Orders |
/auth/ |
Public | User/token auth |
Rahul Kumar
Backend Developer | Meta Capstone Graduate