This is a simple library management system that allows users to add, delete, and search for books in a library. The system is implemented in node.js,ejs and mysql.
- Clone the repository
- Go to your sql command line and write the following:
source path/to/db.sql
Note: The path must be absolute path to the db.sql file present in the repository. 3. Go to the cloned repository and run the following command:
npm install
- Add your mysql username and password in the .env file. You can change the port number in the .env file as well.
- Run the following command to start the server:
npm start
- Go to your browser and type the following in the address bar:
localhost:the_port_number_you_specified
A user can:
- Request to checkin/checkout a book.
- Request for admin privileges.
- View his/her borrowing history.
- Search for books.
- View all books.
An admin can do all the above and:
- Add a book.
- View all the requests made by users.
- Approve/Reject a user's request.
Feedback System: User gets notified when his/her request is approved/rejected.
- Passwords are hashed and salted before storing in the database.
- SQL injection is prevented by using prepared statements.
- JWT tokens are used for authentication.
- Authentication checks are in place for all routes.
Users can request for a book only once before the admin approves/rejects the request.
Users can request for admin privileges only once before the admin approves/rejects the request.