How blurxr/ctcdevbryanchen works
Feeding Brennen is a Next.js starter for tracking restaurants, visits, and dining spend. The visible user workflow is a request to the home page, which fetches the restaurant list through the app’s HTTP API and renders it. Restaurant reads are implemented; write endpoints remain TODOs. The README describes the broader tracking scope, while sampled source shows visit types and seed data but not visit-facing routes or screens, so those are represented as limited data-layer capabilities. Edges reflect shown calls or README statements.
Main entry points: pool.ts Connection pool · restaurants/route.ts Restaurant routes · [id]/route.ts Restaurant detail · 001_create_tables.sql Restaurant and visit schema
Components 14
Web interface
- Restaurant list
client/app/page.tsx - App shell
client/app/layout.tsx - API fetch client
client/lib/apiClient.ts
Restaurant API
- Restaurant routes
client/app/api/restaurants/route.ts - Restaurant detail
client/app/api/restaurants/[id]/route.ts - Health route
client/app/api/health/route.ts - Error mapper
client/lib/errors.ts
Database access
- API data mappers
client/lib/types.ts - Connection pool
client/db/pool.ts - Restaurant and visit schema
client/db/migrations/001_create_tables.sql
Data setup
- Migration runner
client/db/migrate.ts - Sample data seeder
client/db/seed.ts
Other components
- User
- PostgreSQL
Connections 15
- User → Restaurant list: views
README.md - Restaurant list → API fetch client: fetches list
client/app/page.tsx - API fetch client → Restaurant routes: HTTP GET
client/lib/apiClient.ts - Restaurant routes → Connection pool: queries
client/app/api/restaurants/route.ts - Restaurant detail → Connection pool: queries
client/app/api/restaurants/[id]/route.ts - Restaurant routes → API data mappers: maps rows
client/app/api/restaurants/route.ts - Restaurant detail → API data mappers: maps rows
client/app/api/restaurants/[id]/route.ts - Restaurant routes → Error mapper: handles failures
client/app/api/restaurants/route.ts - Restaurant detail → Error mapper: handles failures
client/app/api/restaurants/[id]/route.ts - Connection pool → PostgreSQL: connects
client/db/pool.ts - Migration runner → Connection pool: runs SQL
client/db/migrate.ts - Sample data seeder → Connection pool: writes sample data
client/db/seed.ts - Migration runner → Restaurant and visit schema: loads migration
client/db/migrate.ts - Restaurant and visit schema → PostgreSQL: defines tables
- Sample data seeder → Restaurant and visit schema: seeds restaurants and visits