Self-owned AI course platform (Fly.io backend + Netlify frontend).
Canonical base: m-course-creator.
course-creatorv3 is used only as a donor/reference repo. Manus runtime coupling is not part of trunk runtime.
- Client: Vite + React 19 + TypeScript + Tailwind v4 + shadcn-style UI
- API: Express + tRPC
- Database: SQLite + Drizzle ORM + better-sqlite3
- AI: OpenAI + Ollama provider abstraction with deterministic fallback generation
- Frontend API target is controlled by
VITE_API_BASE_URLinclient/src/main.tsx. - All app data operations go through
/api/trpcon your backend. - Backend CORS policy can be locked to Netlify origin via
CORS_ORIGIN.
- Install dependencies
npm install- Create environment file
cp .env.example .env- (Optional) Sync schema with Drizzle
npm run db:push- Start development
npm run dev- Client:
http://localhost:5173 - Server:
http://localhost:3001
npm run dev # Run client + server
npm run build # Build client + compile server
npm run start # Run built server (serves API + built client)
npm run db:push # Push Drizzle schema to SQLite
npm run db:studio # Open Drizzle Studio
npm run typecheck # Type-check client + server
npm test # Run unit + integration testsServer:
PORT(default:3001)DATABASE_PATH(default:./data/app.db)CORS_ORIGIN(optional, recommended in production: your Netlify origin)AI_PROVIDER(openaiorollama, default:openai)OPENAI_API_KEYOPENAI_MODEL(default:gpt-4o-mini)OLLAMA_BASE_URL(default:http://127.0.0.1:11434)OLLAMA_MODEL(default:llama3.1:8b)OLLAMA_API_KEY(optional)
Frontend:
VITE_API_BASE_URL(empty in local same-origin/proxy setups; set to Fly backend URL on Netlify)
This repo includes fly.toml.
- Set secrets/env on Fly (example)
fly secrets set OPENAI_API_KEY=... CORS_ORIGIN=https://<your-site>.netlify.app- Deploy
fly deploy- Verify backend
curl https://manus-course-backend-1774135937.fly.dev/api/healthThis repo includes netlify.toml with:
- build command:
npm run build:client - publish dir:
dist/client - SPA fallback redirect to
/index.html
Set this Netlify env var:
VITE_API_BASE_URL=https://manus-course-backend-1774135937.fly.dev
Then deploy the site normally from this repo.
- Course creation:
/(wizard) and/createcalltrpc.courses.generate - Two-stage generation: architecture + full lessons in
server/trpc/routers/courses.ts - Lesson view: chat + regenerate in
server/trpc/routers/lessons.ts - Quiz flow: generate + submit in
server/trpc/routers/quizzes.ts - Flashcards: initialize + due queue + SM-2 rating in
server/trpc/routers/flashcards.ts - PDF export: server-side course PDF generation in
server/lib/pdf.tsviatrpc.courses.exportPdf - Persistence: SQLite at
DATABASE_PATHwith Drizzle schema inserver/db/schema.ts
See docs/v3-port-log.md for imported donor features and explicitly rejected Manus-coupled code.