A guide for writing great web apps.
Set Up Laptop
Set up your laptop with :
Create App
Get Suspenders.
1
|
|
Create the app.
1
|
|
Set Up App
Get the code
1
|
|
Set up the app’s dependencies
1 2 |
|
Use Heroku config to get ENV variables. (https://github.com/ddollar/heroku-config)
1
|
|
Delete extra lines in .env, leaving only those needed for app to function properly. For example: BRAINTREE_MERCHANT_ID and S3_SECRET.
Use Foreman to run the app locally (https://github.com/ddollar/foreman)
1
|
|
It uses your .env file and Procfile to run processes like Heroku’s Cedar stack. (https://devcenter.heroku.com/articles/cedar)
Git protocol
https://github.com/thoughtbot/guides/tree/master/protocol/git
Product Review
https://github.com/thoughtbot/guides/tree/master/protocol/product-review
Code Review
https://github.com/thoughtbot/guides/tree/master/code-review
Review data integrity closely, such as migrations that make irreversible changes to the data, and whether there is a related todo to make a database backup during the staging and production deploys.
Review SQL queries for potential SQL injection.
Review whether dependency upgrades include a reason in the commit message, such as a link to the dependency’s ChangeLog or NEWS file.
Review whether new database indexes are necessary if new columns or SQL queries were added.
Review whether new scheduler (cron) tasks have been added and whether there is a related todo in the project management system to add it during the staging and production deploys.
Deploy
View a list of new commits. View changed files.
1 2 3 |
|
If necessary, add new environment variables.
1
|
|
Deploy to Heroku
1
|
|
If necessary, run migrations and restart the dynos.
1 2 |
|
Introspect to make sure everything’s ok.
1
|
|
Test the feature in browser.
Deploy to production.
1 2 3 4 5 6 7 8 |
|
Watch logs and metrics dashboards.
Close pull request and comment Merged.
Set Up Production Environment
Make sure that your Procfile is set up to run Unicorn. (https://devcenter.heroku.com/articles/procfile)
Make sure the PG Backups add-on is enabled.
Create a read-only Heroku Follower for your production database. If a Heroku database outage occurs, Heroku can use the follower to get your app back up and running faster. (https://devcenter.heroku.com/articles/heroku-postgres-follower-databases#high-availability-with-followers)