Beer Logging Web-application
In a world where Untappd rules the beer logging game, I took it upon myself to create a similar application, BeerMe, where I can log my new beers and track stats (that I'm interested in) about the beers that I've had.
Where can I find it?
Building BeerMe
You can find the full documentation at BeerMe's readthedocs page
- Firstly, BeerMe was built using a Flask framework.
- The first thing I worked on was an
auth
blueprint that contained theregister
andlogin
views with the application.
ABlueprint
is a way to organize a group of related views and other code. Rather than registering views and other code directly with an application, they are registered with a blueprint. Then the blueprint is registered with the application when it is available in the factory function. Aview
function is the code you write to respond to requests to your application. Flask uses patterns to match the incoming request URL to the view that should handle it. The view returns data that Flask turns into an outgoing response.
- Next, went ahead and created a
db
blueprint that would essentially get the database (which is a simple SQLite3 database), and initialize the application when called. - The SQLite3 database has two main schemas, one for
user
and another forbeers
- to track the users registrations and beer logging, respectively.
- The next blueprint was the
checkin
blueprint, which contained thelog_beer
view that was responsible for taking input from a user and writing the beer log data into our database.
- The last blueprint was the
stats
blueprint, which contains the views that are tasked with generating statistics and generating the seaborn plots that are seen on the stats page.
With all the blueprints and my initialization script in place, all I had to do was create the empty database + initialize the app.
Cheers!