This repo contains a FastAPI backend and a React (Vite) frontend for a piano learning web app.
- PDF lessons with per-page progress tracking
- Audio per PDF page (voice box)
- Hands-on piano with WebAudio playback
- Admin upload for PDFs and page audio
Location: backend/
- Create a virtual environment and install dependencies:
python -m venv .venv
.venv\Scripts\activate
pip install -r backend/requirements.txt- Start PostgreSQL (Docker recommended):
docker compose up -d- Copy env:
copy backend\.env.example backend\.env- Run migrations:
cd backend
alembic revision --autogenerate -m "init"
alembic upgrade head- Start API:
uvicorn app.main:app --reloadLocation: frontend/
cd frontend
npm install
npm run dev- Update
frontend/.env(see.env.example) if API runs on a different host. - The piano uses
frontend/public/samples/a4.wavas a base sample. Replace with higher quality samples for realism.
- Register a user.
- Update the user role to
adminin the database. - Use admin endpoints to create lessons and upload PDFs/audio.
POST /auth/registerPOST /auth/loginPOST /admin/lessonsPOST /admin/lessons/{id}/pdfPOST /admin/lessons/{id}/pages/{page}/audioGET /lessons/{id}/pages/{page}PUT /lessons/{id}/pages/{page}/progress