How neo7337/bite-express works
BiteExpress is a multi-tenant restaurant discovery API backed by MongoDB. A client lists, retrieves, creates, or naturally searches restaurants; REST handlers validate and translate requests, the service applies tenant scope and merges search intent, and a cached repository serves the MongoDB query. A separate seed command cleans and upserts CSV data. The graph includes README-documented capabilities such as geo sorting, health/readiness, and idempotent seeding; some internal implementation links are omitted where sampled source does not establish the call.
Main entry points: restaurants_handler.go Restaurant handlers · conn_manager.go Connection manager · router.go Route dispatch · restaurants_svc.go Restaurant service
Components 22
REST API
- REST server
internal/api/rest/rest.go - Route dispatch
internal/api/rest/router/router.go - Restaurant handlers
internal/api/rest/handler/restaurants_handler.go - Query parameters
internal/api/rest/handler/params.go - Request validation
internal/api/rest/handler/validate.go - API DTO mapping
internal/api/rest/handler/dto.go
Search
- Restaurant service
internal/service/restaurants_svc.go - NLQ interpretation
internal/search/nlq
Data access
- Connection manager
internal/repository/connections/conn_manager.go - Cached repository
internal/repository/cached/restaurants.go - Memory cache
internal/cache/cache.go - Repository contract
internal/repository/restaurants_repo.go - Mongo repository
internal/repository/mongodb/restaurants_repo_impl.go - Query aggregation
internal/repository/mongodb/pipeline.go - Mongo connection
internal/repository/mongodb/repository.go - MongoDB
Runtime and ingestion
- Server entry
cmd/server/server.go - App lifecycle
internal/app/app.go - Configuration
internal/config/config.go - CSV seeding
cmd/seed/main.go - Seed cleanup
cmd/seed/clean.go
Other components
- API client
Connections 25
- API client → REST server: sends requests
README.md - Server entry → Configuration: loads settings
cmd/server/server.go - Server entry → App lifecycle: starts
cmd/server/server.go - App lifecycle → Connection manager: registers lifecycle
internal/app/app.go - App lifecycle → REST server: starts after connections
internal/app/app.go - REST server → Route dispatch: configures routes
internal/api/rest/rest.go - Route dispatch → Restaurant handlers: dispatches requests
internal/api/rest/router/router.go - Route dispatch → Restaurant service: constructs service
internal/api/rest/router/router.go - Route dispatch → Connection manager: checks readiness
internal/api/rest/router/router.go - Restaurant handlers → Query parameters: parses filters
internal/api/rest/handler/restaurants_handler.go - Restaurant handlers → Request validation: validates create
- Restaurant handlers → Restaurant service: calls operations
internal/api/rest/handler/restaurants_handler.go - Restaurant handlers → API DTO mapping: maps responses
- Restaurant service → NLQ interpretation: interprets query
internal/service/restaurants_svc.go - Restaurant service → Repository contract: reads and writes
internal/service/restaurants_svc.go - Connection manager → Mongo connection: opens connection
internal/repository/connections/conn_manager.go - Connection manager → Mongo repository: registers repository
internal/repository/connections/conn_manager.go - Connection manager → Cached repository: wraps when enabled
internal/repository/connections/conn_manager.go - Cached repository → Memory cache: uses providers
internal/repository/cached/restaurants.go - Cached repository → Mongo repository: delegates cache misses
internal/repository/cached/restaurants.go - Mongo repository → Query aggregation: builds list aggregation
- Mongo connection → MongoDB: connects and pings
internal/repository/mongodb/repository.go - Mongo repository → MongoDB: queries restaurants
- Seed cleanup → CSV seeding: cleans input
cmd/seed/clean.go - CSV seeding → MongoDB: upserts records
README.md