-
Notifications
You must be signed in to change notification settings - Fork 98
Home
This is an minimal but opinionated boilerplate meant for building out simple REST APIs deployed with Heroku primarily used at Hack4Impact UIUC. This app is written in Python 3.6 with Postgres 10 as the chosen data persistance. You can deploy it with another service, like AWS, Google Cloud, or DigitalOcean with Gunicorn and Nginx, but instructions for that are not provided. Included are simple examples and instructions developing with or without Docker are provided. I've also written a blog post about using Docker based on this repository.
First, you must setup install and setup Python and Postgres. Here are the installation docs. Once you are done, look into the structure of the boilerplate and the conventions and examples provided. All of the topics are to your right!
The goal of this boilerplate is to allow developers to quickly write their API structured to best practices while giving them flexibility to easily add/change features. Here are the problems this is trying to solve:
-
Flask is too flexible. With Flask, you can write your application in any structure you like, even in one file. There are also a lot of different tutorials and guides providing different instructions to setup a Flask app with a database, confusing many newcomers. This Boilerplate's structure is inspired by Django's structure and is based on the hitchiker's guide to Python and described below.
-
Django and other Flask boilerplates are too heavy. Sometimes, I don't need a fully featured admin portal with Redis and an Email manager nor do I need templates. Many APIs and applications require the use of a database though. Thus, I've chosen Postgres because it is a battle-tested and reliable database used in many companies and we know that 99% of applications can easily be designed to use SQL databases (especially the ones used at Hack4Impact).
-
Other boilerplates don't provide enough instructions to setup everything. This includes downloading and installing the databases, connecting them to Flask, etc.
For development, the default way is to use Docker for ease of setup. However, there is documentation for setup without docker here. Setup Instructions will be provided below. I've also written a blog post about using Docker based on this repository.