Skip to content

sanengineer/bakergun-backend-service-users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Build Backend Stack CRUD and Private ReSTAPI with Authorization with NodeJS, PostgreSQL, Sequelize and Swagger (API Documentations)

This project use ExpressJS ๐Ÿš€ (NodeJS framework), EJS for admin dashboard, PosgreSQL, Sequelize (ORM For NodeJS) and and ๐Ÿ”ซ Swagger (API Documentations).

Let's Try Demo

on https://bakergun-backend-service-users.herokuapp.com

Flow Chart Full Stack On This Project

Flow_Chart_Fullstack_Web_Develompent

ER Diagram For ๐Ÿ˜ PostgreSQL

Entity Diagram PostgreSQL

RestAPI

  • Public RestAPI

      http://localhost:{PORT}/api/v1
    
  • Admin RestAPI

      http://localhost:{PORT}/admin-api/v1
    

Endpoints URL For Public (Client)

Sign Up User Game

  • POST on:

      Request Body:
      {
         "username": "string",
         "email": "string"
         "password": "string"
      }
    
      http://localhost:{PORT}/api/v1/user-game
    

Login User Game

  • POST on:

      Request Body:
      {
         "username": "string",
         "password": "string"
      }
    
      http://localhost:{PORT}/api/v1/user-game
    

Private ReSTAPI For User Has Sign Up (Need Tokens)

  • GET, PUT, DELETE on :

      Request Params: ID
    
      http://localhost:{PORT}/api/v1/user-game/{ID}
    
    
      Example:
    
      http://localhost:8080/api/v1/user-game/1
    
  • POST on :

      Request Body:
       {
         "user_id" : integer,
         "fullname": "string",
         "sex" : "string",
         "jobs" : "string"
       }
    
      http://localhost:{PORT}/api/v1/user-game-biodata
    
  • GET, And PUT on:

      Request Params: ID
    
      http://localhost:{PORT}/api/v1/user-game-biodata/{ID}
    
    
      Example:
    
      http://localhost:{PORT}/api/v1/user-game-biodata/1
    
  • POST on :

      Request Body:
      {
          "score"  : "string",
          "comment": "string"
      }
    
      http://localhost:{PORT}/api/v1/user-game-history
    
  • GET and PUT on :

      Request Params: ID
    
      http://localhost:{PORT}/api/v1/user-game-history/{ID}
    
    
      Example:
    
      http://localhost:{PORT}/api/v1/user-game-history/1
    

Endpoints URL For Admin

User Game Data

Create One User Game
  • POST on:

      Request Body:
      {
         "username": "string",
         "email": "string"
         "password": "string"
      }
    
      http://localhost:{PORT}/admin-api/v1/user-game
    
Get All Users Game or Filtering By Query
  • GET All on:

      http://localhost:{PORT}/admin-api/v1/user-game
    
  • GET All with Filtering by Query:

      Request Query: USERNAME
    
              http://localhost:{PORT}/admin-api/v1/user-game?username={USERNAME}
    
    
      Request Query: EMAIL
    
              http://localhost:{PORT}/admin-api/v1/user-game?email={EMAIL}
    
    
    
      Example:
    
      http://localhost:8080/admin-api/v1/user-game?email=hi@sanengineer.com
    
Update One User Game
  • UPDATE on:

      Request Params: ID
    
      Request Body:
      {
         "username": "string"
      }
    
      or
    
      {
         "email": "string"
      }
    
      http://localhost:{PORT}/admin-api/v1/user-game/{ID}
    
    
    
      Example
    
       http://localhost:8080/admin-api/v1/user-game/1
    
Change One User Game Password
  • UPDATE on:

      Request Params: ID
    
      Request Body:
      {
        "password": "string"
      }
    
      http://localhost:{PORT}/admin-api/v1/user-game-password/{ID}
    
    
    
      Example:
    
      http://localhost:8080/admin-api/v1/user-game-password/1
    
Delete On User Game
  • DELETE on:

      Request Params: ID
    
      Request Query: Username
    
      http://localhost:{PORT}/admin-api/v1/user-game/{ID}?username={USERNAME}
    
    
    
      Example:
    
      http://localhost:8080/admin-api/v1/user-game/1?username=sanengineer
    

User Game Biodata Data

Create One User Game Biodata
  • POST on:

      Request Body:
       {
         "user_id" : integer,
         "fullname": "string",
         "sex" : "string",
         "jobs" : "string"
       }
    
      http://localhost:{PORT}/admin-api/v1/user-game-biodata
    
Get All Users Game Biodata or Filtering by Query
  • GET on:

      http://localhost:{PORT}/admin-api/v1/user-game-biodata
    
  • GET All Filtering By Query:

      Request Query: FULLNAME
    
              http://localhost:{PORT}/admin-api/v1/user-game-biodata?fullname={FULLNAME}
    
    
      Request Query: SEX
    
              http://localhost:{PORT}/admin-api/v1/user-game-biodata?sex={SEX}
    
    
      Requst Query: JOBS
              http://localhost:{PORT}/admin-api/v1/user-game-biodata?jobs={JOBS}
    
    
    
      Example:
    
      http://localhost:{PORT}/admin-api/v1/user-game-biodata?jobs=engineer
    
Update One User Game Biodata
  • UPDATE on:

      Request Params: ID
    
    
      Request Body:
      {
          "fullname": "string"
      }
    
      or
    
      {
          "sex": "string"
      }
    
      or
    
      {
          "jobs: "string"
      }
    
      http://localhost:{PORT}/admin-api/v1/user-game-biodata/{ID}
    
    
    
      Example:  http://localhost:8080/admin-api/v1/user-game-biodata/1
    
Delete On User Game Biodata
  • DELETE on:

      Request Params: ID
    
      Request Query: FULLNAME
    
      http://localhost:{PORT}/admin-api/v1/user-game-biodata/{ID}?fullname={FULLNAME}
    
    
    
      Example:
    
      http://localhost:8080/admin-api/v1/user-game-biodata/1/fullname?sanengineer
    

User Game History Data

Create One User Game History
  • POST on:

      Request Body:
      {
          "score"  : "string",
          "comment": "string"
      }
    
      http://localhost:{PORT}/admin-api/v1/user-game-history
    
Get All Users Game History or Filtering By Query
  • GET All on:

      http://localhost:{PORT}/admin-api/v1/user-game-history
    
  • GET All Filtering by Query on:

      Request Query: SCORE
    
              http://localhost:{PORT}/admin-api/v1/user-game-history?score={SCORE}
    
    
      Request Query: COMMENT
    
              http://localhost:{PORT}/admin-api/v1/user-game-history?comment={COMMENT}
    
    
    
      Example:
    
      http://localhost:8080/admin-api/v1/user-game-history?score=30
    
Update One User Game History
  • UPDATE on:

      Request Params:ID
    
      Request BODY:
      {
          "score" : "string"
      }
    
      or
    
      {
          "comment" : "string"
      }
    
      http://localhost:{PORT}/admin-api/v1/user-game-history/{ID}
    
    
    
      Example:
    
      http://localhost:8080/admin-api/v1/user-game-history/1
    
Delete On User Game History
  • DELETE on:

      Request Params: ID
    
      Requst Query: SCORE
    
      http://localhost:{PORT}/admin-api/v1/user-game-history/{ID}?score={SCORE}
    
    
    
      Example:
    
      http://localhost:8080/admin-api/v1/user-game-history/1?score=30
    

๐Ÿ”ซ Testing RestAPI On Local Machine With Swagger

  • Public RestAPI

      http://localhost:{PORT}/api-docs/v1
    
  • Admin RestAPI

      http://localhost:{PORT}/admin-api-docs/v1
    

๐Ÿ—ƒ๏ธ Production Package Used

Dev Package

๐Ÿพ๏ธ Get Started

    $ npm install

โš—๏ธ Development

Use Node Version 12.18.4 LTS (Recomended).

Watch Terminal! when debugging this project.

Watch this:

Video On Github - Bakergun Backend Terminal Logger

๐Ÿƒโ€โ™‚๏ธ๏ธ Run Server On Dev Mode:

    $ cd

    $ npm run dev

NOTED: For deploy on cloud like Heroku, please deactivate code line require("dotenv").config() file db-local-config.js on config directory.

Releases

No releases published

Packages

No packages published