How thanhquang2004/library-server works
Project type and purpose
• This is a backend‐only RESTful API built with Node.js and Express that serves as the core of a Library Management System.
• It exposes endpoints for user authentication, book/catalog management, lending & reservation, fines, notifications, payments, audit logging, etc.
File structure
• Entry points:
– server.js: boots the HTTP server
– app.js: configures Express (middleware, routes, error handler)
• layers (MVC + services):
– routes/: maps HTTP endpoints → controllers
– controllers/: Express handlers → orchestrate request flow → call services
– services/: business logic → uses models to read/write data
– models/: ORM/ODM schemas (Mongoose/Sequelize) for DB entities
• middlewares/: cross‐cutting concerns (auth, rate limiting, logging, validation, error handling, sanitization)
• utils/: shared helpers (email sender, hashing, validation functions)
README for additional insights
• Confirms Node.js 18+, Express, optional choice of MongoDB / PostgreSQL / MySQL
• Env vars drive PORT, DB URL, JWT secret, etc.
• No frontend—pure API server using Git Workflow