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).
on https://bakergun-backend-service-users.herokuapp.com
-
Public RestAPI
http://localhost:{PORT}/api/v1
-
Admin RestAPI
http://localhost:{PORT}/admin-api/v1
-
POST on:
Request Body: { "username": "string", "email": "string" "password": "string" } http://localhost:{PORT}/api/v1/user-game
-
POST on:
Request Body: { "username": "string", "password": "string" } http://localhost:{PORT}/api/v1/user-game
-
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
-
POST on:
Request Body: { "username": "string", "email": "string" "password": "string" } http://localhost:{PORT}/admin-api/v1/user-game
-
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 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
-
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:
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
-
POST on:
Request Body: { "user_id" : integer, "fullname": "string", "sex" : "string", "jobs" : "string" } http://localhost:{PORT}/admin-api/v1/user-game-biodata
-
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 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:
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
-
POST on:
Request Body: { "score" : "string", "comment": "string" } http://localhost:{PORT}/admin-api/v1/user-game-history
-
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 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:
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
-
Public RestAPI
http://localhost:{PORT}/api-docs/v1
-
Admin RestAPI
http://localhost:{PORT}/admin-api-docs/v1
- Express,
- Morgan,
- PG
- PG Hstore,
- JSON Web Token,
- Cookie Parser,
- Sequelize,
- Passport,
- Passport-JWT,
- BcrpytJS
- Swagger UI Express
$ npm install
Use Node Version 12.18.4 LTS (Recomended).
Watch Terminal! when debugging this project.
Watch this:
$ cd
$ npm run dev