How janchundiaws/backendconsultorio works
Project type and purpose
• This is a full-stack backend service: a RESTful API built with Node.js and Express.js.
• It uses PostgreSQL as the primary data store and the pg library for database access.
• It exposes CRUD endpoints for users, patients, specialties, inventory, clinical histories, and general configuration.
File structure
• Top-level items:
– docker-compose.yml: orchestrates services (app, database).
– database/: SQL scripts for schema and initial data.
– src/: application source code.
– .env / .env.template: environment-specific configuration.
– HEALTH_CHECK.md, README.md: operational and documentation guidelines.
• Inside src/:
– config.js + swagger.js: application configuration and API docs.
– db.js: initializes pg client pool.
– routes/: maps HTTP endpoints to controller functions.
– controllers/: contains business-logic handlers per resource.
– middlewares/: auth and tenant resolution layers.
– helpers/: JWT utilities and token blacklisting.
– index.js: Express app bootstrap, middleware composition, route mounting.
README for additional insights
• Confirms: Node.js, Express.js, PostgreSQL stack.
• Outlines core endpoints and environment variables.
• Mentions development script (npm run dev) and linting.