This project is a web application for managing a collection of books. It provides a user-friendly interface for users to view, add, update, and delete books. The backend is built with Express.js, EJS, and MongoDB, while the frontend is rendered dynamically using EJS templates.
-
Backend Setup:
- Create a new Express.js application.
- Set up the server to listen on a port of your choice.
-
Connect to MongoDB:
- Connect your Express application to a MongoDB database using Mongoose.
-
Define Book Schema:
- Define a Mongoose schema for the book collection. Include fields for title, author, genre, and publication year.
-
Create API Endpoints:
- Implement CRUD operations for managing books:
GET /books
GET /books/:id
POST /books
PUT /books/:id
DELETE /books/:id
- Implement CRUD operations for managing books:
-
Frontend Setup with EJS:
- Set up EJS as the view engine for your Express application.
- Create EJS templates for rendering dynamic views.
-
Render Views Dynamically:
- Render the EJS templates with dynamic data from the backend.
-
Implement CRUD Operations:
- Implement CRUD logic in the backend.
- Ensure frontend views reflect changes in real-time.
Include screenshots or a video demonstrating the functionality of the application.
Provide a brief reflection on your learning experience and any improvements you would make if you were to continue working on the project.
This project is licensed under the MIT License.