How wevertonicaro/auto-parts works
Auto Parts is an Express REST API for managing an automotive-parts catalog, user accounts, and access tokens. The main workflow is a client request entering the HTTP app, passing through the composed router to a domain module, and receiving catalog or account results backed by TypeORM/MySQL. Catalog modules document create, find, update, delete, and—in automakers and cars—file import capabilities. Logging and log retrieval form a separate operational branch. Several module internals were not sampled, so their internal call paths are not asserted.
Main entry points: routes/index.ts API router · container/index.ts DI container · app.ts Express app · dataSource.ts TypeORM connection
Components 20
HTTP API
- Express app
src/http/main/app.ts - API router
src/http/routes/index.ts
Catalog Management
- Automakers
src/modules/Automaker - Automaker import
src/modules/Automaker/useCases/import/ImportAutomakerList.service.ts - Cars
src/modules/Car - Car import
src/modules/Car/useCases/import/ImportCarList.service.ts - Car models
src/modules/CarModels - Parts
src/modules/Parts
Identity & Access
- Users
src/modules/User - User groups
src/modules/GroupUser - Authentication
src/modules/auth
Persistence & Operations
- Health check
src/modules/Health - Log query API
src/modules/Logs/useCase/logs.controller.ts - TypeORM connection
src/shared/infra/typeorm/database/dataSource.ts - MongoDB logs
src/shared/infra/mongodb/index.ts - Winston logger
src/shared/utils/logger/index.ts - DI container
src/shared/container/index.ts - CSV reader
src/shared/utils/CsvReader/CsvReader.ts - Excel reader
src/shared/utils/ExcelReader/ExcelReader.ts
Other components
- API client
Connections 33
- API client → Express app: sends request
- Express app → API router: mounts routes
src/http/main/app.ts - API router → Automakers: dispatches to
src/http/routes/index.ts - API router → Cars: dispatches to
src/http/routes/index.ts - API router → Car models: dispatches to
src/http/routes/index.ts - API router → User groups: dispatches to
src/http/routes/index.ts - API router → Health check: dispatches to
src/http/routes/index.ts - API router → Log query API: dispatches to
src/http/routes/index.ts - API router → Parts: dispatches to
src/http/routes/index.ts - API router → Users: dispatches to
src/http/routes/index.ts - API router → Authentication: dispatches to
src/http/routes/index.ts - Automakers → Automaker import: offers import
src/modules/Automaker/useCases/import/ImportAutomakerList.controller.ts - Automaker import → CSV reader: reads CSV
src/modules/Automaker/useCases/import/ImportAutomakerList.service.ts - Automaker import → Excel reader: reads Excel
src/modules/Automaker/useCases/import/ImportAutomakerList.service.ts - Cars → Car import: offers import
src/modules/Car/useCases/import/ImportCarList.controller.ts - Cars → TypeORM connection: persists catalog
src/modules/Car/repositories/implementations/CarRepository.ts - Car models → TypeORM connection: persists catalog
- Parts → TypeORM connection: persists catalog
- Automakers → TypeORM connection: persists catalog
src/modules/Automaker/repositories/implementations/AutomakerRepository.ts - Users → TypeORM connection: reads users
src/modules/User/repositories/implementations/UserRepository.ts - Express app → TypeORM connection: initializes connection
src/http/main/app.ts - Express app → MongoDB logs: connects logs
src/http/main/app.ts - Log query API → MongoDB logs: queries logs
src/modules/Logs/useCase/logs.controller.ts - Winston logger → MongoDB logs: stores log entries
src/shared/utils/logger/index.ts - Express app → Winston logger: logs requests
src/http/main/app.ts - Express app → DI container: loads registrations
src/http/main/app.ts - DI container → Automakers: registers repository
src/shared/container/index.ts - DI container → Cars: registers repository
src/shared/container/index.ts - DI container → Car models: registers repository
src/shared/container/index.ts - DI container → User groups: registers repository
src/shared/container/index.ts - DI container → Parts: registers repositories
src/shared/container/index.ts - DI container → Users: registers repository
src/shared/container/index.ts - DI container → Authentication: registers token store
src/shared/container/index.ts