Create a React/Django TodoMVC app (no need for 1:1, just similar) with a Django Rest Framework API that persists state into PostgreSQL.
Optional:
The project should contain a docker-compose.yml
so that docker-compose up
is all that is needed for running the project. We've provided bases for
docker-compose.yml
and Dockerfile
to help you out.
Requirements:
- Frontend should be a html file rendered by Django that contains a React application
- HINTS:
- https://github.com/facebookincubator/create-react-app
- Django Staticfiles can grab necessary things from create-react-app's build folder
- https://www.techiediaries.com/create-react-app-django/
- https://www.fusionbox.com/blog/detail/create-react-app-and-django/624/
- HINTS:
- Backend should be a Django view serving index.html from
/
and a DRF API in/api/
- connect to
PostgreSQL
withDATABASE_URL=postgres://postgres@postgres:5432/homeworkapp
(or similar) environment variable - HINTS / libraries you might want to use:
- connect to
- Frontend and backend features:
- Create a Todo task
- List all Todo tasks (from the API)
- DONE/UNDONE separately
- Update a Todo task
- OPTIONAL:
docker-compose up
runs the project in port 8080- two services:
postgres
andapp
- two services:
Bonus
- login/logout/signup
- user specific tasks
- other user's can't access each others' TODOs
- nginx in
docker-compose
, use it to serve static assets - if you want to show off something else, feel free :)
Hints:
- You are free to use Google and some copypaste.
Dockerfile
should start withFROM python:3.6
.- you'll need to install dependencies and run the project with
gunicorn
- a good trick is to create
start.sh
that does stuff likemakemigrations
,collectstatic
etc. and use that as the entrypoint
- you'll need to install dependencies and run the project with
- Static files:
- figure out a way to serve static files with
gunicorn
or then usenginx
(make it a service in docker compose)
- figure out a way to serve static files with
- If you get stuck with something, then drop that feature and do what you can
- don't know docker/compose?
manage.py runserver
is better than nothing... - can't get DRF to work? use plain Django... ...
- don't know docker/compose?