Skip to content

REST API for my Noms&Bits Recipe Website project. Tech stack ? PE(?)N :b Postgres, Express, ? (React/Vue idk), NodeJs

Notifications You must be signed in to change notification settings

SamRB-dev/NomsnBits-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Noms&Bits REST API - v1.0

This is a RESTful API built with Node.js, Express.js and PostgreSQL that provides registration, user data retrieval, user deletion and other functionalities for the Noms&Bits web application.

API URL

  https://nomsnbits-rest-api.onrender.com

ToDo

  • Login & Authorization

Getting Started

To get started with this project, you should have Node.js, Express.js and PostgreSQL installed on your machine. It is recommended to create a virtual environment for your project. Refer Here

Testing

Client: RESTClient on VScode Marketplace

API Endpoints

This API has the following endpoints:

  • GET / Description: Returns a 200 status code and a JSON message "OK" when the server is running.

  • POST /auth/register Description: Allows a user to register for an account with a unique username, email, and password. Example:

    • Request

      POST http://URL/api/auth/register
      Content-Type: application/json
      
      {
        "username": "test123",
        "email": "test123@email.com",
        "password": "test-password",
        "regDate": "2023-02-20"
      }
      
    • Response

      {
          "status": 200,
          "message": "Successfully Registered the Account"
      }
  • GET /user/:username Description: Retrieves the data of a user with the specified username. Example:

    • Response
    {
    "status": 200,
    "data": [
      {
        "username": "john_doe",
        "email": "john_doe@example.com",
        "password": "$2b$08$7z1Mx.McDCMzQyjYKj7.3uJqfkB7V2OZJb9X9q3CmrsKzdOwNUy8W",
        "registration_date": "2022-01-11"
        }
      ]
    }
  • DELETE /user/:username Description: Deletes the account of a user with the specified username Example:

    • Response
    {
      "status": 200,
      "message": "User data has been deleted"
    }
  • PUT /user/:username/update-uname/:newuname Description: Allows a user to update their username. Example:

    • Response
    {
      "status": 200,
      "message": "Successfully Updated the username"
    }
  • PUT /user/:username/update-passwd/:newpasswd Description: Allows a user to update their password. Example:

    • Response
    {
      "status": 200,
      "message": "Successfully Updated the Password"
    }
  • PUT /user/:username/update-email/:newemail Description: Allows a user to update their login email. Example:

    • Response
    {
      "status": 200,
      "message": "Successfully Updated the Login Email"
    }
  • POST /auth/login Description: Example:

README format

- 
**Description**:
**Example**: 

About

REST API for my Noms&Bits Recipe Website project. Tech stack ? PE(?)N :b Postgres, Express, ? (React/Vue idk), NodeJs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •