
- Create base model with timestamp mixin - Add user model with roles - Add restaurant model - Add menu item model with categories - Add order and order item models - Add delivery model - Fix import issues and linting errors
Food Delivery API
A backend API for a food delivery application built with FastAPI and SQLite.
Features
- User authentication and registration
- Restaurant management
- Menu item management
- Order processing
- Delivery tracking
- Role-based access control
Tech Stack
- FastAPI: Modern, fast web framework for building APIs
- SQLite: Lightweight, file-based relational database
- SQLAlchemy: SQL toolkit and Object-Relational Mapping (ORM)
- Alembic: Database migration tool
- Pydantic: Data validation and settings management
- JWT: JSON Web Tokens for authentication
- Uvicorn: ASGI server for running FastAPI applications
Project Structure
.
├── app
│ ├── api
│ │ └── v1
│ │ ├── api.py
│ │ └── endpoints
│ │ ├── auth.py
│ │ ├── deliveries.py
│ │ ├── menu_items.py
│ │ ├── orders.py
│ │ ├── restaurants.py
│ │ └── users.py
│ ├── core
│ │ ├── config.py
│ │ └── security.py
│ ├── crud
│ ├── db
│ │ └── session.py
│ ├── models
│ ├── schemas
│ ├── services
│ └── utils
├── main.py
└── requirements.txt
Getting Started
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Run the application:
uvicorn main:app --reload
API Documentation
Once the application is running, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Environment Variables
Create a .env
file in the root directory with the following variables:
SECRET_KEY=your_secret_key
Description
Languages
Python
100%