IMPORTANT NOTE - This README.md was generated by AI based on changes made to the repository and overall workflow. IMPORTANT NOTE # 2 - This project is in progress. There will be changes rolling out on a weekly basis.
An intelligent study companion built with Cloudflare Workers, Workers AI (Llama 3.3), and Durable Objects for personalized test preparation.
- Serverless Architecture: Runs entirely on Cloudflare Workers
- AI-Powered: Uses Llama 3.3 70B via Workers AI for intelligent content generation
- Multiple Study Modes:
- 📚 Flashcards: Generate AI-powered flashcards for any subject
- 🎯 Multiple Choice Quiz: Practice with questions that include hint dropdowns
- ✅ Graded Test: Take comprehensive tests with AI grading and feedback
- Class Validation: AI verifies if your subject is valid before generating content
- Persistent Sessions: Durable Objects store your study progress
- Beautiful UI: Clean, responsive interface optimized for studying
- Fast & Scalable: Global edge network deployment
.
├── src/
│ ├── index.js # Main Worker entry point & routing
│ ├── chatStorage.js # Durable Object for session storage
│ ├── handlers/ # API endpoint handlers
│ │ ├── validate-class.js # Class validation endpoint
│ │ ├── generate-flashcards.js # Flashcard generation endpoint
│ │ ├── generate-quiz.js # Quiz generation endpoint
│ │ ├── generate-test.js # Test generation endpoint
│ │ ├── grade-test.js # Test grading endpoint
│ │ └── get-session.js # Session retrieval endpoint
│ ├── services/ # Business logic services
│ │ ├── ai-service.js # Workers AI integration
│ │ └── storage-service.js # Durable Objects integration
│ └── utils/ # Utility functions
│ ├── constants.js # Configuration constants
│ ├── validators.js # Input validation
│ ├── response-helpers.js # HTTP response helpers
│ └── json-parser.js # AI response parsing
├── wrangler.toml # Cloudflare Workers configuration
└── package.json # Project dependencies
- Node.js (v16 or later)
- npm or yarn
- Cloudflare account
- Wrangler CLI
-
Install dependencies:
npm install
-
Login to Cloudflare:
wrangler login
-
Run locally:
npm run dev
-
Deploy to Cloudflare:
npm run deploy
- User Interface: Clean HTML/CSS/JS study interface served directly from the Worker
- API Endpoints: Modular handlers process requests for validation, content generation, and grading
- AI Service: Centralized service layer handles all Workers AI interactions with Llama 3.3 70B
- Storage Service: Abstraction layer for Durable Objects manages session state and study content
- Durable Objects: Each study session gets a unique Durable Object instance to persist progress
- Persistent Sessions: Study progress, generated content, and quiz results are maintained across page refreshes
GET /- Study helper interfacePOST /api/validate-class- Validate if a class/subject is valid{ "className": "Biology 101" }POST /api/generate-flashcards- Generate flashcards for a subject{ "className": "Biology 101", "topic": "Cell Structure", "sessionId": "optional-session-id" }POST /api/generate-quiz- Generate multiple choice quiz{ "className": "Biology 101", "topic": "Cell Structure", "sessionId": "optional-session-id" }POST /api/generate-test- Generate a graded test{ "className": "Biology 101", "topic": "Cell Structure", "sessionId": "optional-session-id" }POST /api/grade-test- Submit test for AI grading{ "answers": ["answer1", "answer2"], "sessionId": "session-id" }
Edit wrangler.toml to customize:
- Worker name
- AI model
- Durable Objects settings
Generate interactive flashcards on any topic. Click to flip between question and answer sides.
Practice with AI-generated multiple choice questions. Each question includes:
- 4 answer options
- Expandable hint dropdown for guidance
- Instant feedback on your answers
Take a comprehensive test that the AI will grade:
- Multiple questions covering the topic
- Submit all answers at once
- Receive detailed feedback and scoring
- Review correct answers and explanations
- Cloudflare Workers
- Workers AI (Llama 3.3 70B)
- Durable Objects
- JavaScript
- HTML/CSS
MIT