REST API for managing medical delivery drones. This project allows managing drones, medications and their relationships, including features for loading medications onto drones, checking battery status, and more.
- Complete drone management: CRUD for drones with different models and states
- Medication management: CRUD for medications with unique codes
- Medication assignment: System for assigning medications to drones
- Status tracking: Monitoring drone states (IDLE, LOADING, LOADED, DELIVERING, DELIVERED, RETURNING)
- Battery validation: Battery level control (0-100%)
- NestJS - Node.js framework
- TypeScript - Programming language
- PostgreSQL - Relational database
- TypeORM - Database ORM
- Docker - Containerization
- Adminer - Database administration interface
- Node.js 16+
- Docker and Docker Compose
- PostgreSQL (provided via Docker)
- Clone the repository:
git clone https://github.com/PushoDev/drones-api.git- Install dependencies:
cd drones-api
npm install- Configure environment variables:
cp .env.example .env- Start services with Docker:
docker-compose up -d- Start the application:
npm run start:devGET /drones- List all dronesPOST /drones- Create a new droneGET /drones/:id- Get a specific dronePATCH /drones/:id- Update a droneDELETE /drones/:id- Delete a drone
GET /medications- List all medicationsPOST /medications- Create a new medicationGET /medications/:id- Get a specific medicationPATCH /medications/:id- Update a medicationDELETE /medications/:id- Delete a medication
POST /drone-medications/:droneId/medications/:medicationId- Assign a medication to a droneGET /drone-medications/:droneId/medications- Get medications for a droneDELETE /drone-medications/:droneId/medications/:medicationId- Remove a medication from a drone
Drones (drones) --< Drone_Medications >-- Medications (medications)
Contributions are welcome. Please open an issue or submit a pull request to propose changes.
This project is licensed under the MIT License - see the LICENSE file for more details.