How fithcmus/awad-price-migration-starter works
This repository is a teaching starter for a menu service whose price column must evolve without interrupting live traffic. The principal workflow serves menu reads/writes and order placement through an HTTP API backed by shared SQLite storage. Alongside it, migration commands apply or revert schema steps, a consistency checker validates price columns, and a traffic client probes old/new API contracts across instances. The source excerpts show the current API and database setup; migration-file behavior and some utility relationships are documented but their implementations are not sampled.
Main entry points: db.js SQLite connection · app.js Menu API · server.js Server bootstrap · migrate.js Migration runner
Components 10
Menu service
- Server bootstrap
src/server.js - Menu API
src/app.js - Order API
src/app.js
Shared data
- SQLite connection
src/db.js
Migration operations
- Migration runner
scripts/migrate.js - Schema steps
migrations - Menu seeder
scripts/seed.js
Live verification
- Consistency checker
scripts/check.js - Traffic client
scripts/traffic.js
Other components
- API clients
Connections 12
- API clients → Menu API: requests menu
src/app.js - API clients → Order API: places orders
src/app.js - Server bootstrap → SQLite connection: opens database
src/server.js - Server bootstrap → Menu API: starts app
src/server.js - Menu API → SQLite connection: queries menu
src/app.js - Order API → SQLite connection: writes orders
src/app.js - Migration runner → SQLite connection: opens database
scripts/migrate.js - Migration runner → Schema steps: applies or reverts
README.md - Menu seeder → SQLite connection: inserts dishes
scripts/seed.js - Consistency checker → SQLite connection: checks columns
scripts/check.js - Traffic client → Menu API: probes endpoints
scripts/traffic.js - Traffic client → Order API: probes orders
scripts/traffic.js