How charusathwik06/student-management-api works
This is a Node.js/Express Student Management API. A client sends CRUD requests to the running app; student routes dispatch them to controllers, which invoke the student service for database operations. ID-based routes validate the ID before reaching the controller, and errors are forwarded to centralized middleware. The README documents PostgreSQL integration and environment-based configuration; sampled code confirms the service-to-pool query path. The graph focuses on these runtime stages; it does not assume that the documented API behavior has been tested.
Main entry points: app.js Express app · StudentRoutes.js Student routes · StudentController.js Student controller · validateStudentid.js ID validation middleware
Components 10
Request handling
- Express app
app.js - Student routes
students/StudentRoutes.js - Student controller
students/StudentController.js - ID validation middleware
middleware/validateStudentid.js - ID validator
utils/validateid.js - Error handler
middleware/errorHandler.js
Student data
- Student service
students/StudentService.js - PostgreSQL pool
db.js
Other components
- API client
- PostgreSQL
Connections 10
- API client → Express app: sends requests
README.md - Express app → Student routes: mounts routes
app.js - Express app → Error handler: installs handler
app.js - Student routes → Student controller: dispatches requests
students/StudentRoutes.js - Student routes → ID validation middleware: validates IDs
students/StudentRoutes.js - ID validation middleware → ID validator: calls validator
middleware/validateStudentid.js - Student controller → Student service: calls operations
students/StudentController.js - Student service → PostgreSQL pool: queries through
students/StudentService.js - PostgreSQL pool → PostgreSQL: queries database
README.md - Student controller → Error handler: forwards errors