How mohamed8483/task_manager_api works
This is an Express REST API for product management and user registration/login, backed by PostgreSQL. The main workflow is HTTP request → mounted route → controller validation/response mapping → service logic → repository query → database result. Product services also check category existence; authentication services validate credentials, hash registration passwords, and compare login passwords. The README documents search, pagination, CRUD, and username-or-email login. Edges follow shown calls or documented wiring; the database schema and API behavior are documented, but no unsampled implementation details are inferred.
Main entry points: server.js Server startup · service.auth.js Auth service · controller.auth.js Auth controller · db.js PostgreSQL pool
Components 16
HTTP runtime
- Server startup
server.js - Express app
src/app.js - HTTP status codes
constants/httpStatus.js
Authentication
- Auth routes
routes/routes.auth.js - Auth controller
controllers/controller.auth.js - Auth service
services/service.auth.js - Auth repository
repositories/repository.auth.js
Product management
- Product routes
routes/routes.products.js - Product controller
controllers/controller.products.js - Product service
services/service.products.js - Product repository
repositories/repository.product.js
Persistence
- PostgreSQL pool
config/db.js
Other components
- API client
- PostgreSQL
- bcrypt
- Email validator
Connections 17
- API client → Server startup: sends requests
README.md - Server startup → Express app: loads app
server.js - Server startup → Product routes: mounts routes
server.js - Server startup → Auth routes: mounts routes
server.js - Express app → Server startup: parses JSON
src/app.js - Auth routes → Auth controller: dispatches
routes/routes.auth.js - Auth controller → Auth service: calls
controllers/controller.auth.js - Auth controller → HTTP status codes: maps status
controllers/controller.auth.js - Auth service → Auth repository: calls
services/service.auth.js - Auth service → bcrypt: hashes and compares
services/service.auth.js - Auth service → Email validator: validates email
services/service.auth.js - Product routes → Product controller: dispatches
routes/routes.products.js - Product controller → Product service: calls
controllers/controller.products.js - Product service → Product repository: calls
services/service.products.js - Auth repository → PostgreSQL pool: queries
repositories/repository.auth.js - Product repository → PostgreSQL pool: queries
repositories/repository.product.js - PostgreSQL pool → PostgreSQL: connects to
README.md