A Flask app for buying gear on MountainProject.com
Gearfinder is a web app built on Flask for searching Mountain Project's used gear sale forum. The app aims to make buyers aware sooner of new posts relevant to their interests. Buyers can search the For Sale forum at any time on the site, or have email alerts sent to them when a new post matching their search parameters is posted. Elements of code are inspired by or taken from Miguel Grinberg's microblog tutorial.
- Each search queries every page of the forum. A caching system needs to be implemented to prevent this
This program is written in Python 3.6. It is recommended you run the app in a virtual environment. If you are not familiar with how to use virtual environments, you can read up on them on The Hitchhiker's Guide to Python. Instructions for running the website locally are below.
Install dependencies with pip in your virtual environment:
$ cd path/to/gearfinder
$ source path/to/venv/bin/activate
$ pip install -r requirements.txt
In your environment you will need to define three variables that the app will read from the os. Note the double quotes in the bash syntax, they're very important.
export SECRET_KEY="super-secret-long-string" # Secret Key
export EMAIL_USERNAME="\<username\>" # Username to log into the sending email account
export EMAIL_PASSWORD="\<password\>" # The password to log into the sending email account
If you are using your email account with a google account, you will need to allow less secure apps.
If you are using an email account that is not a google account, you will need to modify the mail configuration settings
in config.py
Documentation for flask-mail can be found here.
Note: Remember to set up environmental variables in each terminal window you have open!
User the flask run command:
$ cd path/to/gearfinder
$ source path/to/venv/bin/activate
$ flask run
Once the server is running you can access the site at localhost:5000
Note: the redis-start.sh script will install redis if not already installed
- Run the redis-start.sh script in a new terminal shell:
$ cd path/to/gearfinder
$ source path/to/venv/bin/activate
$ flask start-redis
- spin up a worker:
$ cd path/to/gearfinder
$ source path/to/venv/bin/activate
$ flask start-worker
To Come
- Make sure requirements.txt is up to date by running
flask update-requirements
-
Create a merge request with the github repository's master branch
-
The updated app will be deployed at gearfinder.herokuapp.com when the request is merged
The code in this project is licensed under the MIT License