Skip to content

RempahRasa/RempahRasaBE

Repository files navigation

RempahRasaBE

Introduction

Rempah Rasa BE is an Application Programming Interface that use Representational State Transfer (REST) as the architecture. ALL of the endpoint is used by Rempah Rasa APP. This repository are built by Express.JS using Typescript. For the main feature we are using Tensorflow.JS for consume the model from models that have been created by machine learning team. This repository is focused on being deployed on Google Cloud Platform services, which here use Service accounts, databases with Firestore, and object data storage with Buckets on Cloud Storage.

  • Service Architecture

Built With

Express.js TypeScript TensorFlow Google Cloud Docker Postman GitHub

Getting Started

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • Clone repository to your local machine by using
git clone https://github.com/RempahRasa/RempahRasaBE.git
  • Go to the repository directory
cd ~/RempahRasaBE
  • Installing dependencies with Bun
bun install

For service account, you can make some folder named "Secret" and put the json inside the folder.

/src/secret/<SERVICE-ACCOUNT>.json
  • Make a copy from .env.example then rename it to become .env and fill the all of the requirement environment variable.

Installation

To run this repository for production:

bun run start

To run this repository for development:

bun run dev

To run this repository for with docker:

docker build -t rempahrasabe .
docker run -d -p 3000:3000 --name rr --restart unless-stopped rempahrasabe

Usage

For using this repository. There is additional documentation for how to consume the API and demos in the Postman for testing.

Endpoint

POST spice-classification

http://{{base_url}}/prediction

Authorization

Using Bearer Token

Token

<token>

Body

Using form-data

Image

<Path_Image>

Example

Request

Success (200)

curl --location 'https://{{base_url}}/prediction' \
--form 'image=@"/home/user/Pictures/kunyit.jpg"'
Response
{
  "data": {
    "id": "c8fe9477-d545-4492-be49-bec944582593",
    "image": "https://storage.googleapis.com/<bucket>/spice-image/53e8a51c-8bca-43a9-8714-3ea062e218b1",
    "result": "kunyit",
    "createdAt": "2024-06-12T06:29:00.369Z"
  }
}

For more examples, please refer to the Documentation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages