Git Product home page Git Product logo

user-api-v5's Introduction

User API

Overview

User API v5 is a Node.js RESTful API designed to manage user data. It allows clients to perform CRUD operations and authentication.

How It Works

  1. User Registration: Create a new user account.
  2. User Authentication: Authenticate users and receive a JWT token.
  3. User Retrieval: Fetch individual or all user details.
  4. User Update: Update existing user information.
  5. User Deletion: Remove user accounts from the system.

Installation

To get the API up and running:

  1. Clone the repository:

    git clone https://github.com/Gords/user-api-v5
    cd user-api-v5
    
  2. Install dependencies:

    npm i
    
  3. Start the dockerized Postgres Database

    docker compose up -d
    
  4. Start the application:

    npm start
    

The API will now be accessible at http://localhost:3000.

API Endpoints

POST /users

Register a new user.

POST /users/login

Authenticate a user and receive a JWT.

GET /users

Retrieve a list of all users (needs the JWT token to be send as a Bearer Token).

GET /users/:uuid

Fetch details of a specific user (needs the JWT token to be send as a Bearer Token).

PUT /users/:uuid

Update a user's information (needs the JWT token to be send as a Bearer Token).

DELETE /users/:uuid

Remove a user from the system (needs the JWT token to be send as a Bearer Token).

Technical Stack

  • TypeScript: For type-safe JavaScript development.
  • Node.js & Express: For backend development.
  • TypeORM: As an ORM tool for database interaction.
  • PostgreSQL: As the database.
  • JWT: For user authentication.
  • Jest: For testing.
  • Morgan: For HTTP request logging.
  • Nodemon: For automatic server restarts during development.
  • Docker: For containerization and deployment of the database.
  • Bcrypt: For secure password hashing and storage.
  • Dotenv: For managing environment variables.

Testing

Run automated tests with:

npm test

License

Licensed under the MIT License.

user-api-v5's People

Contributors

gords avatar

Watchers

 avatar

user-api-v5's Issues

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.