Skip to content

yashj808/LittleLemon

Repository files navigation

LittleLemon API

This is a Django REST Framework API for a fictional restaurant called LittleLemon.

Table of Contents

Installation and Setup

  1. Clone the repository:

    git clone <repository-url>
  2. Create a virtual environment:

    python -m venv venv
  3. Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS and Linux:
      source venv/bin/activate
  4. Install the dependencies:

    • Using pip:
      pip install -r requirements.txt
    • Using pipenv:
      pipenv install
  5. Run the database migrations:

    python manage.py migrate

Running the Application

Backend

  1. Start the development server:
    python manage.py runserver
  2. Open your web browser and navigate to http://127.0.0.1:8000/.

Frontend

  1. Navigate to the UI directory:
    cd little-lemon-ui
  2. Start the Vite dev server:
    npm run dev
  3. Open your web browser and navigate to http://localhost:5173/.

API Endpoints

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.

Testing

To run the automated tests, use the following command:

python manage.py test

The tests are located in the LittlelemonAPI/tests.py file.

Project Structure

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/

Built With

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors