EasyDiet is a diet planning web app that generates personalized meal plans and shopping lists based on users’ fitness goals and dietary preferences.
| Layer | Details |
|---|---|
| Auth & Data | Supabase (Postgres + RLS) |
| Backend | FastAPI app in backend/server.py using Gemini |
| Frontend | React 19 + Vite SPA in frontend/ |
| Tests | Pytest for backend utilities, Vitest wiring for the SPA |
Run this query in the Supabase SQL editor. Each table references auth.users.id; add Row Level Security policies that scope reads/writes to auth.uid().
create table public.user_profiles (
user_id uuid primary key references auth.users(id) on delete cascade,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now(),
fitness_goals text,
dietary_restrictions text
);
create table public.conversations (
id uuid primary key,
user_id uuid not null references auth.users(id) on delete cascade,
title text,
last_message_preview text,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create table public.messages (
id uuid primary key,
conversation_id uuid not null references public.conversations(id) on delete cascade,
user_id uuid references auth.users(id) on delete set null,
role text check (role in ('user','model')),
content text not null,
created_at timestamptz not null default now()
);backend/.env
GEMINI_API_KEYS=
MODEL_NAME=
SUPABASE_URL=
SUPABASE_SERVICE_ROLE_KEY=
SUPABASE_JWT_SECRET=
ALLOWED_ORIGINS=
frontend/.env
VITE_SUPABASE_URL=
VITE_SUPABASE_ANON_KEY=
VITE_API_BASE=
In a Terminal:
python --version
python3 --versionNOTE: If you don't have any python version greater than 3.12 you need to install it from the website.
Use python3 in place of python if its version is greater than 3.12 in all of the commands below:
Run in Git Bash:
python -m venv .venvIf you get this prompt, choose yes:
Then:
source .venv/bin/activate
# Use .venv/Scripts/python.exe or .venv/bin/python.exe in place of {python} if running into any errors
python -m pip install -r backend/requirements.txt
python -m uvicorn backend.server:app --reload --host 0.0.0.0 --port 8000To run tests:
python -m pytest backend/tests
# OR
# ignore pydantic warnings
python -m pytest -W "ignore:: pydantic.PydanticDeprecatedSince20"Run in Git Bash:
cd frontend
npm install
npm run devNOTE: You need to have npm and Node.js installed, if not download it from this website
To run tests:
npm run testThe Vite dev server runs on http://localhost:5173 and forwards API calls to VITE_API_BASE.
