/radiant-bangkit-capstone

B21-CAP0314 Bangkit 2021 Capstone Project

Primary LanguageJupyter Notebook

B21-CAP0314 Bangkit 2021 Capstone Project

Project Description

Dermisity is an app that will try to identify skin disease from the picture taken from the user's camera, and provide information such as what is the possible disease they suffer and it also gives the user's recommended treatment for their skin disease.

Screenshoots

Deployment Steps

Here are the steps for deploying this project:

  1. Create Google Cloud Platform Project
  2. Create a Compute Engine, Cloud firestore, Cloud Storage (Bucket)
  3. Open backend/machinelearning/model_training_notebook.ipynb, change the value of project_id and bucket_name to your GCP Project
  4. Run the model_training_notebook.ipynb until success saving the model to the Cloud Storage
  5. Open your Compute Engine, and clone this git project
  6. Install the latest python3, pip and nginx.
  7. Create and activate venv
  8. Open backend/cloud directory and run
pip install -r requirements.txt"
  1. Create wsgi.py for connecting between Flask and Nginx with this content:
from app import app

if __name__ == "__main__":
    app.run()
  1. Create a systemd Unit File, edit the file:
sudo nano /etc/systemd/system/app.service

change the value of User to yourusername and WorkingDirectory, and Environment to backend/cloud directory

also change the value of ExecStart to your gunicorn directory and change the worker parameter to your CPU count.

then run:

sudo systemctl start app
sudo systemctl enable app
  1. Copy the saved model from google cloud storage to backend/cloud directory, with this command:
gsutil cp gs://model-directory .
  1. Install nginx, and edit the configuration with this command:
nano /etc/nginx/sites-available/app

and change the content of server like this:

server {
    listen 80;
    server_name server-ip;

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/user/radiant-bangkit-capstone/backend/cloud/app.sock;
    }
}
  1. Run this command:
sudo ln -s /etc/nginx/sites-available/app /etc/nginx/sites-enabled
sudo systemctl restart nginx
sudo ufw allow 'Nginx Full'
  1. Then the API server can be accessed at: http://server_domain_or_IP

  2. For the android app, open ApiConfig.kt, and change the value of BASE_URL variable to your http://server_domain_or_IP

  3. open gradle.properties, and change the value of latestinfo_apikey to your News API Key

Done

Built With Love By B21-CAP0314:

Android

Cloud

Machine Learning