How santiago-sanchez01/pi2_-sanchez_santiago-mini-blog-api works
MiniBlog API is an Express/PostgreSQL service for CRUD management of authors and posts, with posts linked to authors. Requests enter through the server and app router, then reach the relevant resource routes; those handlers validate inputs and query PostgreSQL. The app also serves interactive Swagger documentation. The graph reflects excerpted calls and README capabilities; database schema details and OpenAPI specification content were not sampled, so their internal behavior is not expanded.
Main entry points: app.js Express app · authors.routes.js Author CRUD · posts.routes.js Post CRUD · index.js PostgreSQL pool
Components 10
HTTP entry
- HTTP server
src/server.js - Express app
src/app.js
Resource operations
- Author CRUD
src/routes/authors.routes.js - Post CRUD
src/routes/posts.routes.js - ID validation
src/middlewares/validateId.js
Persistence and docs
- PostgreSQL pool
src/db/index.js - PostgreSQL database
- Swagger UI
src/app.js - OpenAPI specification
docs/openapi.yaml
Other components
- API client
Connections 11
- API client → HTTP server: sends requests
README.md - HTTP server → Express app: starts
src/server.js - Express app → Author CRUD: mounts /authors
src/app.js - Express app → Post CRUD: mounts /posts
src/app.js - Author CRUD → ID validation: validates IDs
src/routes/authors.routes.js - Post CRUD → ID validation: validates IDs
src/routes/posts.routes.js - Author CRUD → PostgreSQL pool: queries
src/routes/authors.routes.js - Post CRUD → PostgreSQL pool: queries
src/routes/posts.routes.js - PostgreSQL pool → PostgreSQL database: connects to
- Express app → Swagger UI: serves docs
src/app.js - Express app → OpenAPI specification: loads spec
src/app.js