A comprehensive REST API for managing bootcamps, courses, reviews, and user authentication built with Node.js, Express, and MongoDB.
Devcamp Mastery is a backend REST API designed to handle operations for an educational platform. It provides endpoints for managing bootcamps, courses, user reviews, authentication, and administrative tasks. The API includes features like user registration, JWT-based authentication, file uploads, geocoding for location-based queries, and email notifications.
- 🔐 User Authentication & Authorization: Register, login, password reset, and role-based access control (user, publisher, admin)
- 🎓 Bootcamp Management: Create, read, update, delete bootcamps with photo uploads and location-based search
- 📚 Course Management: Manage courses associated with bootcamps
- ⭐ Review System: Users can create and manage reviews for bootcamps
- 👨💼 Admin Panel: Administrative functions for user management
- 🛡️ Security: Helmet, XSS protection, MongoDB sanitization, rate limiting, CORS
- ⚡ Caching: API response caching for improved performance
- 📁 File Uploads: Support for photo uploads with size limits
- 📍 Geocoding: Location-based queries using zipcode and distance
- 📧 Email Notifications: SMTP-based email sending for password resets, etc.
| Category | Technology |
|---|---|
| Backend | Node.js, Express.js |
| Database | MongoDB with Mongoose ODM |
| Authentication | JSON Web Tokens (JWT) |
| Security | Helmet, express-mongo-sanitize, express-xss-sanitizer, hpp |
| Caching | apicache |
| File Uploads | express-fileupload |
| Geocoding | node-geocoder |
| nodemailer | |
| Other | bcryptjs, slugify, colors |
- GET / or GET /health: Check if the API is running.
- POST /register: Register a new user
- POST /login: Login user
- GET /me: Get current user info (requires auth)
- GET /logout: Logout user (requires auth)
- POST /forgot-password: Request password reset
- PUT /reset-password/:reset_token: Reset password with token
- PUT /update-info: Update user info (requires auth)
- PUT /update-password: Update password (requires auth)
- GET /: Get all bootcamps (with filtering)
- POST /: Create a new bootcamp (publisher auth required)
- GET /:id: Get bootcamp by ID
- PUT /:id: Update bootcamp (publisher auth required)
- DELETE /:id: Delete bootcamp (publisher auth required)
- PUT /:id/photo: Upload bootcamp photo (publisher auth required)
- GET /radius/:zipcode/:distance: Get bootcamps within radius
- GET /: Get all courses (with filtering)
- POST /: Create a new course (publisher auth required)
- GET /:id: Get course by ID
- PUT /:id: Update course (publisher auth required)
- DELETE /:id: Delete course (publisher auth required)
- GET /: Get all reviews (with filtering)
- POST /: Create a new review (user auth required)
- GET /:id: Get review by ID
- PUT /:id: Update review (user auth required)
- DELETE /:id: Delete review (user auth required)
- GET /users: Get all users
- POST /users: Create a new user
- GET /users/:userId: Get user by ID
- PUT /users/:userId: Update user
- DELETE /users/:userId: Delete user
For detailed API documentation, including request/response examples and parameters, visit https://developedbylex.github.io/devcamp.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This API is part of the Devcamp Mastery platform. Ensure you have MongoDB running locally or provide a valid DB_URI for cloud databases.