Code Monkey home page Code Monkey logo

bakergun-backend-service-users's Introduction

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/[email protected]
    
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.

bakergun-backend-service-users's People

Contributors

sanengineer 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.