How agnitanmay/library-management-system works
Main Components
• Client/Browser: The frontend is built with HTML5, CSS3, Bootstrap 4, and jQuery. Views are served from the "views" folder (with subfolders for admin and user pages) and static content is housed in the "public" directory.
• Server/Application: The Node.js/Express application which acts as the backend. Entry point is "app.js" with separate directories for controllers, routes, middleware, utilities, and models.
• Database: MongoDB is used, accessed through Mongoose, with different models (activity, book, comment, issue, user) found in the "models" directory.
• Authentication & Session Management: Handled with Passport.js and session middleware; secrets and DB URL are configured via the ".env" file.
File Structure
• Top-Level Files: Includes the main application file ("app.js"), environmental configuration (".env"), and package scripts.
• Controllers: Located in the "controllers" folder (admin.js, auth.js, books.js, user.js) which coordinate between the models and views.
• Routes: Divided into components (admin, auth, books, index, users); routes direct HTTP requests to the appropriate controllers.
• Models: It contains the definitions for MongoDB collections (activity, book, comment, issue, user) denoting the “M” in MVC.
• Middleware: Contains custom middleware logic used across routes.
• Views: EJS templates (or plain HTML files) are used to render dynamic content for different modules (admin, user, public pages).
• Utilities: Helpers like the image deletion script under "utils".
• Public Assets: Resources such as CSS, JavaScript, images, and stylesheets that are used on the frontend.