How hurtadosandy21-ops/proyectom2_sandyhurtado works
MiniBlog is an Express REST API for managing authors and their posts in PostgreSQL. Its main workflow routes HTTP requests through controllers for validation and response handling, then services for parameterized SQL; controller errors are forwarded to a global handler. The README also documents interactive Swagger/OpenAPI support and the authors-to-posts relationship. The graph follows the shown imports and calls; schema relationships and Swagger capabilities are included where explicitly documented, while unsampled setup behavior is omitted.
Main entry points: app.js Express App · postController.js Post Controller · authorController.js Author Controller · authorService.js Author Service
Components 15
HTTP API
- HTTP Server
server.js - Express App
app.js - Author Routes
src/routes/authorRoutes.js - Post Routes
src/routes/postRoutes.js - Error Handler
src/middlewares/errorHandler.js
Author and Post Logic
- Author Controller
src/controllers/authorController.js - Post Controller
src/controllers/postController.js - Author Service
src/services/authorService.js - Post Service
src/services/postService.js
Persistence
- PostgreSQL Pool
src/config/db.js - PostgreSQL
- Blog Schema
db/schema.sql
API Documentation
- Swagger Config
src/config/swagger.js - API Schemas
src/config/swaggerComponents.js
Other components
- API Client
Connections 18
- API Client → HTTP Server: sends requests
README.md - HTTP Server → Express App: starts
server.js - Express App → Author Routes: mounts authors
app.js - Express App → Post Routes: mounts posts
app.js - Express App → Error Handler: registers errors
app.js - Express App → Swagger Config: serves docs
app.js - Author Routes → Author Controller: dispatches
src/routes/authorRoutes.js - Post Routes → Post Controller: dispatches
src/routes/postRoutes.js - Author Controller → Author Service: calls
src/controllers/authorController.js - Post Controller → Post Service: calls
src/controllers/postController.js - Post Controller → Author Service: checks author
src/controllers/postController.js - Author Controller → Error Handler: forwards errors
src/controllers/authorController.js - Post Controller → Error Handler: forwards errors
src/controllers/postController.js - Author Service → PostgreSQL Pool: queries
src/services/authorService.js - Post Service → PostgreSQL Pool: queries
src/services/postService.js - PostgreSQL Pool → PostgreSQL: connects
src/config/db.js - Blog Schema → PostgreSQL: defines tables
README.md - Swagger Config → API Schemas: uses schemas
src/config/swagger.js