A FastAPI-based backend system for managing drone deliveries with JWT authentication.
- Three User Types: Admin, Enduser, and Drone
- JWT Authentication: Secure token-based authentication
- Real-time Updates: Drone location and status updates
- Order Management: Full lifecycle from creation to delivery
- Rescue System: Automatic reassignment when drones break down
- Admin Dashboard: Comprehensive management tools
- Python 3.11+
- FastAPI - Modern async web framework
- SQLAlchemy 2.0 - Async ORM
- PostgreSQL - Database
- Alembic - Database migrations
- Pydantic - Data validation
- JWT - Authentication
- Docker - Containerization
- Pytest - Testing
drone-delivery-fastapi/
├── alembic/ # Database migrations
│ ├── versions/
│ └── env.py
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI app instance
│ ├── config.py # Configuration settings
│ ├── database.py # Database connection
│ ├── models/ # SQLAlchemy models
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── drone.py
│ │ └── order.py
│ ├── schemas/ # Pydantic schemas
│ │ ├── __init__.py
│ │ ├── auth.py
│ │ ├── drone.py
│ │ ├── order.py
│ │ └── user.py
│ ├── api/ # API endpoints
│ │ ├── __init__.py
│ │ ├── deps.py # Dependencies
│ │ ├── auth.py # Authentication endpoints
│ │ ├── drone.py # Drone endpoints
│ │ ├── enduser.py # Enduser endpoints
│ │ └── admin.py # Admin endpoints
│ ├── core/ # Core business logic
│ │ ├── __init__.py
│ │ ├── security.py # JWT, password hashing
│ │ ├── config.py # Core config
│ │ └── exceptions.py # Custom exceptions
│ ├── services/ # Business services
│ │ ├── __init__.py
│ │ ├── drone_service.py
│ │ ├── order_service.py
│ │ ├── assignment_service.py
│ │ └── location_service.py
│ ├── crud/ # Database operations
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── drone.py
│ │ └── order.py
│ └── utils/ # Utilities
│ ├── __init__.py
│ ├── geospatial.py
│ └── validators.py
├── tests/ # Test files
│ ├── __init__.py
│ ├── conftest.py # Test fixtures
│ ├── test_auth.py
│ ├── test_drone.py
│ ├── test_enduser.py
│ └── test_admin.py
├── docker/
│ ├── Dockerfile
│ └── docker-compose.yml
├── requirements.txt
├── requirements-dev.txt
├── .env.example
├── alembic.ini
├── pyproject.toml # Modern Python project config
└── README.md