How diogobrazil/db-agent-api works
db-agent-api is an HTTP API for customer and product records. Requests enter through the application entry point, reach resource controllers, and are handled by CRUD use cases backed by repository implementations and Prisma. The domain also defines customer and product entities and repository contracts. The README does not describe capabilities beyond the product name; repository implementations and entry-point wiring are not excerpted, so uncertain connections are omitted or marked unverified.
Main entry points: container.ts Dependency Container · index.ts Application Entry · CustomerController.ts Customer Controller · ProductController.ts Product Controller
Components 16
HTTP API
- Application Entry
src/index.ts - Customer Controller
src/infra/http/controllers/CustomerController.ts - Product Controller
src/infra/http/controllers/ProductController.ts - Dependency Container
src/infra/container.ts - Error Handler
src/utils/errorHandler.ts
Domain Logic
- Customer CRUD
src/domain/usecases/customers - Product CRUD
src/domain/usecases/products - Customer Repository
src/domain/repositories/CustomerRepository.ts - Product Repository
src/domain/repositories/ProductRepository.ts
Persistence
- Customer Persistence
src/infra/http/repositories/CustomerReposiotyImpl.ts - Product Persistence
src/infra/http/repositories/ProductReposiotyImpl.ts - Prisma Client
src/infra/config/prisma.ts - Database
Domain Models
- Customer Entity
src/domain/entities/Customer.ts - Product Entity
src/domain/entities/Products.ts
Other components
- API Client
Connections 19
- API Client → Application Entry: sends requests
- Application Entry → Customer Controller: routes requests
src/index.ts - Application Entry → Product Controller: routes requests
src/index.ts - Application Entry → Dependency Container: uses bindings
src/index.ts - Customer Controller → Customer CRUD: executes use cases
src/infra/http/controllers/CustomerController.ts - Product Controller → Product CRUD: executes use cases
src/infra/http/controllers/ProductController.ts - Customer Controller → Error Handler: handles errors
src/infra/http/controllers/CustomerController.ts - Product Controller → Error Handler: handles errors
src/infra/http/controllers/ProductController.ts - Customer CRUD → Customer Repository: uses repository
src/domain/usecases/customers/UpdateCustomer.ts - Product CRUD → Product Repository: uses repository
src/domain/usecases/products/UpdateProduct.ts - Customer Persistence → Customer Repository: implements contract
src/infra/http/repositories/CustomerReposiotyImpl.ts - Product Persistence → Product Repository: implements contract
src/infra/http/repositories/ProductReposiotyImpl.ts - Customer Persistence → Prisma Client: uses client
src/infra/http/repositories/CustomerReposiotyImpl.ts - Product Persistence → Prisma Client: uses client
src/infra/http/repositories/ProductReposiotyImpl.ts - Prisma Client → Database: accesses
- Dependency Container → Customer CRUD: binds use cases
src/infra/container.ts - Dependency Container → Product CRUD: binds use cases
src/infra/container.ts - Dependency Container → Customer Controller: binds controller
src/infra/container.ts - Dependency Container → Product Controller: binds controller
src/infra/container.ts