This app is created in python and use selenium to scrape results from google maps and show them sorted by number of reviews.
Prerequiste: Google chrome installed on system Steps:
-
Clone this repositary
-
Activate virtual environement in python
$ source venv/bin/activate
-
Run application.py in your python environment
$ python3 application.py
-
Open http://localhost:5000 in web browser.
-
Update server
$ sudo apt update
-
Install google-chrome
$ sudo apt install wget $ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb $ sudo dpkg -i google-chrome-stable_current_amd64.deb $ sudo apt install
-
Clone this repo
-
Create service file for app
-
run
$ sudo nano /etc/systemd/system/gmaps.service
-
Add following in file:
[Unit] Description=Gunicorn instance for gmaps app After=network.target [Service] User=azureuser Group=www-data WorkingDirectory=/home/azureuser/gmaps ExecStart=/home/azureuser/gmaps/venv/bin/gunicorn --timeout 60 -b localhost:8000 application:app Restart=always [Install] WantedBy=multi-user.target
-
-
Run following commads to enable service
$ sudo systemctl daemon-reload $ sudo systemctl start gmaps $ sudo systemctl enable gmaps
Before going to next steps enable public traffic on your server on port 80 and 443.
-
Install Nginx —
$ sudo apt install nginx
-
Edit server config file
$ sudo nano /etc/nginx/sites-available/default
-
Add the following code at the top of the file (below the default comments)
upstream gmaps { server 127.0.0.1:8000; }
-
Add a
proxy_pass
to gmaps atlocation /
#Some code above location / { proxy_pass http://gmaps; } #some code below
-
-
Start Nginx by using following commands
$ sudo systemctl start nginx $ sudo systemctl enable nginx
Go to your public IP address to see the web app. Use http:// instead of https://.