How shankar-soni-2006/flashcard-generator works
AI Smart Flashcards turns user-provided topics, notes, code, vocabulary, or images into flashcard decks, then supports deck management, sharing, and SM-2 reviews with statistics. The principal path is authenticated client → generation or deck/review features → Express routes and controllers → AI, scheduling, or Supabase. The README documents five generation modes and the product capabilities; some page and service implementations were not sampled, so those links are shown only where documented or left out. The excerpted AI client uses Groq, despite the README describing Gemini; the provider is represented as shown in source.
Main entry points: App.jsx App routing · app.js Express API · supabase.js Supabase client · reviewController.js Review workflow
Components 27
Client application
- App routing
client/src/App.jsx - Authentication
client/src/context/AuthContext.jsx - Client services
client/src/services/index.js
Decks and generation
- Generate page
client/src/pages/Generate.jsx - Deck pages
client/src/pages/Decks.jsx - Shared deck page
client/src/pages/SharedDeck.jsx
Review and insights
- Review page
client/src/pages/Review.jsx - Statistics page
client/src/pages/Statistics.jsx - Review workflow
server/controllers/reviewController.js - Statistics
server/controllers/statisticsController.js - SM-2 scheduler
server/services/scheduler/sm2.js
API and domain logic
- Express API
server/app.js - AI routes
server/routes/aiRoutes.js - Deck routes
server/routes/deckRoutes.js - Card routes
server/routes/cardRoutes.js - Review routes
server/routes/reviewRoutes.js - Statistics routes
server/routes/statisticsRoutes.js - AI generation
server/controllers/aiController.js - Deck management
server/controllers/deckController.js - Card management
server/controllers/cardController.js
Persistence and AI
- Supabase client
client/src/lib/supabase.js - Generation modes
server/services/gemini - AI client
server/services/gemini/geminiClient.js - Supabase client
server/config/supabase.js - Supabase database
Other components
- Learner
- Groq API
Connections 33
- Learner → App routing: uses
- App routing → Authentication: provides auth
client/src/App.jsx - Authentication → Supabase client: authenticates with
client/src/context/AuthContext.jsx - App routing → Generate page: routes to
client/src/App.jsx - App routing → Deck pages: routes to
client/src/App.jsx - App routing → Review page: routes to
client/src/App.jsx - App routing → Statistics page: routes to
client/src/App.jsx - App routing → Shared deck page: routes to
client/src/App.jsx - Review page → Client services: requests review data
client/src/pages/Review.jsx - Generate page → Client services: requests generation
client/src/pages/Generate.jsx - Client services → Express API: calls API
- Express API → AI routes: mounts
server/app.js - Express API → Deck routes: mounts
server/app.js - Express API → Card routes: mounts
server/app.js - Express API → Review routes: mounts
server/app.js - Express API → Statistics routes: mounts
server/app.js - Express API → Deck management: routes public shares
server/app.js - AI routes → AI generation: dispatches
server/routes/aiRoutes.js - Deck routes → Deck management: dispatches
server/routes/deckRoutes.js - Card routes → Card management: dispatches
server/controllers/cardController.js - Review routes → Review workflow: dispatches
server/routes/reviewRoutes.js - Statistics routes → Statistics: dispatches
server/routes/statisticsRoutes.js - AI generation → Generation modes: selects mode
server/controllers/aiController.js - Generation modes → AI client: generates with
server/services/gemini/notesGenerator.js - AI client → Groq API: requests completions
server/services/gemini/geminiClient.js - Deck management → Supabase client: reads and writes
server/controllers/deckController.js - Card management → Supabase client: reads and writes
server/controllers/cardController.js - Review workflow → Supabase client: reads and writes
server/controllers/reviewController.js - Statistics → Supabase client: reads
server/controllers/statisticsController.js - Review workflow → SM-2 scheduler: calculates schedule
server/controllers/reviewController.js - Supabase client → Supabase database: persists data
- Learner → Shared deck page: opens share link
README.md - Learner → Statistics page: views insights
README.md