Head to https://www.originprotocol.com/developers to learn more about what we're building and how to get involved.
Official website for Origin Protocol
This is a Flask app with the source code for www.originprotocol.com. The code is all
Python 2.7 with
Postgres for the database (basically just for the mailing list). The database is not required to be configured if you're just working on the website.
Setup a virtualenv
virtualenv --python=/usr/local/bin/python2 origin-website && cd origin-website
git clone https://github.com/OriginProtocol/origin-website.git && cd origin-website
Enter virtual environment
pip install -r requirements.txt
Rename the file
.env, and update env variables as desired.
mv sample.env .env
Open browser to view
Problems? Hit us up in the
engineering channel on Discord if you need help.
Throughout the development process and before committing or deploying, run:
Run individual test files simply as:
Run a single test case, or an individual test, using:
We use Celery for running background tasks (mostly just sending emails). To get this working on your local machine, you'll want to make sure:
celery --loglevel=INFO -A util.tasks worker
Celery Flower is useful for monitoring tasks:
flower -A util.tasks --port=5555
You can run the website in combination with a local PostgreSQL, Redis and Celery using Docker Compose.
Some scripts use Heroku cron jobs. Use the following command to test them locally
PYTHONPATH=$(pwd) PROJECTPATH=$(pwd) python ./logic/scripts/update_token_insight.py
When running on docker:
docker exec -it -e PYTHONPATH=/app -e PROJECTPATH=/app origin-website python ./logic/scripts/update_token_insight.py
git clone https://github.com/OriginProtocol/origin-website && cd origin-website
docker-compose up. The first time this command runs it will take some time to complete due to the initial building of the containers.
When this completes you should be able to access the website at
See translations directory.
We use Flask Migrate to handle database revisions. If you make changes to the database, use
flask db migrate to generate the required migration file and then
flask db upgrade to implement and test your changes on your local database before committing.
To deploy a development copy of the site on Heroku, just choose which branch you would like to use and follow the instructions:
Heroku will prompt you to set config variables. At a minium, you must set these two:Config Value FLASK_SECRET_KEY (make something up) HOST (domain name of your dev heroku app)
We use both the python and the nginx buildpacks:
heroku buildpacks:set heroku/python heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nginx
Special thanks to the following companies for their support: