Application for finding recipes, based on your selection of ingredients.
The application is deployed using Vercel.
- Backend project: https://vercel.com/kristiankjerstad/recipe-app-backend
- Frontend project: https://vercel.com/kristiankjerstad/recipe-app-frontend
Urls to application
- Backend: https://recipe-app-backend-tan.vercel.app/
- Frontend: https://recipe-app-frontend-ochre.vercel.app/
Requirements
- Docker and Docker compose
- Python 3.11
- Node
First, you must create 3 environment variable files inside the backend
folder:
- .env
- local.env
- local.docker.env
use the .env.template file as a template.
To start the backend and frontend, run the command
docker-compose up --build
Now, the frontend application is available at http://localhost:5173/ and the backend application is available at http://localhost:5000
For this to work, you first need to create a new Python virtual environment with the name .venv
inside the backend
folder:
cd backend
python -m venv .venv
source .venv/bin/activate
To run the API debugger, you have to
- Stop the docker-compose service (docker-compose down).
- Open the docker-compose.yaml file and comment out the
backend
service. - Start docker compose again to start the database.
- Open up VS code, and open the "Run and debug" window.
- In drop down menu, select "Python: FastAPI"
Now, you can set break points anywhere in the python code.
From the terminal, navigate to the frontend folder and run
npm run test
From the terminal, navigate to the frontend folder and run
npx playwright test
To do an interactive test, use the extra argument -ui
To create new end to end tests automatically, use the command
npx playwright codegen
Vitest has coverage enabled in the settings. When running npm run dev
, the vitest UI will open in http://localhost:51204/**vitest**/#/?file=
TODO its not working at the moment...
To connect to the local database, started using docker-compose, you can for example use a tool like Azure data studio.
Connection info:
- server name: localhost
- password: development
- user name: postgres
- database name: dev_db
API documentation is automatically created and available at http://localhost:5173/docs
Authentication is enabled with JWT. To create a new jwt token, use http://jwtbuilder.jamiekurtz.com/ with this info:
-
Issuer = "Online JWT Builder"
-
Audience = "recipe-app"
-
subject = "general-user"
-
Role = "user"
-
Key = secret key, ask admin for this