Monorepo starter for a Spanish learning chat app:
- Backend: Node.js + Express + TypeScript
- Frontend: React + Vite + TypeScript
- Auth & DB: Supabase
- Voice I/O: Web Speech (speech-to-text) + SpeechSynthesis (text-to-speech) placeholders
- Docker: Dockerfiles + docker-compose for local/dev usage
npm installCopy templates and fill with your values:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env- Get
SUPABASE_URLandSUPABASE_ANON_KEYfrom your Supabase project settings.
npm run dev- Backend: http://localhost:3000
- Frontend: http://localhost:5173
docker compose up --build- Frontend on port 5173
- Backend on port 3000
Create a vocab table:
create table if not exists public.vocab (
id bigint generated by default as identity primary key,
user_id uuid not null references auth.users(id) on delete cascade,
term text not null,
translation text not null,
notes text,
created_at timestamp with time zone default now()
);
-- Enable RLS and basic policies
alter table public.vocab enable row level security;
create policy "vocab select own"
on public.vocab for select
using (auth.uid() = user_id);
create policy "vocab insert own"
on public.vocab for insert
with check (auth.uid() = user_id);- Auth flow: Frontend handles sign-up/sign-in using Supabase. It forwards the session access token as a Bearer header; backend verifies with
supabase.auth.getUser(token). - Chat: Backend
/chatroute uses a stub that echoes. ReplacechatWithModelwith your provider call (HuggingFace, local LLM, etc.). - Voice: The Web Speech API works best in Chromium-based browsers. iOS Safari requires user interaction for TTS.
- Proxy: Vite dev server proxies
/auth,/chat,/vocabto the backend in dev.
npm run dev— run both appsnpm run build— build backend + frontendnpm run lint/npm run format
Generated on 2025-10-21