A Django-based backend service for Electronic Logging Device (ELD) systems, providing trip management, log entry generation, and route calculation functionality.
- Trip management (create, read, update, delete)
- Automatic log entry generation
- Route calculation and optimization
- Geocoding and location services
- Fuel stop tracking
- RESTful API endpoints
- Python 3.x
- Django 5.1.7
- Django REST Framework
- PostgreSQL (production) / SQLite (development)
- OpenStreetMap (Nominatim) for geocoding
- OSRM for route calculation
- Gunicorn for production deployment
- Python 3.x
- pip (Python package manager)
- Virtual environment (recommended)
- Clone the repository:
git clone https://github.com/Faith-K-commits/eld_backend
cd eld_backend
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r reqiurements.txt
- Set up environment variables:
Create a
.env
file in the root directory with the following variables:
DEBUG=True
SECRET_KEY=your-secret-key
DATABASE_URL=your-database-url
- Run migrations:
python manage.py migrate
To run the development server:
python manage.py runserver
The server will be available at http://localhost:8000
POST /api/trips/create/
- Create a new tripPUT /api/trips/{id}/
- Update tripDELETE /api/trips/{id}/
- Delete trip
POST /api/trips/{id}/generate-logs/
- Generate log entries for a trip
The project is configured for deployment on Render.com. The render.yaml
file contains the deployment configuration.
To deploy:
- Push your code to a Git repository
- Connect your repository to Render
- Render will automatically deploy your application using the configuration in
render.yaml