LibrarySystem is a Node.js and Express application for browsing a gallery of library-style images, logging in with local credentials, and placing orders for selected items.
- User login with credentials stored in
user.json - Gallery view backed by MongoDB
- Order flow for selecting and purchasing an image
- Session-based authentication
- Handlebars views for server-rendered pages
- Node.js
- Express
- express-handlebars
- client-sessions
- MongoDB
- Node.js 18 or newer
- npm
- A MongoDB Atlas or local MongoDB instance
- Clone the repository.
- Install dependencies:
npm installThe app connects to MongoDB from server.js and order.js. Before running the project, make sure the MongoDB connection string is valid for your environment.
The local login credentials are loaded from user.json.
Start the server with:
npm startThe app runs on port 3000.
Open the application in your browser at:
http://localhost:3000server.jsmain Express application and routesorder.jsorder-related routesuser.jsonlocal username and password datapackage.jsonproject metadata and scripts
- The app expects Handlebars views and public assets to be available in the project structure used by the server.
- If MongoDB is unavailable, the gallery and order pages will not function correctly.