This repository contains the backend services for Transit Tracker. The server is powered by a Laravel application (PHP). The main application is hosted in the frontend repository (a NuxtJS app), but some frontend parts are hosted here (will be detailled below).
- Developper home page
- API : currently V2, V2.1 coming soon
- exo VIN Project: a collaborative effort to associate VIN numbers to fleet numbers. exo GTFS-RT feeds only include the Vehicule Identification Number (VIN) as a Vehicule ID.
- Admin panel (with Filament)
The backend services use multiple services, some hosted on the same server and other hosted elsewere. Where possible, a local installation is preffered.
For local developpement, only a small portion of those services are necessary to run the base application. Optional service might throw an error, but can be ignored.
Required.
SQLite can work, but some migrations will not run. MySQL is the recommended way to go.
Required.
Used for caching and job management (through Horizon).
Mandatory, but can be replaced with php artisan queue:work
Laravel Horizon is the services use to manage the queues where long running jobs are running.
To start the service, run php artisan horizon
The following queue are used (a redesign is coming):
realtime-downloadRealtime data fetchingrealtime-processRealtime data processingnotificationsAll notificationsstaticStatic data update (download and processing)ohdearJobs related to the OhDear monitoring servicedefaultAll others jobs
Optional.
Used for frontend automatic realtime refresh. Using Beyond Code Laravel Websockets.
Optional.
Used for admin notifications about late jobs and invalid static data.
Optional.
Used for monitoring on production, everything running well.
Optional.
Used for VIN suggestion human validation. Bypassed on local.
Optional.
Used for some GTFS-RT feeds that do not work with the PHP implementation (so far, Zenbus feeds).
- PHP (^8.1) with all extensions required by Laravel
- MySQL
- Redis
- Yarn (or npm)
composer installcp .env.example .envcheck the settings and make sure to create a databasephp artisan key:generatephp artisan migratephp artisan horizon:publishyarn installphp artisan tinkerthen create a userUser::create(['name' => 'Admin', 'email' => '[email protected]', 'password' => bcrypt('password')]);- Don’t forget to adjust the
.envvariables,MAIL_TO
- Go to
/adminand create a region and an agency to get started
One process each.
yarn devphp artisan servephp artisan horizonphp artisan websocket:serve
For production environnement.
php artisan migrate --force
yarn install
yarn build
php artisan config:cache
php artisan event:cache
php artisan horizon:terminate
php artisan horizon:publish
php artisan log-viewer:publish
php artisan icons:cache
php artisan route:cache
php artisan schedule-monitor:sync
php artisan view:cache
php artisan websockets:restart