This is a Django REST Framework API for a fictional restaurant called LittleLemon.
-
Clone the repository:
git clone <repository-url>
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install the dependencies:
- Using
pip:pip install -r requirements.txt
- Using
pipenv:pipenv install
- Using
-
Run the database migrations:
python manage.py migrate
- Start the development server:
python manage.py runserver
- Open your web browser and navigate to
http://127.0.0.1:8000/.
- Navigate to the UI directory:
cd little-lemon-ui - Start the Vite dev server:
npm run dev
- Open your web browser and navigate to
http://localhost:5173/.
The following API endpoints are available:
/(Home endpoint)admin/api/menu-items/api/menu-items/<int:pk>/api/secret/api/api-token-auth/api/manager-view/api/throttle_check/api/throttle_check_auth/api/categories/api/categories/<int:pk>/api/groups/manager/users/api/ratings/auth/(Djoser endpoints for user registration and authentication)
For more details on the API, please refer to the API documentation.
To run the automated tests, use the following command:
python manage.py testThe tests are located in the LittlelemonAPI/tests.py file.
LittleLemon/
├── .gitignore
├── manage.py
├── Pipfile
├── Pipfile.lock
├── requirements.txt
├── README.md
├── db.sqlite3
├── Littlelemon/
│ ├── __init__.py
│ ├── asgi.py
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│ └── __pycache__/
└── LittlelemonAPI/
├── __init__.py
├── admin.py
├── apps.py
├── models.py
├── serializers.py
├── tests.py
├── throttles.py
├── urls.py
├── views.py
└── migrations/