Skip to content

Johnnybar/language-learning-app

Repository files navigation

language-learning-app

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

Quick Start

1) Clone & install

npm install

2) Configure env

Copy templates and fill with your values:

cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
  • Get SUPABASE_URL and SUPABASE_ANON_KEY from your Supabase project settings.

3) Run dev (concurrently)

npm run dev

4) Docker (optional)

docker compose up --build
  • Frontend on port 5173
  • Backend on port 3000

Supabase Schema (vocab)

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);

Notes

  • 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 /chat route uses a stub that echoes. Replace chatWithModel with 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, /vocab to the backend in dev.

Scripts

  • npm run dev — run both apps
  • npm run build — build backend + frontend
  • npm run lint / npm run format

Generated on 2025-10-21

About

language-learning-app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published