Hello, this is backend NanamYuk application made by Capstone Team C22-PS316 if you want to know our team member please check this link
Name | Bangkit ID | Contacts |
---|---|---|
Ahmad Solahudin Rifandi | C2224W2082 | Github & Linkedin |
Refin Refiansyah Maldini | C7237F2141 | Github & Linkedin |
We are creating a backend application as intermediate between Machine Learning and Mobile Development using NodeJS, MySQL & Flask. After that we deploy all of the code to Google Cloud Platform
Google Cloud Services | Platform |
---|---|
Cloud App Engine | NodeJS (Backend) |
Cloud Run | Flask (Model) |
Cloud Storage | Images & Dataset |
Cloud SQL | Database (MySQL) |
Learning Paths | Link |
---|---|
Organization | Github |
Machine Learning | Github |
Mobile Development | Github |
Endpoint | Method | Body Request (JSON) | Response Body (JSON) | Description |
---|---|---|---|---|
/ | GET | - | Response to this server is success | GET Request to the server |
/plant | GET | - | id, nama, namaLatin, deskripsi, suhu, tanah, cahaya, kelembapan, rainfall, siram, image, tutorial | GET Request to show all available plants |
/userplant | GET | - | date, plant_id, nama_penanda, state, user_id | GET Request to show all plants that user have |
/plant/{id} | GET | - | id, nama, namaLatin, deskripsi, suhu, tanah, cahaya, kelembapan, rainfall, siram, image, tutorial | GET Request to specific plant that user choose |
/userplant/{id} | POST | date, plant_id, user_plant_id, nama_penanda, state, user_id | Insert Successful | POST Request to add plant that user choose |
/userplant/{user_plant_id}/{plant_id} | GET | - | nama_penanda, id, nama, namaLatin, deskripsi, suhu, tanah, cahaya, kelembapan, rainfall, siram, image, tutorial | GET Request to show specific plant that user choose including nama penanda |
/deleteuserplant/{user_plant_id} | DELETE | - | Delete Successful | DELETE Request to remove plant that user choose |
Prepare your code in local device
- Prepare your GCP project
- Create your Cloud SQL and create database
- Import "nanamyuk_databases.sql" to your Cloud SQL
- Open terminal and make sure you're in backend-nanamyuk directory
- Replace line 10-13 in "/routes/plant.js" to your Cloud SQL data
- Run "npm run start" in your terminal (make sure nodemon is installed if you're running on local device)
- Try open your browser and put the same link and port with your localhost (Ex: http://localhost:8080)
- If you're trying to use HTTP Request on you endpoint link please look at this
Deploy your code in Google App Engine
- Prepare your GCP project
- Open App Engine and if you don't know how to use it please follow this link
- After App Engine installed upload all the code to Cloud Shell and change "backend" to "default" in "app.yaml" file if this is your first time using App Engine
- Replace back "default" to "backend" and re-deploy your code
- Now you have link endpoint globally in the internet and everyone can use it :)