Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍋 Little Lemon Backend Capstone Project

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.

🔧 Technologies Used

  • Django 5
  • Django REST Framework
  • MySQL
  • Djoser (for token-based authentication)
  • Role-based access (Manager, Customer, Delivery Crew)
  • Unit Testing

🚀 Features

  • ✅ 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

⚙️ Getting Started

1. Clone the Repository

git clone https://github.com/your-username/little-lemon-back-cap.git
cd little-lemon-back-cap

2. Set Up Python Environment

python -m venv env
source env/bin/activate  # Windows: env\Scripts\activate
pip install -r requirements.txt

3. Set Up MySQL Database

  • 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.py with your MySQL credentials:
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'littlelemon',
        'USER': 'yourname',
        'PASSWORD': 'yourpassword',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}

4. Run Migrations

python manage.py migrate

📦 Optional: Load Sample Data

Use the provided sample_data.json file to preload menu items and bookings:

python manage.py loaddata sample_data.json

🧪 Run Unit Tests

python manage.py test

All 4 tests should pass ✅


🔑 Authentication

  • Use Djoser’s token auth system.
  • To test, create users and retrieve their token at /auth/token/login/.

📬 API Overview

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

🎓 Coursera Peer Review Checklist


👨‍💻 Author

Rahul Kumar
Backend Developer | Meta Capstone Graduate

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages