demo.mp4
To start the backend, open the backend
folder and run
$ docker-compose build && docker-compose up
To stop the backend
$ docker-compose down
Add --volumes
to delete the persisted volumes.
You will need to:
- Add your OpenAI API key to
backend/config/config.py
- Implement the API endpoints in
backend/flask_docker/api.py
Notes:
- To make database queries, use
get_db().fetch("SELECT ... WHERE foo=%s", ("bar",))
orget_db().insert(...)
orget_db().execute(...)
. These functions (and more) are documented indb.py
. - You can use adminer to manage the SQL database by visiting http://localhost:8080 in your browser. The hostname should be
mariadb
(as specified in the docker-compose.yml) and the root password ispassword
- The flask DEBUG flag is set to true, which enables hot-reloading of the flask application, so you won't need to re-build the docker-compose stack when you make changes.
To start the frontend, open the frontend
folder and run yarn install
and then
$ yarn start
Your browser should open to http://localhost:3000
The front-end code should be fully-functional if the backend endpoints are implemented correctly.
Feel free to improve the UI/UX. It's not part of the evaluation criteria, though.