Public
Like
SmartRoutes
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v4View latest version
This directory contains the database setup and query functions for the SmartRoutes application.
migrations.ts- Contains the database schema definitions and migration functionsqueries.ts- Contains typed query functions for interacting with the database
Stores user account information:
id- Primary keyemail- User's Gmail address (unique)name- User's name (optional)created_at- Account creation timestamplast_login- Last login timestamp
Stores traffic congestion reports:
id- Primary keyuser_id- Foreign key to users tablelatitude- Geographic latitudelongitude- Geographic longitudecongestion_level- Traffic level (1: Light, 2: Moderate, 3: Heavy, 4: Standstill)description- Optional text descriptioncreated_at- Report timestamp
Stores users' last known locations:
id- Primary keyuser_id- Foreign key to users tablelatitude- Geographic latitudelongitude- Geographic longitudeupdated_at- Last update timestamp