Skip to content

ATongs/ATongs-Backend

Repository files navigation

ATongs Backend

Table of Contents

Description

This repository is for the Backend side of the ATongs Application. The results will be an Endpoint URL that will be used when classifying waste in the ATongs App which will be consumed by the Mobile Development Team as an ML Model classification API.

Tech Stacks

ATongs Tech Stacks

Cloud Infrastructure Diagram

ATongs Infrastructure Diagram

Application Flow

ATongs Application Flow

API Documentation

Check ATongs API's Postman Documentation here

Also check API Testing Example

Deploy on GCP

Follow this steps

Running on Localhost

Clone the repository

git clone https://github.com/ATongs/ATongs-Backend.git

Using current environment (Recommended)

  1. Install dependencies
cd ATongs-Backend

npm install
  1. Go to src/services/config.js or config.js and change this 2 line

Un-comment the Local Environment and commented out the Deployed Environment, then replace the REDACTED with the value of actual API_KEY, like this

// const API_KEY = process.env.GOOGLE_API_KEY; // Deployed Environment
const API_KEY = 'REDACTED'; // Local environment
  1. Run
npm run start:dev

Using Dockerfile (Optional)

  1. Build Docker Image
docker build -t <image name> .

Example:

docker build -t atongs-backend .
  1. Inspect the image that already builded
docker images | grep "<image-name>"

Example:

$ docker images | grep "atongs-backend"
atongs-backend                        latest          80b285313e1c   13 minutes ago   2.07GB
  1. Run the container in Detached Mode
docker run -d -p 9000:9000 --name <container-name> <image-name>

Example:

docker run -d -p 9000:9000 --name atongs-backend atongs-backend
  1. Check the container if it's already running
$ docker ps
CONTAINER ID   IMAGE            COMMAND                  CREATED          STATUS          PORTS                                       NAMES
f8c8aebf2098   atongs-backend   "docker-entrypoint.s…"   15 minutes ago   Up 15 minutes   0.0.0.0:9000->9000/tcp, :::9000->9000/tcp   atongs-backend

Using Docker Compose (Optional)

  1. Run docker compose up, this will build in detach mode
docker compose up -d --build
  1. Check the container if it's already running
$ docker ps
CONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS         PORTS                                       NAMES
7d6fc6bced3a   node:20   "docker-entrypoint.s…"   3 minutes ago   Up 3 minutes   0.0.0.0:9000->9000/tcp, :::9000->9000/tcp   atongs-backend-app-1
  1. Stop the container
docker compose down

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published