Skip to content

ki3ki/LittleLemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‹ LittleLemon – Restaurant Management API

A RESTful backend API built using Django and Django REST Framework to manage restaurant menu items and table bookings with token-based authentication.

This project was developed as part of the Meta Back-End Developer Professional Certificate on Coursera.

πŸš€ Tech Stack

Python

Django

Django REST Framework

Djoser (Authentication)

Token Authentication

MySQL

Pipenv

πŸ“Œ Features πŸ” Authentication (Djoser)

User Registration

Login (Token-based)

Logout

Retrieve authenticated user profile

🍽 Menu Management

View all menu items

Create new menu item

Retrieve menu item by ID

Update menu item

Delete menu item

πŸ“… Booking Management

View all bookings

Create booking

Retrieve booking by ID

Update booking

Delete booking

Protected using IsAuthenticated permission

πŸ“‚ Project Structure LittleLemon/ β”‚ β”œβ”€β”€ littlelemon/ # Django project settings β”‚ β”œβ”€β”€ settings.py β”‚ β”œβ”€β”€ urls.py β”‚ β”œβ”€β”€ restaurant/ # Core app β”‚ β”œβ”€β”€ models.py β”‚ β”œβ”€β”€ serializers.py β”‚ β”œβ”€β”€ views.py β”‚ β”œβ”€β”€ urls.py β”‚ β”œβ”€β”€ Pipfile β”œβ”€β”€ Pipfile.lock └── manage.py

πŸ”— API Endpoints πŸ” Authentication

Method Endpoint Description
POST /auth/users/ Register new user
GET /auth/users/me/ Get authenticated user
POST /auth/token/login/ Login and receive token
POST /auth/token/logout/ Logout and invalidate token
Method Endpoint Description
GET /restaurant/menu/ List all menu items
POST /restaurant/menu/ Create menu item
GET /restaurant/menu/<id>/ Retrieve single item
PUT /restaurant/menu/<id>/ Update item
DELETE /restaurant/menu/<id>/ Delete item
Method Endpoint
GET /restaurant/bookings/
POST /restaurant/bookings/
GET /restaurant/bookings/<id>/
PUT /restaurant/bookings/<id>/
DELETE /restaurant/bookings/<id>/

πŸ›  Installation & Setup 1️⃣ Clone Repository git clone https://github.com/ki3ki/LittleLemon.git cd LittleLemon 2️⃣ Install Dependencies (Using Pipenv) pipenv install pipenv shell 3️⃣ Configure Database

Update settings.py with your MySQL credentials: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'littlelemon', 'USER': 'your_username', 'PASSWORD': 'your_password', 'HOST': 'localhost', 'PORT': '3306', } } 4️⃣ Apply Migrations python manage.py makemigrations python manage.py migrate 5️⃣ Create Superuser python manage.py createsuperuser 6️⃣ Run Server python manage.py runserver Server runs at: http://127.0.0.1:8000/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors