Hi 👋
This repository contains my hands-on practice while learning Node.js, Express, and MongoDB by following Dave Gray’s tutorials. The goal of this project was to move beyond theory and build real backend features using industry‑standard tools and best practices.
This repo reflects my learning journey, experiments, and understanding of building RESTful APIs with authentication, authorization, and database integration.
- Node.js – JavaScript runtime for building server-side applications
- Express.js – Fast and minimal web framework for Node.js
- MongoDB – NoSQL database for storing application data
- Mongoose – ODM for MongoDB
- JWT (JSON Web Tokens) – Authentication & authorization
- bcrypt – Password hashing
- dotenv – Environment variable management
- CORS & Cookies – Secure cross-origin requests
Through this project, I gained practical experience with:
- Setting up an Express server
- Structuring a Node.js backend project
- Connecting and interacting with MongoDB using Mongoose
- Creating RESTful APIs (CRUD operations)
- User authentication and authorization (JWT, roles & permissions)
- Password hashing and security best practices
- Middleware (custom middleware, JWT verification, role-based access)
- Error handling and logging
- Working with environment variables
- Using Postman for API testing
src/
│── config/ # Database, roles, CORS configuration
│── controllers/ # Request handling logic
│── middleware/ # JWT, roles, error handling, logging
│── models/ # Mongoose schemas
│── routes/ # API routes
│── server.js # App entry point- Clone the repository
git clone https://github.com/libanmoo/Mastering-Node-JS
cd Mastering-Node-JS- Install dependencies
npm install- Create a
.envfile
PORT=3500
DATABASE_URI=your_mongodb_connection_string
ACCESS_TOKEN_SECRET=your_access_token_secret
REFRESH_TOKEN_SECRET=your_refresh_token_secret- Run the server
npm run dev
# or
npm start- Uses JWT for secure authentication
- Supports role-based authorization (e.g. User, Editor, Admin)
- Access tokens & refresh tokens are implemented for better security
- APIs were tested using Postman
- Different user roles were used to verify protected routes
This project is based on and inspired by Dave Gray’s Node.js & Express tutorials. Full credit goes to him for the excellent explanations and learning material.
- Practice backend development concepts
- Demonstrate understanding of Node.js, Express, and MongoDB
- Serve as a reference for future projects
- Showcase progress and consistency in learning backend development
Feedback and suggestions are always welcome. This is a learning-focused project, and improvements are part of the journey.
This project is for educational purposes.
Thanks for checking out my project! 🙌