Product: Standalone web application for AI-powered MakeCode tutorial authoring
Status: Design phase
Created: 2026-04-12
- Standalone - No OpenClaw dependency
- Self-contained - Own LLM backend (Claude/OpenAI API)
- Simple deployment - Single web app, easy to host
- Teacher-friendly - No technical setup required
- Free tier - Basic usage free, premium for advanced features
┌─────────────────────────────────────────┐
│ TutorialChat Web App │
├─────────────────────────────────────────┤
│ Frontend (React/Next.js) │
│ - Chat interface │
│ - Live preview │
│ - Tutorial editor │
├─────────────────────────────────────────┤
│ Backend (FeathersJS API) │
│ - LLM integration (Claude/OpenAI) │
│ - Tutorial CRUD │
│ - GitHub publishing │
│ - User accounts │
├─────────────────────────────────────────┤
│ Database (PostgreSQL) │
│ - Users │
│ - Tutorials (drafts) │
│ - Generation history │
└─────────────────────────────────────────┘
Frontend:
- Framework: Next.js 14+ (React, TypeScript)
- UI Library: Tailwind CSS + Headless UI (or shadcn/ui)
- Chat UI: Custom chat component (similar to MicroChat)
- Preview: Markdown renderer + syntax highlighting
- Deployment: Vercel or DigitalOcean App Platform
Backend:
- API Framework: FeathersJS (same as MicroChat for consistency)
- Language: Node.js + TypeScript
- LLM Provider: Anthropic Claude API (primary) + OpenAI fallback
- Auth: JWT + email/password (or OAuth via Auth0/Clerk)
- GitHub Integration: Octokit (GitHub API client)
- Deployment: DigitalOcean App Platform or Railway
Database:
- DB: PostgreSQL (managed instance)
- ORM: Sequelize or Prisma
- Migrations: Knex or Prisma Migrate
External Services:
- LLM: Anthropic Claude API (pay-per-token)
- Storage: S3-compatible (DO Spaces or Cloudflare R2) for images
- GitHub: GitHub API (for publishing tutorials)
- Email: SendGrid or Resend (for notifications)
interface User {
id: string
email: string
name: string
githubUsername?: string
githubToken?: string // Encrypted, for publishing
subscription: 'free' | 'pro'
createdAt: Date
updatedAt: Date
}interface Tutorial {
id: string
userId: string
title: string
slug: string
markdown: string // The tutorial content
status: 'draft' | 'published'
publishedUrl?: string // GitHub tutorial URL
githubRepo?: string
metadata: {
targetAge?: string
complexity?: 'beginner' | 'intermediate' | 'advanced'
estimatedMinutes?: number
topics?: string[]
}
createdAt: Date
updatedAt: Date
publishedAt?: Date
}interface GenerationHistory {
id: string
userId: string
tutorialId?: string
prompt: string
response: string
tokensUsed: number
model: string
createdAt: Date
}Anthropic Claude (Primary):
- API Key stored in environment variables
- Model:
claude-3-5-sonnet-20241022(or latest) - System prompt: Tutorial authoring expert
- Streaming: Yes (for real-time generation)
OpenAI (Fallback):
- API Key stored in environment variables
- Model:
gpt-4oorgpt-4-turbo - Use if Claude unavailable or rate-limited
See: prompts/tutorial-generator.md (to be created)
Key elements:
- MakeCode tutorial format specification
- Block syntax reference
- Pedagogical best practices
- Age-appropriate language guidelines
- Step-by-step structure
Service: services/llm/tutorial-generator.ts
class TutorialGenerator {
async generate(prompt: string, context?: TutorialContext): Promise<string>
async refine(markdown: string, instruction: string): Promise<string>
async addStep(markdown: string, stepDescription: string): Promise<string>
async simplify(markdown: string, targetAge: string): Promise<string>
}Rate Limiting:
- Free tier: 10 generations/day
- Pro tier: Unlimited (or high limit)
- Token budget tracking per user
- What is TutorialChat?
- Example tutorials
- Sign up / Log in
- Chat interface: "What tutorial do you want to create?"
- User describes: "A tutorial teaching 6th graders about temperature sensors"
- AI generates complete markdown
- Preview panel shows rendered tutorial
- User: "Make step 3 simpler"
- User: "Add an image placeholder in step 2"
- User: "Add a challenge at the end"
- AI updates the tutorial
- Option A: Download markdown (manual GitHub upload)
- Option B: Connect GitHub account → one-click publish
- Option C: Export as PDF/print
- Tutorial library (all drafts + published)
- Edit existing tutorials
- Duplicate/fork tutorials
- Archive/delete
✅ Chat Interface
- Message input
- Streaming responses
- Conversation history
✅ Tutorial Generation
- Natural language prompt → markdown
- Proper MakeCode format
- Complete working code examples
✅ Preview Panel
- Live markdown rendering
- Syntax highlighting
- Collapsible sections
✅ User Accounts
- Email/password signup
- JWT authentication
- Basic profile
✅ Tutorial CRUD
- Create new
- Save drafts
- Edit/update
- Delete
✅ Export
- Download markdown file
- Copy URL (after GitHub publishing)
⏭ GitHub Connection
- OAuth flow
- Repo selection/creation
- Token storage (encrypted)
⏭ One-Click Publish
- Commit markdown to repo
- Generate MakeCode URL
- Generate QR code
- Update tutorial status
⏭ Tutorial URLs
- Shareable link
- QR code download
- Embed code
⏭ AI Image Generation
- Generate diagrams for steps
- Upload custom images
- Image library
⏭ Template Library
- Pre-made tutorial templates
- Community templates
- Clone/customize
⏭ Collaboration
- Share drafts with other teachers
- Comments/feedback
- Version history
⏭ Analytics
- Tutorial views (if self-hosted)
- Student completion tracking
- Popular tutorials
- Frontend: Localhost:3000 (Next.js dev server)
- Backend: Localhost:3030 (FeathersJS)
- Database: Local PostgreSQL or Docker
- Platform: DigitalOcean App Platform (or Vercel + Railway)
- Domain: staging.tutorialchat.app (or similar)
- Database: Managed PostgreSQL
- Env: Separate API keys (test mode)
- Platform: DigitalOcean App Platform
- Domain: tutorialchat.app (or tutorialchat.forwardedu.com)
- Database: Managed PostgreSQL (production tier)
- CDN: Cloudflare (if needed)
- Monitoring: Sentry + Uptime monitoring
- App Platform: $12-25/month (basic tier)
- Database: $15/month (managed PostgreSQL)
- Storage: $5/month (images)
- Domain: $1/month
- Claude API: ~$0.01-0.03 per tutorial (depending on complexity)
- Estimate: 1000 tutorials/month = $10-30
- Free tier: Cap at $50/month, upgrade prompt for heavy users
- Fixed: ~$35/month
- Variable: $10-50/month (depending on usage)
- Total: ~$50-100/month for MVP
- 10 tutorials/month
- Download markdown
- Basic features
- Unlimited tutorials
- GitHub auto-publish
- Priority support
- AI image generation
- Analytics
- Unlimited teachers
- White-label option
- Custom domain
- SSO integration
- Tutorials: User owns their content
- Markdown storage: Encrypted at rest
- GitHub tokens: Encrypted in database
- LLM prompts: Not logged (privacy)
- COPPA: No student data (teacher tool only)
- FERPA: N/A (no student PII)
- GDPR: Data export + deletion support
- SOC 2: Future (if enterprise sales)
- Branding: TutorialChat vs MakeCode Tutorial Builder vs other name?
- Domain: tutorialchat.app vs tutorialchat.forwardedu.com vs subdomain?
- GitHub requirement: Require GitHub account for all users, or optional?
- Free tier limits: 10 tutorials/month enough? Lower/higher?
- LLM provider: Claude only, or OpenAI as primary option?
- Hosting: DigitalOcean App Platform vs Vercel + separate API?
- ✅ Finalize architecture (this doc)
- Create Next.js + FeathersJS boilerplate
- Set up Claude API integration
- Build basic chat UI
- Test tutorial generation
- User authentication
- Database setup + models
- Tutorial CRUD
- Preview panel
- Download/export
- GitHub OAuth integration
- One-click publishing
- QR code generation
- Tutorial library UI
- Deployment to staging
- Pro tier features
- AI image generation
- Template library
- Analytics
- Public launch
Status: Architecture defined 2026-04-12. Ready to start implementation.