This is a capstone project for the Backend Engineering on Coursera. The goal of this project is to develop a RESTful API for LittleLemon Restaurant. The API will be used to manage the restaurant's menu and orders. The API will be developed using Python and Django Rest Framework.
- Python 3.6 or higher
- Django 3.0 or higher
- Django Rest Framework 3.11 or higher
- MySQL 12.1 or higher
-
Clone the repo
git clone https://github.com/aniebietafia/LittleLemon-Capstone-Project.git
-
Install dependencies
pip install -r requirements.txt
-
Create a database in MySQL
CREATE DATABASE littlelemon;
-
Create a .env file in the root directory and add the following environment variables
SECRET_KEY=your_secret_key DEBUG=True DB_NAME=littlelemon DB_USER=your_db_user DB_PASSWORD=your_db_password DB_HOST=yout_db_host DB_PORT=your_db_port
-
Run migrations
python manage.py migrate
-
Run the server
python manage.py runserver
-
Run tests
python manage.py test
Method | Endpoint | Description |
---|---|---|
GET | /api/menu/ | Get all menu items |
POST | /api/menu/ | Create a new menu item |
GET | /api/menu/{id}/ | Get a menu item by id |
PUT | /api/menu/{id}/ | Update a menu item by id |
DELETE | /api/menu/{id}/ | Delete a menu item by id |
Method | Endpoint | Description |
---|---|---|
GET | /api/booking/ | Get all bookings |
POST | /api/booking/ | Create a new booking |
GET | /api/booking/{id}/ | Get a booking by id |