Skip to content

A secure and scalable Django REST API for restaurant management — built with Django REST Framework, MySQL, and JWT authentication as part of the Meta Backend Developer Capstone.

Notifications You must be signed in to change notification settings

Muhammad-Bilal794/LittleLemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍋 LittleLemon Restaurant API

Description Screenshot
LittleLemon is a full-featured Django REST API designed for modern restaurant management — built as part of the Meta Back-End Developer Capstone Project.
It demonstrates secure authentication, database management, and scalable RESTful API development with Django REST Framework and MySQL.

🧠 Overview

The LittleLemon API is a backend system for managing restaurant operations, including:

  • 🍽️ Menu Management (CRUD)
  • 📅 Table Booking System (secure, token-protected)
  • 🔑 Authentication via JWT and DRF TokenAuth
  • 🧩 Modular structure with reusable serializers and views
  • 🧪 Complete unit test coverage for endpoints and models

This project follows best practices for clean architecture, API versioning, and secure backend design.


🚀 Key Features

Feature Description
🧾 Menu API Create, read, update, and delete menu items.
🪑 Booking API Manage customer table bookings with authentication.
🔒 Authentication Djoser integration for JWT & TokenAuth.
🧠 Permissions Access control with IsAuthenticated.
🧰 Admin Dashboard Manage all data using Django’s built-in admin.
🧪 Unit Testing Automated tests for views, serializers, and models.
🗄️ MySQL Database Fast, reliable, and production-grade data storage.

🏗️ Tech Stack

  • Language: Python 3
  • Framework: Django 5 & Django REST Framework
  • Database: MySQL
  • Authentication: Djoser (JWT + TokenAuth)
  • Environment: Virtualenv
  • Testing: Django TestCase framework
  • API Client Tools: Insomnia / Postman

⚙️ Installation & Setup Guide

Follow these steps to run the project locally:

1️⃣ Clone the Repository

git clone https://github.com/Muhammad-Bilal794/LittleLemon.git
cd LittleLemon
2️⃣ Create Virtual Environment
python -m venv env
env\Scripts\activate   # Windows
source env/bin/activate   # macOS/Linux
3️⃣ Install Dependencies
pip install -r requirements.txt

4️⃣ Configure Database

Edit LittleLemon/settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'LittleLemon',
        'USER': 'littlelemon_user',
        'PASSWORD': 'StrongPassword123!',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    }
}

5️⃣ Apply Migrations
python manage.py makemigrations
python manage.py migrate

6️⃣ Create Superuser
python manage.py createsuperuser

7️⃣ Run Server
python manage.py runserver

Visit the app at:
👉 http://127.0.0.1:8000/restaurant/


🔗 API Endpoints
🍽️ Menu API
| Method    | Endpoint                 | Description            |
| --------- | ------------------------ | ---------------------- |
| GET       | `/restaurant/menu/`      | List all menu items    |
| POST      | `/restaurant/menu/`      | Create a new menu item |
| GET       | `/restaurant/menu/{id}/` | Retrieve a single item |
| PUT/PATCH | `/restaurant/menu/{id}/` | Update existing item   |
| DELETE    | `/restaurant/menu/{id}/` | Delete item            |

---
🪑 Booking API
| Method    | Endpoint                    | Description              |
| --------- | --------------------------- | ------------------------ |
| GET       | `/restaurant/booking/`      | View all bookings        |
| POST      | `/restaurant/booking/`      | Create a booking         |
| GET       | `/restaurant/booking/{id}/` | Retrieve booking details |
| PUT/PATCH | `/restaurant/booking/{id}/` | Update booking           |
| DELETE    | `/restaurant/booking/{id}/` | Delete booking           |

🔒 Authentication Endpoints
| Endpoint             | Description                  |
| -------------------- | ---------------------------- |
| `/auth/users/`       | Register a new user          |
| `/auth/jwt/create/`  | Login (obtain JWT token)     |
| `/auth/jwt/refresh/` | Refresh JWT token            |
| `/auth/jwt/verify/`  | Verify JWT token             |
| `/api-token-auth/`   | Obtain DRF token (TokenAuth) |

🧪 Running Tests
Run all unit tests using:

python manage.py test restaurant


✅ Tests include:

Model creation and field validation

Serializer behavior

View endpoint responses

Token-based authentication

🧠 Learning Outcomes

This project demonstrates:

  • Secure API design using Django REST Framework (DRF) and Djoser
  • Real-world authentication workflows (JWT & TokenAuth)
  • Test-driven backend development
  • API documentation and modular architecture

💼 Project Status

Completed Successfully
Built as part of the Meta Back-End Developer Capstone Project on Coursera.

🌍 Author

Muhammad Bilal
📧 [mb3454545@gmail.com]
🔗 GitHub Profile

🏷️ Repository Topics

django · django-rest-framework · rest-api · backend-development · meta-backend · restaurant-management · mysql · jwt-authentication · token-authentication · api-security · djoser · python · fullstack · capstone-project

🏁 Final Note

This project is a demonstration of production-level backend development using Django REST Framework — combining security, scalability, and clean code architecture for a real-world restaurant application. 🍋

🖼️ Screenshots of some API Endpoints

Home Page

Dashboard

Menu List

User Profile

Token Creation

Menu List

Dynamic Content/Posts

Booking Page

Get , Posts requests for menu items

Orders Page

put,patch,delete request for menu items

Payment Page

🔒 No Access Without Validation Token

Reports Page

About

A secure and scalable Django REST API for restaurant management — built with Django REST Framework, MySQL, and JWT authentication as part of the Meta Backend Developer Capstone.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •