/bangkit-cloud-computing

Bangkit Academy 2023 Batch Capstone Project CH2-PS091 DISADA-API

Primary LanguageJavaScript

DISADA API

bangkit-cloud-computing project is part of the DISADA application. This is an API build with the Hapi.js as web application framework and using Database PostgreSQL

Technology

  • Build with Node.js and HapiJs framework so that code can be easily modularized

Database

Version

  • NodeJS v18.16.1
  • NPM v9.5.1

Upgrade or Downgrade NodeJs using nvm

Structure Project

bangkit-cloud-computing
├── node_modules
├── src
│   ├── config
│   │   └── database.js
│   ├── controllers
│   │   ├── babycrydetection (fix)
│   │   │   ├── index.js
│   │   │   ├── handler.js 
│   │   │   └── routes.js
│   │   ├── user
│   │   │   ├── index.js
│   │   │   ├── handler.js
│   │   │   └── routes.js
│   ├── exceptions
│   │   ├── AuthenticationError.js
│   │   ├── ClientError.js
│   │   ├── InvariantError.js
│   │   └── NotFoundError.js
│   ├── helpers
│   │   ├── database.js
│   │   └── middleware.js
│   ├── migrations
│   │   └── 20231203110811-users.js
│   ├── models
│   │   ├── index.js
│   │   └── users.js
│   ├── seeders
│   │   └── users.js
│   ├── services
│   │   ├── data (feat: new)
│   │   │   └── recommendation.json
│   │   ├── recommendations.js
│   │   └── users.js
│   └── index.js
├── .env (need to be added manually for security)
├── .eslintrc.json
├── .gitignore
├── .sequelizerc
├── package-lock.json
└── package.json

Run Locally

Requirements Download and Installing Mandatory

Clone this repository

https://github.com/disada-id/bangkit-cloud-computing.git

After cloning the repo, request an .env configuration to @albimdkr

Go to the project directory

  cd bangkit-cloud-computing

Install dependencies

  npm i

Migrate

  npm run migrate-dev

Testing insert users to Database

  npm run seed-dev

Start the server

  npm run start-dev

DISADA Endpoint API Reference

Users

endpoint /auth
Endpoint Method Parameter Type Description
/sigin POST application/json string This endpoint used for user login. Payload contains username and password field, you can fill of username with username or email, after you fill payload and send request to server, server will response 201.
/signup POST application/json string This endpoint used for register, contains name, nohp, email and password after you fill payload and send request to server, server will response 201.