Web application for tracking Recipes, Meals, MealPlans and Nutritional Information. Built using Django, Django REST Framework, Heroku, Metabase and Swagger
-
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 themeal_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
- The Backend sandbox can be accessed using Django Admin Panel and Grappelli at https://meal-planner-hm.herokuapp.com/ with the following credentials:
- Username: admin@mp.com
- password:
yummytummy
- The MetaBase App can be accessed over at https://meal-helper-metabase-demo.herokuapp.com/ using the following credentials:
- Username: admin@mp.com
- Password:
yummytummy1
- The Database Schema diagram can be found over here
- Interactive API Documentation generated using Swagger can be found here
- API Documentation using the OpenAPI spec can be found over here
- 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