https://wingdating.herokuapp.com/
- React.js
- Redux
- JavaScript
- Python
- PosgreSQL
- Flask
- SQLAlchemy
- Alembic
-
Clone this repository
git clone https://github.com/appacademy-starters/python-project-starter.git
-
Install dependencies
pipenv install --dev -r dev-requirements.txt && pipenv install -r requirements.txt
-
Create a .env file based on the example with proper settings for your development environment
-
Setup your PostgreSQL user, password and database and make sure it matches your .env file
-
Get into your pipenv, migrate your database, seed your database, and run your flask app
pipenv shell
flask db upgrade
flask seed all
flask run
-
CD into the react-app directory
npm install
IMPORTANT! If you add any python dependencies to your pipfiles, you'll need to regenerate your requirements.txt before deployment. You can do this by running:
pipenv lock -r > requirements.txt
ALSO IMPORTANT! psycopg2-binary MUST remain a dev dependency because you can't install it on apline-linux. There is a layer in the Dockerfile that will install psycopg2 (not binary) for us.
-
Create a new project on Heroku
-
Under Resources click "Find more add-ons" and add the add on called "Heroku Postgres"
-
Install the Heroku CLI
-
Run
heroku login
-
Login to the heroku container registry
heroku container:login
-
Update the
REACT_APP_BASE_URL
variable in the Dockerfile. This should be the full URL of your Heroku app: i.e. "https://flask-react-aa.herokuapp.com" -
If image exists delete before building
docker image rm registry.heroku.com/wingdating/web docker build --tag registry.heroku.com/wingdating/web . docker push registry.heroku.com/wingdating/web heroku container:release web -a wingdating
-
set up your database:
heroku run -a wingdating flask db upgrade heroku run -a wingdating flask seed all
-
Under Settings find "Config Vars" and add any additional/secret .env variables.