Git Product home page Git Product logo

devcamper-api's Introduction

Node.JS API for Devcamper

Project Description DevCamper is a fully functional application that allows users to search, create, manage, and evaluate bootcamps. With rich features such as pagination, filtering, and authentication, this project provides a powerful platform for managing and evaluating bootcamp courses. Security is a top priority with encryption mechanisms, common attack protection, and request rate limiting.

Usage

  1. Create and configure the config/config.env file with your settings.
  2. Install dependencies and manage the database:
    cd devcamper-api
    yarn
    node seeder -i  # Create database
    node seeder -d  # Delete database

Tech Stack

  • Node.js / Express.js
  • Mongoose
  • Husky / Prettier / ESLint
  • MongoDB

Documentation

API Endpoints

Base URL: /api/v1/

Resource GET POST PUT DELETE
Bootcamps /, /:id / /:id, /:id/photo /:id
Courses /, /:id /:id /:id
Reviews
Auth /me /register, /login, /forgetpassword /updatedetails
Forget Password /:resettoken
Users /, /:id / /:id /:id

Query Parameters:

  • Filter: housing=true&averageCost[lte]=100
  • Select: select=name&sort=-name
  • Pagination: page=2&limit=10

Bootcamps

  • List: All bootcamps with pagination, filtering, and field selection.
  • Search: By radius from a zipcode.
  • Create: Authenticated users with roles "publisher" or "admin".
  • Update/Delete: Owner only.
  • Photo Upload: Owner only.
  • Calculate: Average course cost and review rating.

Courses

  • List: All or specific bootcamp's courses with pagination and filtering.
  • Create/Update/Delete: Authenticated users with roles "publisher" or "admin".

Reviews

  • List: All reviews or specific bootcamp's reviews with pagination and filtering.
  • Create/Update/Delete: Authenticated users with roles "user" or "admin".

Users & Authentication

  • JWT/Cookie: For authentication, with a 30-day expiry.
  • Registration/Login: User roles include "user" or "publisher".
  • Password Reset: Request reset with a hashed token valid for 10 minutes.
  • CRUD Operations: Admin-only for user management.

Security

  • Password and token encryption
  • XSS prevention
  • NoSQL injection prevention
  • Rate limiting: 100 requests per 10 minutes
  • HTTP parameter pollution prevention
  • Security headers (helmet)
  • CORS enabled for public access

devcamper-api's People

Contributors

nguyenhhkiet avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.