Meal Helper - Recipe and MealPlan Management System
Index
Summary
Web application for tracking Recipes, Meals, MealPlans and Nutritional Information. Built using Django, Django REST Framework, Heroku, Metabase and Swagger
Installation
Local instructions
-
Make sure you have a Postgres version greater than 9.6
-
Clone the repo
-
Create your .env
file by using .env.example
as template and substituting values based on your environment
-
Use Pyenv to install and set Python to version 3.7.x
-
Run pipenv install
-
Activate the virtualenv using pipenv shell
-
Create development Postgres Database using the command createdb meal_planner_db
and permissions for user as mentioned in the meal_planner/settings/dev.py
eg.
$ createdb meal_planner_db
$ psql -U <user> or $ psql postgres
# CREATE ROLE meal_planner_app WITH LOGIN PASSWORD 'your-awesome-password';
# GRANT ALL PRIVILEGES ON DATABASE meal_planner_db TO meal_planner_app;
# \q
-
Create a superuser using the command python manage.py createsuperuser
-
Run the local server using the command python manage.py runserver
-
Hop on to the site and go to <your-localhost-with-port>/admin
-
Use the above credentials to log into the admin panel
Demo
API Documentation
Implementation Choices
-
Python3: Py2 is has reached EoL
-
Pyenv: For multiple python env management
-
Pipenv: For managing Pip files and environment variables
-
Postgres: Open Source RDBMS Version above 9 to use
jsonb
if required
-
Django: Between Bottle, Flask and Django; Django provides a much richer ecosystem and helps the user hit the ground running much faster as compared to Flask. Django 2.2 offers LTS.
-
Grappelli: Django Admin Panel replacement. Had to refactor from Django Jet as Jet is broken above Django 2.0
-
Django REST Framework: REST APIs with automagical CRUD and extendability
-
DRF JWT: JWT for auth. Need to move towards SimpleJWT
-
Django Debug Toolbar: More efficient debugging + power shell
-
Django Query Count: Relatively obscure library which prints out all the queries that happen behind any API request. Helps find bottle necks and duplicated queries
-
Raven/Sentry: Capture bugs and stack traces in non prod env
-
Heroku: Smooth and feature rich PaaS which helps you focus on Dev without fretting a lot about DevOps
-
UnitTest: Unit Tests for Task 1 using UnitTest Library since it is the standard library and fits the needs for now
-
Django Filter: Helps build custom filters which can be dropped in with DRF
-
Swagger UI: De facto API Documentation Tool