Skip to content

Latest commit

 

History

History
227 lines (169 loc) · 8.05 KB

README.md

File metadata and controls

227 lines (169 loc) · 8.05 KB

Cloud Computing Documentation

Table of Content

Diagram Architecture

Firestore Database Structure

Tech Architecture

  • Node.js
  • Express.js
  • App Engine
  • Cloud Storage
  • Tensorflow Lite
  • Firestore

Dependencies

Recap Endpoint Routes

Route HTTP Method Description Auth
/login POST Log in a user Not Required
/register POST Register a new user Not Required
/logout POST Log out a user Not Required
/profile GET Get user profile Required
/dictionary/alphabet GET Get dictionary alphabet Required
/dictionary/number GET Get dictionary number Required
/quizzes POST Submit a quiz Required
/quizzes/:id GET Get quiz details Required
/quizzes/type/number GET Get number quiz Required
/quizzes/type/alphabet GET Get alphabet quiz Required
/quizzes/history GET Get all user quiz history Required
/quizzes/history?count GET Get count user quiz history Required

API Endpoint

For detailed information on each API endpoint, refer to the API Endpoint Documentation

Installation

  1. Prerequisites
  • Ensure you have Node.js installed, preferably version 18.x or later.
  1. Clone The Project
git clone https://github.com/gesturo-team/Cloud-Computing.git
cd Cloud-Computing
  1. Install Dependencies
npm install
  1. Environment Variables (.env)
  • Create a .env file in the root directory of the project.
  • Set the following environment variables:
PORT=<Your_Port>
JWT_SECRET=<Your_JWT>
  1. Running the Application
  • To start the application in development mode, run:
npm run start:dev
  • For production mode, simply run:
npm start

Setup Google Cloud

App Engine

  1. Open Google Cloud Console.
  2. Go to App Engine.
  3. Start a app engine by clicking CREATE APPLICATIOn button.
  4. Choose your region (We Use asia-souteast-2) and click next.
  5. Click I'LL DO THIS LATER.

Cloud Storage

  1. Open Google Cloud Console.
  2. Go to Cloud Storage.
  3. Create a bucket by clicking CREATE button.
  4. Set your globally unique bucket name.
  5. Choose your region (We Use asia-souteast-2).
  6. Set a default class (Standard).
  7. Uncheck the Enforce public access prevent ...
  8. Select Access Control as Fine-grained.
  9. Then, hit CREATE.
  10. On your buckets, click the three dots at the right of your bucket.
  11. Click Edit Access and click Add Principal.
  12. In the new principal column type allUsers.
  13. In the role column select Cloud Storage > Storage Object Viewer.
  14. Click Save.

Firestore

  1. Open Google Cloud Console.
  2. Go to Firestore.
  3. Crete a databases by clicking CREATE DATABASE button.
  4. Set a firestore mode (Native Mode) and click continue.
  5. Set a database id (default).
  6. Choose your region (We Use asia-souteast-2).
  7. Click CREATE DATABASE button.

Setup Service Account

Firestore

  1. Go to IAM & Admin > Service Accounts or click here.
  2. Select your project.
  3. Click Create Service Account
  4. Set your name, Select role Firebase Admin
  5. Click your service account email > KEYS > Select ADD KEY and click Create new key.
  6. Select JSON and click CREATE.
  7. Save your credential account.

Cloud Storage

  1. Go to IAM & Admin > Service Accounts or click here.
  2. Select your project.
  3. Click Create Service Account
  4. Set your name, Select role Cloud Storage > Storage Admin
  5. Click your service account email > KEYS > Select ADD KEY and click Create new key.
  6. Select JSON and click CREATE.
  7. Save your credential account.

Deploy Google Cloud

App Engine

  1. Open your Cloud Shell by clicking here.
  2. Set your project.
  gcloud config set project [PROJECT_ID]
  1. Clone this repository by the below command.
  git clone -b master https://github.com/gesturo-team/Cloud-Computing
  cd Cloud-Computing/api
  1. Create a .env file and import your JWT Secret Key and Port into .env file.
  touch .env && nano .env
  PORT=<Your_Port>
  JWT_SECRET=<Your_JWT>
  1. Upload your Service Account Credentials to the Cloud Computing/api/src/configs.

  2. Rename the file as serviceKey.json.

  3. Install node package by the bellow command.

  npm install
  1. Deploy the API by running the command on your cloud shell.
  gcloud app deploy
  1. Type youyr service name and select your region (We Use asia-souteast-2).
  2. Wait until it finishes.

Contributor

Name University Role Links
Ryan Rizky Pratama Politeknik Negeri Banjarmasin Cloud Computing GitHub LinkedIn
Reja Revaldy. F. Politeknik Negeri Banjarmasin Cloud Computing GitHub LinkedIn