My web application can show users
- our dealership locations with a map
- cars currently in our inventory
- users can sell their cars to me, the dealership
The result of this will be that when you create a pull request to merge a branch to master, it will deploy to your heroku development app/dyno and when you merge or push to master on github, it will deploy the app to the production heroku app/dyno.
- Clone this repo to your local (DO NOT FORK THIS REPO, IF YOU DO YOU HAVE TO ENABLE ACTIONS BEFORE ANYTHING RUNS)
- Create a new repo on your own Github account
- Change the origin by replacing it with your own new repo. (Do not add a readme or any other file while creating the repository)
- Create an account with Heroku, create an app for production and an app for development
- Create a new repo in Docker hub
- Rename .env.test to .env and fill out the correct information
- In your newly created Github repository, add new repository secrets for DOCKER_USERNAME, DOCKER_PASSWORD, HEROKU_API_KEY (Values are DOCKER_USERNAME: your docker hub username; DOCKER_PASSWORD: your docker hub password; HEROKU_API_KEY: API key from the heroku app)
Heroku Notes: Get the heroku API key from account in: -> applications -> create authorization button
- Change line 42 to have your docker repo address in: .github/workflows/prod.yml
- change lines 58 to have your heroku app name in: .github/workflows/prod.yml
- change line 59 to have your heroku email in: .github/workflows/prod.yml
- change line 31 to have your heroku app name in .github/workflows/dev.yml
- change line 32 to have your heroku email in .github/workflows/dev.yml
- Push code to your local repo and check for any errors and fix any errors that appear when the workflow is running. You can check the workflow in the actions.
- To Build with docker compose: docker compose up --build
- To run tests, Lint, and Coverage report use this command: pytest --pylint --cov
.pylintrc is the config for pylint, .coveragerc is the config for coverage and setup.py is a config file for pytest
- https://flask-user.readthedocs.io/en/latest/basic_app.html
- https://hackersandslackers.com/flask-application-factory/
- https://suryasankar.medium.com/a-basic-app-factory-pattern-for-production-ready-websites-using-flask-and-sqlalchemy-dbb891cdf69f
- https://develie.hashnode.dev/exploring-flask-sqlalchemy-queries
- https://wtforms.readthedocs.io/en/3.0.x/
- https://bootstrap-flask.readthedocs.io/en/stable/
- https://flask-sqlalchemy.palletsprojects.com/en/2.x/
- testfdafas