A tutorial-based web application for managing a local library's catalog using Node.js and Express.js. 📚
This project showcases an online catalog system for a small local library. It allows users to browse books and view detailed information. The project is based on the MDN Local Library tutorial, with custom enhancements and learnings incorporated during development.
- Book Browsing: View available books, authors, genres, and detailed information for each item.
- Dynamic Web Pages: Developed using Pug templates for server-side rendering.
- RESTful APIs: Includes endpoints to interact with the database seamlessly.
- MongoDB Integration: Uses Mongoose for object data modeling and MongoDB Atlas for cloud-based database hosting.
This project was an excellent learning experience for foundational server-side web development. Key takeaways include:
- Node.js & Express: Learned to build a robust backend for handling HTTP requests and routing.
- Template Engines: Used Pug to dynamically generate HTML based on server-side data.
- Database Modeling: Gained experience in designing and querying MongoDB databases using Mongoose.
- Error Handling: Implemented effective error handling and debugging practices.
- Professional Folder Structuring: Adopted industry-standard project structures and workflows for maintainability and scalability.
- Environment Setup: Configured development environments for Linux and Windows platforms.
To run this project locally, follow these steps:
Ensure you have the following installed:
- Node.js
- A MongoDB instance (local or cloud-based via MongoDB Atlas)
- Clone the repository:
git clone https://github.com/Yassinekrn/express-locallibrary-tutorial.git cd express-locallibrary-tutorial
- Install dependencies:
npm install
- Set up your environment variables (if using a custom database):
- Create a
.env
file in the root directory. - Add the following:
MONGODB_URI=<your_mongodb_connection_string> DEBUG=express-locallibrary-tutorial:*
- Create a
- Start the server:
# Linux/macOS DEBUG=express-locallibrary-tutorial:* npm run devstart # Windows Powershell $ENV:DEBUG = "express-locallibrary-tutorial:*"; npm start
- Open your browser and navigate to:
http://localhost:3000/
This project is a fork of the MDN Local Library Tutorial. While following the tutorial, I added custom code and improvements to enhance functionality and solidify my understanding of Express.js, MongoDB, and project structuring.
Thank you to the MDN Web Docs team for providing an excellent resource for learning server-side development. This project has greatly helped me grow as a developer and deepened my understanding of modern web application architecture.