https://github.com/yassinekrn/express-local-library-tutorial
A Node.js application for managing a local library, built with Express.js. Features include book cataloging, author management, and lending functionalities. Designed for learning and exploration of web development concepts.
https://github.com/yassinekrn/express-local-library-tutorial
express-middleware express-session express-validator expressjs nodejs pug-templates
Last synced: 2 months ago
JSON representation
A Node.js application for managing a local library, built with Express.js. Features include book cataloging, author management, and lending functionalities. Designed for learning and exploration of web development concepts.
- Host: GitHub
- URL: https://github.com/yassinekrn/express-local-library-tutorial
- Owner: Yassinekrn
- License: mit
- Created: 2023-08-01T15:54:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-14T21:41:51.000Z (5 months ago)
- Last Synced: 2025-03-31T11:16:00.831Z (2 months ago)
- Topics: express-middleware, express-session, express-validator, expressjs, nodejs, pug-templates
- Language: JavaScript
- Homepage:
- Size: 89.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Express LocalLibrary Tutorial
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](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website), with custom enhancements and learnings incorporated during development.

---
## Key Features ✨
- **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.---
## What I Learned ðŸ§
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.---
## Quick Start 🚀
To run this project locally, follow these steps:
### Prerequisites
Ensure you have the following installed:
- [Node.js](https://wiki.developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/development_environment)
- A MongoDB instance (local or cloud-based via [MongoDB Atlas](https://www.mongodb.com/cloud/atlas))### Installation
1. Clone the repository:
```bash
git clone https://github.com/Yassinekrn/express-locallibrary-tutorial.git
cd express-locallibrary-tutorial
```
2. Install dependencies:
```bash
npm install
```
3. Set up your environment variables (if using a custom database):
- Create a `.env` file in the root directory.
- Add the following:
```env
MONGODB_URI=
DEBUG=express-locallibrary-tutorial:*
```### Run the Server
4. Start the server:
```bash
# Linux/macOS
DEBUG=express-locallibrary-tutorial:* npm run devstart# Windows Powershell
$ENV:DEBUG = "express-locallibrary-tutorial:*"; npm start
```
5. Open your browser and navigate to:
```
http://localhost:3000/
```---
## Credits 🙌
This project is a fork of the [MDN Local Library Tutorial](https://github.com/mdn/express-locallibrary-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.
---
## Acknowledgments 💡
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.