Skip to content

Capstone-C23-PS094/Cloud-Computing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌱 FarmGenius API Application

Smart agriculture solution using AI for Indonesian farmers: crop recommendations, disease management, sustainability

Main Feature

1. Crop Recommendation

To be the number one agricultural brand in the world in terms of goodness and convenience in farming

2. Rice Leaf Detection

We are here to provide optimal service to customers by respecting all their requests and using new technology as a step to become the number one brand.

Technology Architecture

2. Cloud Computing

  • App Engine
  • Cloud Run
  • Node.Js
  • Cloud SQL
  • Cloud Storage
  • Express JS Framework

FarmGenius Developer

Future Feature

  1. Farmer Marketplace
  2. All Plant Diseases Detection
  3. Community Platform and store

The service available:

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

  • Authentications

    POST /login
    POST  /register
    POST  /logout
    POST  /refresh
  • Users

    GET  /users/
    GET  /user/{userId}
    PUT  /user/{userId}
    DEL /user/{userId}
  • Plant

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

    GET   /diseases
    GET   /disease/{diseaseId}
    POST  /disease
    PUT   /disease/{diseaseId}
    DEL   /disease/{diseaseId}
  • Predictions

    POST /prediction/potato
    POST /prediction/peppers
    POST /predictions/rises
  • History

    GET  /historys/
    GET  /history/{historyId}
    POST /history
    DEL  /history/{historyId}
  • Recomendation Store

    GET   /stores
    POST  /store/{storeId}
    PUT   /store/{storeId}
    GET   /store/{storeId}
    DEL   /store/{storeId}

Quick Look

Authentications

This service utilizes token-based authentication, requiring users to have an account for accessing its features. If you don't have an account, please create a new one. Once registered, you can generate an authentication token. This token serves as a means of logging in, requiring you to authenticate yourself using your email and password. If the authentication is successful, you will receive an access token, enabling you to access the service. If the authentication fails, an error message will be displayed.

The provided tokens are the accessToken and refreshToken. The refreshToken is used for token refreshing purposes. The accessToken remains valid for one hour. To refresh the token, you must send the refreshToken to the service. If the refreshToken is valid, a new accessToken will be provided. If the refreshToken is invalid, an error message will be returned.

By following this authentication process, you can securely access the service and enjoy its functionalities.

Instructions

This project run in node js version 18.13.0.

  1. Install all dependencies with
npm install
  1. Make your database and export from database/farmgenius.sql
  2. Run server:

-development

npm run start-dev

-production

npm run start  

Environment

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

PORT= {your server port}

# Database Configuration MySQL
DB_HOST= {define your db host}
DB_USERNAME= {define your db username}
DB_PASSWORD= {define your db password}
DB_NAME= {define your db name}

# JWT TOKEN
SECRET_KEY= {define your secret key}
REFRESH_TOKEN_KEY= {define your refresh key}

Dependency

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.

About

Backend API for Farmgenius App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published