Coder Social home page Coder Social logo

bangkit-capstone-project / cloud_computing Goto Github PK

View Code? Open in Web Editor NEW
9.0 0.0 1.0 352 KB

Tanamin Web Service is a web service that allows you to predict the disease of plant by uploading image of plant leaf.

License: MIT License

JavaScript 99.46% Procfile 0.03% Dockerfile 0.51%
bangkit-capstone-project bangkit2022 classification-service nodejs prediction-service restful-api

cloud_computing's Introduction

Konva logo

Tanamin Web Service

CC Member Dependency Issue Pull Request License

Tanamin Web Service is a web service that allows you to predict the disease of plant by uploading image of plant leaf. This service is under development and will be updated soon. First three features are available is Cassava leaves disease prediction, Rice leaves disease prediction and Vegetable types classification.

The first thing you need to know is that this service is using authentication to access each service. You need to login to access the service. The login is using username and password. You can register on the registration service. Please don't spam the registration service because it will make the registration service slow. If you have some idea to secure this service, please contact me.

Base url of this service is: http://localhost:5000/

The service available:

  • Authentications

    POST /authentications
    PUT  /authentications
    DEL  /authentications
  • Users

    GET  /users/{userId}
    POST /users
    PUT  /users/{userId}
    DEL is not avalable now
  • Predictions

    POST /predictions/cassava
    POST /predictions/rice
    POST /predictions/tomato
  • History

    GET  /predict/historys/
    GET  /predict/historys/{historyId}
    GET  /predict/historys/plant/{plantId}/
    GET  /predict/historys/plant/{plantId}/disease/{diseaseId}
    POST /histories
    DEL  /histories/{historyId}
  • Classifications

    POST /classifications/vegetable
  • Plant

    GET   /plants
    POST  /plants
    PUT   /plants/{plantId}
    GET   /plants/{plantId}
    DEL   /plants/{plantId}
  • Diseases

    GET   /diseases
    POST  /diseases
    PUT   /diseases/{diseaseId}
    GET   /diseases/{diseaseId}
    DEL   /diseases/{diseaseId}
  • Vegetables

    GET   /vegetables
    POST  /vegetables
    PUT   /vegetables/{vegetableId}
    GET   /vegetables/{vegetableId}
    DEL   /vegetables/{vegetableId}

Quick Look

Architecture

Konva logo

Authentications

This service is using token for authentication. You should have an account to access this service. First if you don't have an account, create a new account. Then, create a token for authentication. It's like login, you need to authenticate yourself with username and password. If the autentication is valid, you will get a token. You can use this token to access the service. If dont, you will get a error message.

The token given is accessToken and refreshToken. The refreshToken is used to refresh the token. The accessToken is valid for 30 minutes. If you want to refresh the token, you need to send the refreshToken to the service. If the refreshToken is valid, you will get a new accessToken. If the refreshToken is not valid, you will get a error message.

Instructions

Predictions Service

The predictions service is using imgUrl and endpoint id to retrieve predictions. The endpoint id is used to define what model to be used. So you should know what endpoint id you want to use. The endpoint id is:

  • cassava leaf : 4257194673539383296
  • rice leaf : 2528938316535955456
  • tomato leaf : 9197643464764817408

For the imgUrl, it is image url that publicly accessible. The image should be in image format like (jpg, png, jpeg, etc.). The image url can be obtained when you upload your image to upload picture service, or search on google.

If the prediction is successful, you will get a json object. The json object contains the prediction result. The prediction result contains the highest probability and the predicted class, with some additional information related to the class. The result will be stored as a history object.

Classifications service

This service is like predictions service withoud storing the result as a history object. The result will be lost imedietely after the process. The endpoint id is:

  • vegetables : 5666821356906348544

Environment

In order to run this project, you need to configure the following environment variables:

#development
HOST= {your application host, localhost if development}
NODE_ENV = {your environment server}

PORT= {your server port}

# node-postgres configuration
PGUSER= {your database username}
PGHOST= {your database host}
PGPASSWORD= {your database password}
PGDATABASE= {your database name}
PGPORT= {your database port}
PGURI= {your database uri if available}

# JWT Token Key
ACCESS_TOKEN_KEY= {define your own token key}
REFRESH_TOKEN_KEY= {define your own refresh token}
ACCESS_TOKEN_AGE = {define how long the access token is valid}

# AI platform
PROJECT_ID={your project id}

Then you can use the following image to create your own database:

Databases ERD

Dependency

Testing

This Web service uses Postman to test.

  • You can download the Postman documentation here.

If you want to contribute to this project, please contact me.

Pull Requests

I'd be happy to review any pull requests that may better the TanamIn project, in particular if you have a bug fix, enhancement, or a new idea, you can contact us.

Contributors

CC Member (Master Contributor)

CC member is responsible for the development of the API service and deployment of the model. In sort, in this project CC is responsible for Backend, infrastructure, and DevOps.

Individuals

Shazi Awaludin

ML Member

Individuals

ML Member is who are contribute to create prediction and classification model that used in this web service. Without them, this service is nothing.

MD Member

Individuals

MD member is who are responsible to serve mobile applications based on Android and use this service as data source and more.

cloud_computing's People

Contributors

xharf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.