Skip to content

Commit c84ecb1

Browse files
Merge pull request #27 from OneBusAway/readme
Update README database design and terminology
2 parents 6ef35f6 + 11d0cad commit c84ecb1

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ The feed is served at a configurable HTTP endpoint (e.g., `GET /gtfs-rt/vehicle-
9595
|`GET /gtfs-rt/vehicle-positions`|GET |GTFS-RT feed (protobuf or JSON) |
9696
|`GET /api/v1/admin/vehicles` |GET |List vehicles |
9797
|`POST /api/v1/admin/vehicles` |POST |Create/update vehicle |
98-
|`GET /api/v1/admin/drivers` |GET |List drivers |
99-
|`POST /api/v1/admin/drivers` |POST |Create/update driver |
98+
|`GET /api/v1/admin/users` |GET |List users |
99+
|`POST /api/v1/admin/users` |POST |Create/update user |
100100
|`POST /api/v1/trips/start` |POST |Driver starts a trip (assigns vehicle to route/trip)|
101101
|`POST /api/v1/trips/end` |POST |Driver ends a trip |
102102
|`GET /api/v1/admin/status` |GET |System health, active vehicles, feed stats |
@@ -138,7 +138,7 @@ In v1, the app sends location reports directly to the server as they are capture
138138
**Core User Flow:**
139139

140140
```
141-
[Login screen] → Enter phone number + PIN
141+
[Login screen] → Enter email address + password
142142
143143
[Select vehicle] → Pick from assigned vehicle list
144144
@@ -184,8 +184,8 @@ A lightweight web-based admin panel for transit operators to manage the system.
184184
**Admin Capabilities:**
185185

186186
- View active vehicles on a map (Leaflet/OpenStreetMap — no Google Maps API key required)
187-
- Create/edit/deactivate vehicles and driver accounts
188-
- Assign drivers to vehicles
187+
- Create/edit/deactivate vehicles and user accounts
188+
- Assign users to vehicles
189189
- View trip history and location trails
190190
- Monitor feed health (last update time, number of active vehicles, error rates)
191191
- Download location data as CSV for analysis
@@ -236,10 +236,11 @@ This timeline follows the GSoC 2026 standard coding period (May 25 – August 24
236236
- Initialize Go project with module structure, CI, and linting
237237
- Define and compile `gtfs-realtime.proto` into Go code
238238
- Implement the database schema and repository layer:
239-
- Vehicles table (id, label, agency_id, active)
240-
- Drivers table (id, name, phone, pin_hash, vehicle_id)
241-
- Trips table (id, vehicle_id, route_id, trip_id, start_time, end_time, status)
242-
- Location points table (id, vehicle_id, trip_id, lat, lon, bearing, speed, accuracy, timestamp, received_at)
239+
- Vehicles table (id, label, agency_tag, active, created_at, updated_at)
240+
- Users table (id, name, email, password_hash, role, created_at, updated_at)
241+
- User vehicles table (user_id, vehicle_id) — join table for many-to-many user/vehicle assignments, composite primary key
242+
- Trips table (id, user_id, vehicle_id, route_id, gtfs_trip_id, start_time, end_time, status, created_at, updated_at)
243+
- Location points table (id, user_id, vehicle_id, trip_id, lat, lon, bearing, speed, accuracy, source_type, recorded_at, received_at) — `source_type` is an enum/string column (e.g. `driver_app`, `crowdsourced`, `avl_import`) defaulting to `driver_app`; allows filtering and applying different trust/accuracy thresholds per data source in the future
243244
- Implement `POST /api/v1/locations` — accept a location report, validate, persist, update in-memory state
244245
- Implement `GET /gtfs-rt/vehicle-positions` — build a `FeedMessage` from in-memory state and serialize to protobuf
245246
- Add JSON output option for debugging (`?format=json`)
@@ -252,25 +253,26 @@ This timeline follows the GSoC 2026 standard coding period (May 25 – August 24
252253

253254
**Deliverable:** The server has secure authentication for drivers and API consumers, plus admin endpoints for managing vehicles and drivers.
254255

255-
- Implement driver authentication:
256-
- `POST /api/v1/auth/login`phone + PIN → JWT token
257-
- JWT middleware for all driver-facing endpoints
256+
- Implement user authentication:
257+
- `POST /api/v1/auth/login`email + password → JWT token
258+
- JWT middleware for all authenticated endpoints
258259
- Token refresh flow
259-
- Implement API key authentication for feed consumers (separate from driver auth)
260+
- Implement API key authentication for feed consumers (separate from user auth)
260261
- Implement admin CRUD endpoints:
261262
- Vehicles: create, read, update, deactivate
262-
- Drivers: create, read, update, deactivate, assign to vehicle
263+
- Users: create, read, update, deactivate
264+
- User–vehicle assignments: manage many-to-many relationships
263265
- Trips: start, end, list active, list historical
264-
- Implement basic authorization (admin vs. driver roles)
266+
- Implement basic authorization (admin vs. user roles)
265267
- Implement system status endpoint (`GET /api/v1/admin/status`)
266268
- Write tests for auth flows and admin operations
267269

268-
**Exit Criteria:** Drivers can log in and submit locations with a valid token. Unauthorized requests are rejected. Admins can manage vehicles and drivers via the API.
270+
**Exit Criteria:** Users can log in and submit locations with a valid token. Unauthorized requests are rejected. Admins can manage vehicles and users via the API.
269271

270272
-----
271273

272274
> **⏰ Midterm Evaluation (July 6–10)**
273-
>
275+
>
274276
> At this point, the contributor should have a functional server that: (1) authenticates drivers, (2) ingests location reports, (3) serves a valid GTFS-RT feed, and (4) has admin management endpoints. The server should be deployable via Docker. The mentor evaluates progress, adjusts scope if needed, and confirms direction for the Android app work.
275277
276278
-----
@@ -280,7 +282,7 @@ This timeline follows the GSoC 2026 standard coding period (May 25 – August 24
280282
**Deliverable:** A working Android app that captures GPS locations continuously via a foreground service and sends them directly to the server.
281283

282284
- Set up Android project (Kotlin, Jetpack Compose, Hilt)
283-
- Implement driver login screen (phone + PIN → JWT from server)
285+
- Implement login screen (email + password → JWT from server)
284286
- Implement vehicle selection and trip start/end flow
285287
- Implement location tracking foreground service:
286288
- `FusedLocationProviderClient` with configurable interval (default 10s)
@@ -309,7 +311,7 @@ This timeline follows the GSoC 2026 standard coding period (May 25 – August 24
309311
- Dashboard: active vehicles count, feed health, last update times
310312
- Vehicle map: Leaflet/OSM showing current vehicle positions
311313
- Vehicle management: CRUD interface
312-
- Driver management: CRUD interface, vehicle assignment
314+
- User management: CRUD interface, vehicle assignment
313315
- Trip history: searchable list with location trail visualization
314316
- Polish the Android app:
315317
- Handle all permission request flows (location, notification, battery optimization)

0 commit comments

Comments
 (0)