The main objective of our application is to bring help to pet owners that are looking for their pets. We use a post system that shows every pet that is currently missing or pets founds in the street, integrating Google Maps API to show each post location and Facebook API for user identification.
In this initial version of our application you will find three filters on the home page, "Perdidos" that contains posts made by pet owners that register their missing pet info with the location of the last time it was seen; "Encontrados" that contains posts made when you find a pet in the street and it is lost, it also uses the location functionality to register the exact point where the pet was seen, and by last, "Resueltos" that shows the post of pets that are finally reunited with their families.
We include in this version, the possibilities to moderate posts, i.e., a user that creates a post, can "Delete" their posts and also notify if the pet was found, that way it will be removed from the active list of pets and moved to the "Resueltos" section.
In addition, the functionality of report publication is added, to report if a post violates our terms and conditions, or if it makes reference to a pet that is not from the post creation. The admins can take down a post that violates the rules and also can block users in case it is required.
In the future, we'd like to include additional functionalities including contacting Veterinaries and Shelters for pet care and adoptions.
A Ubuntu Server running over AWS EC2 with LEMP stack
- Facebook:
facebook api
- Google:
google maps api
Cloud based deployment: Run all parts of the application in the cloud EC2 instance.
-
Ubuntu Server 20.04 LTS (HVM), SSD Volume Type - ami-04505e74c0741db8d (64-bit x86)
-
Ubuntu Server 20.04 LTS (HVM),EBS General Purpose (SSD) Volume Type. Support available from Canonical
-
Root device type: ebs Virtualization type: hvm ENA Enabled: Yes
-
t2.micro (- ECUs, 1 vCPUs, 2.5 GHz, -, 1 GiB memory, EBS only)
-
ec2
-
ssh
-
ssl
-
ufw
-
nginx
-
mysql
Public IPv4 address
$ chmod 400 encuentrame.pem
$
$ ssh -i "encuentrame.pem" [email protected]
ubuntu@ip-172-31-23-111:~$
run vagrant image
$ vagrant init encuentrame/ubuntu-20.04-server-ec2
$
$ vagrant up
$
Initial configuration
Upgrade system
sudo apt-get update
apt list --upgradable
sudo apt-get upgrade
Install Nginx
run script
Install MySQL
run script
root: *****************
Install Python
sudo apt-get install python3-pip
sudo apt-get install python3
Install linters
sudo apt-get install shellcheck
sudo apt-get install pep8
sudo apt-get install pycodestyle
netstat
sudo apt install net-tools
to run netstat -tulpn
tcp
udp
listening
programs
numeric
Flask
virtual environment
mkdir encuentrame
cd encuentrame
sudo apt install python3.8-venv
python3 -m venv venv
activate the virtual environment
ubuntu@ip-172-31-23-111:~/encuentrame$ . venv/bin/activate
(venv) ubuntu@ip-172-31-23-111:~/encuentrame$
pip install Flask
integrate nginx, flask and guinicorn
sudo apt update
sudo apt install python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools
entorno virtual
sudo apt install python3-venv
python3 -m venv encuentrameenv
activar entorno
source encuentrameenv/bin/activate
Configurar Flask
pip install wheel
pip install gunicorn flask
create with hello.py
sudo ufw allow 8000
optional
export FLASK_RUN_PORT=8000
export FLASK_APP=hello.py
python hello.py
ubuntu@ip-172-31-23-111:~$ curl http://172.31.23.111:8000/
sudo vim /etc/nginx/nginx.conf
create domain (almost a subdomain)
on get.tech
Zone id. 11087069
Record Id 125709711
Name encuentrame.xelar.tech
Class IN
Type A
Status Active
Value 54.147.150.55
TTL 7200
Creation Date 2022-02-16 01:35:29.824305
Install snapd and certbot
sudo apt update
sudo apt install snapd
sudo apt-get upgrade
sudo snap install hello-world
sudo snap install core; sudo snap refresh core
sudo apt-get remove certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Run the certbot for nginx
sudo certbot --nginx
Allow traffic to the instance in AWS
Create security groups for http and https traffic in AWS Console
Andres
Ayrton
Ronald