Skip to content

Node.js RESTful API project for managing educational resources in an academy. It offers full CRUD functionality for users , courses , bootcamps and reviews with Express.js for routing and MongoDB for storage.

License

Notifications You must be signed in to change notification settings

carpodok/dev-academy-rest-api

Repository files navigation

📚 Dev Academy REST API

Node.js Express.js MongoDB JWT Swagger

Dev Academy REST API is a Node.js RESTful API designed to manage educational resources in an academy.
It provides full CRUD functionality for:

  • 👩‍🎓 Users
  • 🏫 Bootcamps
  • 📘 Courses
  • ⭐ Reviews

🚀 Endpoints

  • Swagger UI: http://localhost:3000/api-docs
  • Postman Collection: Use the provided JSON file in the project.

Screenshots

auth bootcamps courses reviews users

🔑 Key Features

JWT Authentication – Secure login & session handling
Password Hashing with bcryptjs
RBAC (Role-Based Access Control)
Password Recovery (Forgot & Reset Password)
Email Notifications with nodemailer
Server-Side Validation using express-validator
Advanced MongoDB Queries & Aggregations
Pagination for large datasets
Image Uploads via express-fileupload
SEO-Friendly URLs using slugify
Rate Limiting with express-rate-limit
Mongoose Hooks (pre & post save/update)

⚙️ Installation

  1. Clone the repository
  git clone https://github.com/carpodok/dev-academy-rest-api.git
  1. Navigate to the project directory:
 cd dev-academy-rest-api
  1. Install required dependencies
 npm install

Configuration

  1. Creat a .env file on the root of the project and add the following environment variables. To set up email host informations visit Mailtrap and create your account.
NODE_ENV=development
PORT=3000
MONGO_URI=<your-mongo-uri>

FILE_UPLOAD_PATH= ./public/uploads
MAX_FILE_UPLOAD=1000000

JWT_SECRET=<your-jwt-secret>
JWT_EXPIRE=30d
JWT_COOKIE_EXPIRE=30

// Set up with your own configurations
SMTP_HOST=sandbox.smtp.mailtrap.io
SMTP_PORT=
SMTP_EMAIL=
SMTP_PASSWORD= 
[email protected]
FROM_NAME=Dev Academy

  1. To seed the database with users, bootcamps, courses and reviews with data from the "_data" folder, run
# Destroy all data
node seeder -d

# Import all data
node seeder -i

Running the Application

  1. To start the server, run the following command on the root of the project path;
npm start

For the development purpose;

npm run dev
  1. The application will be running on http://localhost:3000

License

This project is licensed under the MIT License.

About

Node.js RESTful API project for managing educational resources in an academy. It offers full CRUD functionality for users , courses , bootcamps and reviews with Express.js for routing and MongoDB for storage.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published