Android App1 Using ChatGPT API
My team won $350 for a hackathon at HackEmory
1. What is REST API & SERVER -> done
2. Setting up ChatGPT API and tutorial -> done
3. Python intro + API setup -> done
4. Flask RestAPI Setup -> done
6. Hosting on Cloud (Azure)
Camera setup
5. Retrofit Android ->
later week 6 next app +
. Async vs Sync Operations :
7. Coroutines
Remember we have bounty program fix bug and get Rs. 1000 ($15)
Java -> Kotlin (digitalocean, medium, stackoverflow)
4. Ask ChatGPT
Any computer giving services with other computers!
Sharing is caring
A REST API (Representational State Transfer Application Programming Interface) is a set of rules and conventions for building and interacting with web services.
Create: Post
Read: Get
Update: Put
Delete: Delete
https://developers.google.com/ml-kit/vision/text-recognition/v2/android
if Stuck you have:
1. ChatGPT
2. Google Dcoumentationa
3. Stack overflow
4. Discord community
Gmail
App -> Facebook
I think in most clouds:
IAAS -> gives you a machine(VM/server) with a OS at minimum
PaaS-> service gives you IaaS + a runtime environment to host your apps in
SaaS->gives you IaaS+PaaS+finished app
IND / CHINA / USA
Default ->
Manage your server on your own on someone else computer
Give a Python file it will do the magic
like Play store apps
Conductor that allows you to host server on a web app and manage the traffic
load balancing
Conductor for trains
80 / 443
maps. google
madeby.google
images..google
same port for all
before server so called reverse proxy
banned websites
Load balancer on a different server to manage load between severs
but Reverse Proxy is part of 1 Server
apt-get install nginx
nano /etc/nginx/nginx.conf
Retstart ->sudo nginx -s reload
systemctl reload nginx
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
Text
events {
worker_connections 1024;
}
http{
server {
listen 80;
server_name chatgptvm2.eastus.cloudapp.azure.com;
# access_log /var/log/nginx/access.log;
# error_log /var/log/nginx/error.log;
location / {
proxy_pass http://127.0.0.1:5000/;
proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
run htop or acivity manager
You are not using complete CPU power
Run Multiple processes in one server
1. Create VM
2. Open the right ports on Azure or any cloud (80 / 443)
3. copy code python3 code of flask server
4. Make sure it never turns off -> docker / pm2
5. Ngnix / Apache2 for reverse proxy
without cert on port 80
cert installation steps:
https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal