This project is a RESTful API developed using Django, Django Rest Framework (DRF), and Djoser for Little Lemon, a restaurant management system. It supports user authentication, role-based permissions, and features for managing menu items, categories, carts, and orders. The project is designed to handle interactions between administrators, managers, delivery crew, and customers.
- Repository
- Features
- Installation and Setup
- Users and Credentials
- API Endpoints
- Testing
- Deployment Notes
- Submission Guidelines
- License
- Contact
Little Lemon API Project on GitHub
- Token-based authentication with Djoser.
- Role-based permissions for Admin, Manager, Delivery Crew, and Customer.
- Assign users to the
Manager
orDelivery Crew
groups. - Add menu items and categories.
- Update menu items of the day.
- Assign users to the
Delivery Crew
group. - Assign orders to the delivery crew.
- View orders assigned to them.
- Mark orders as delivered.
- Register and log in to the system.
- Browse menu items and categories.
- Add items to their cart.
- Place orders.
- View their own orders.
- Python 3.10+
- Pipenv (for virtual environment and dependency management)
- SQLite (default database)
-
Clone the Repository
git clone https://github.com/Cod-e-Codes/little-lemon-api-project.git cd little-lemon-api-project
-
Set Up the Virtual Environment
pipenv install --dev pipenv shell
-
Apply Migrations
python manage.py migrate
-
Run the Development Server
python manage.py runserver
-
Access the API
- Base URL:
http://localhost:8000/api/
- Base URL:
- Username: admin
- Password: littlelemon2024
- Manager
- Username: manager
- Password: managerpass
- Delivery Crew
- Username: delivery
- Password: deliverypass
- Customer
- Username: customer
- Password: customerpass
Method | Endpoint | Description |
---|---|---|
POST | /api/token/login/ |
Obtain authentication token. |
POST | /api/token/logout/ |
Revoke authentication token. |
Method | Endpoint | Description |
---|---|---|
GET | /api/categories/ |
List all categories. |
POST | /api/categories/ |
Create a new category (Admin/Manager). |
Method | Endpoint | Description |
---|---|---|
GET | /api/menu-items/ |
List all menu items. |
POST | /api/menu-items/ |
Add a new menu item (Admin/Manager). |
Method | Endpoint | Description |
---|---|---|
GET | /api/cart/ |
View cart items. |
POST | /api/cart/ |
Add an item to the cart. |
DELETE | /api/cart/ |
Clear the cart. |
Method | Endpoint | Description |
---|---|---|
GET | /api/orders/ |
View orders (filtered by role). |
POST | /api/orders/ |
Place a new order (Customer only). |
PATCH | /api/orders/<id>/deliver/ |
Mark an order as delivered (Delivery). |
Method | Endpoint | Description |
---|---|---|
GET | /api/groups/manager/users/ |
List all managers. |
POST | /api/groups/manager/users/ |
Add a user to the Manager group. |
GET | /api/groups/delivery-crew/users/ |
List all delivery crew members. |
POST | /api/groups/delivery-crew/users/ |
Add a user to the Delivery Crew . |
python manage.py test
- Set
DEBUG = False
insettings.py
before deployment. - Add appropriate
ALLOWED_HOSTS
for production. - Use environment variables to secure sensitive data like
SECRET_KEY
.
- Include the
db.sqlite3
file. - Provide the
notes.txt
file with all user credentials. - Zip the project directory and submit it.
This project is for educational purposes and does not have a specific license. Contact the author for permissions and inquiries.
For any questions or support, contact:
- Cody Marsengill
- Email: contact@cod-e-codes.com
- GitHub: Cod-e-Codes