Application for tracking the arrival times for all San Francisco Muni transit route using the NextBus API, for determining the on-time performance of every route on a stop-by-stop basis
First, install Docker:
- Install Docker CE
- Install Docker Compose
- Set a password for the database by editing the
db_config.env
file and setting a value for thePOSTGRES_PASSWORD
key. - Build the Docker containers using the command
docker-compose build
- Bring up the database Docker container using the command
docker-compose up database
- Create the required tables in the database from the worker Docker container using the command
docker-compose run worker python manage.py migrate
- Add schedules to the database from the worker Docker container using the command
docker-compose run worker python manage.py update_schedules
The worker will automatically run when the worker Docker container is brought up. Start it by using the command docker-compose up worker
Currently, the following worker commands are supported with Django's manage.py
:
Update the schedules stored in the database, for either all routes or only a single route.
Command:
python3 <repository path>/manage.py update_schedules
Arguments:
--route <route tag>
: Update the schedules for the indicated route instead of for all routes.
Run the worker to track and add arrivals to the database, for either all routes or only a single route.
Command:
python3 <repository path>/manage.py run
Arguments:
--route <route tag>
: Track arrivals for the indicated route instead of for all routes.