How samuelyuma/automotive-marketplace-api works
Automotive Marketplace API serves public HTTP workflows for category management, vehicle listing lifecycle, browsing, filtering, search, and suggestions. Requests enter through Elysia controllers, which validate and translate inputs, invoke application services, and return presented responses. Services use PostgreSQL repositories for domain data and cache ports for selected reads; the server also exposes health checks and optional Upstash rate limiting. The graph preserves the documented filter and suggestion capabilities, though their source was not excerpted. Edges are limited to relationships visible in excerpts, SOURCE INDEX references, or the README.
Main entry points: server.ts App and routes · category.controller.ts Category routes · listing.controller.ts Listing routes · client.ts Postgres access
Components 26
HTTP API
- App and routes
src/main/server.ts - Category routes
src/interface/controllers/category.controller.ts - Listing routes
src/interface/controllers/listing.controller.ts - Search routes
src/interface/controllers/listing-search.controller.ts - Filter routes
src/interface/controllers/filter.controller.ts - Health routes
src/interface/controllers/health.controller.ts - HTTP validation and responses
src/interface/http - Response presenters
src/interface/presenters - Request middleware
src/interface/middleware
Application
- Category service
src/application/service/category.service.ts - Listing service
src/application/service/listing.service.ts - Search service
src/application/service/listing-search.service.ts - Filter service
src/application/service/filter.service.ts - Marketplace domain
src/domain/entities
Persistence
- Category repository
src/repository/postgres/category.repository.ts - Listing repository
src/repository/postgres/listing.repository.ts - Search repository
src/repository/postgres/listing-search.repository.ts - Filter repository
src/repository/postgres/filter.repository.ts - Postgres access
src/infrastructure/postgres/client.ts
Runtime services
- Cache contract
src/application/ports/cache.port.ts - Redis cache backends
src/infrastructure/cache/redis-backend.ts - Runtime configuration
src/main/config/env.ts - Logging and tracing
src/infrastructure/logging/logger.ts
Other components
- API clients
- PostgreSQL
- Redis / Upstash
Connections 40
- API clients → App and routes: sends requests
README.md - App and routes → Category routes: mounts routes
src/main/server.ts - App and routes → Listing routes: mounts routes
src/main/server.ts - App and routes → Search routes: mounts routes
src/main/server.ts - App and routes → Filter routes: mounts routes
src/main/server.ts - App and routes → Health routes: mounts routes
src/main/server.ts - App and routes → Request middleware: registers
src/main/server.ts - App and routes → Runtime configuration: reads settings
src/main/server.ts - App and routes → Redis cache backends: checks backend
src/main/server.ts - Category routes → Category service: calls
src/interface/controllers/category.controller.ts - Category routes → Search service: browses listings
src/interface/controllers/category.controller.ts - Listing routes → Listing service: manages listings
src/interface/controllers/listing.controller.ts - Listing routes → Search service: browses listings
src/interface/controllers/listing.controller.ts - Search routes → Search service: searches and suggests
src/interface/controllers/listing-search.controller.ts - Filter routes → Filter service: requests filters
src/interface/controllers/filter.controller.ts - Category routes → HTTP validation and responses: uses
src/interface/controllers/category.controller.ts - Listing routes → HTTP validation and responses: uses
src/interface/controllers/listing.controller.ts - Category routes → Response presenters: formats results
src/interface/controllers/category.controller.ts - Listing routes → Response presenters: formats results
src/interface/controllers/listing.controller.ts - Category service → Category repository: uses repository
src/main/container.ts - Listing service → Listing repository: uses repository
src/main/container.ts - Search service → Search repository: uses repository
src/main/container.ts - Filter service → Filter repository: uses repository
src/main/container.ts - Filter service → Category repository: loads categories
src/application/service/filter.service.ts - Listing service → Category repository: checks category
src/application/service/listing.service.ts - Category repository → Postgres access: executes queries
src/repository/postgres/category.repository.ts - Listing repository → Postgres access: executes queries
src/repository/postgres/listing.repository.ts - Search repository → Postgres access: executes queries
src/repository/postgres/listing-search.repository.ts - Filter repository → Postgres access: executes queries
src/repository/postgres/filter.repository.ts - Postgres access → PostgreSQL: queries
README.md - Category service → Marketplace domain: uses types
- Listing service → Marketplace domain: uses types
src/application/service/listing.service.ts - Search service → Marketplace domain: uses types
- Category routes → Cache contract: caches reads
src/interface/controllers/category.controller.ts - Listing routes → Cache contract: caches reads
src/interface/controllers/listing.controller.ts - Redis cache backends → Cache contract: implements contract
- Redis cache backends → Redis / Upstash: uses backend
- App and routes → Logging and tracing: configures logger
src/main/server.ts - Postgres access → Logging and tracing: logs queries
src/infrastructure/postgres/client.ts - Runtime configuration → Logging and tracing: sets log level
src/infrastructure/logging/logger.ts