Manishak798 / REST-APIs

This repo contains a project on REST APIs using Node.js, Express.js, Typescript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

REST APIs

πŸš€ Welcome to Your Project Name! This backend REST API project is built using TypeScript, Node.js, Express, MongoDB, and Mongoose. It provides authentication, cookie setting, authorization, and more.

Features

✨ Express & TypeScript: Utilizes Express.js framework with TypeScript for scalable and maintainable codebase.

πŸ”’ Authentication: Implements authentication to secure endpoints and protect resources.

πŸͺ Cookie Setting: Utilizes cookies for session management and user authentication.

πŸ”‘ Authorization: Provides role-based access control (RBAC) to restrict access to certain resources.

πŸ“¦ Dependency Management: Uses npm for managing project dependencies.

πŸ› οΈ Linting & Formatting: Integrates ESLint and Prettier for code linting and formatting.

πŸ” Logging: Includes logging functionality to track application activities.

πŸ“ API Documentation: Documented API endpoints for easy understanding and usage.

πŸ§ͺ Testing: Incorporates testing frameworks like Jest for unit and integration testing.

πŸ”„ Continuous Integration/Continuous Deployment (CI/CD): Integrates CI/CD pipelines for automated testing and deployment.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/your-project.git
  2. Install dependencies:

    cd your-project
    npm install
  3. Configure environment variables:

    cp .env.example .env

    Update .env file with your environment-specific configurations.

  4. Start the server:

    npm start

    The server will be running at http://localhost:8080.

Authentication

To authenticate, send a POST request to /api/auth/login with valid credentials. Upon successful authentication, a token will be provided for subsequent requests.

Authorization

To access protected routes, include the provided token in the request headers:

Authorization: Bearer <token>

Endpoints

User Endpoints

  • POST /api/auth/login: Authenticate user.
  • POST /api/auth/logout: Logout user.
  • POST /api/users: Create a new user.

About

This repo contains a project on REST APIs using Node.js, Express.js, Typescript.


Languages

Language:TypeScript 100.0%