A full-stack application that uses AI to automatically generate flashcards from your documents. Upload a PDF, DOCX, or TXT file and let Google Gemini create study materials for you.
Built with React, Django, and modern web technologies to demonstrate real-world full-stack development.
By exploring and modifying this project, you'll understand:
- ✅ How data flows from user action → frontend → backend → database and back
- ✅ How authentication works in real applications (JWT tokens)
- ✅ How to integrate third-party APIs (Google Gemini)
- ✅ How to structure a production-ready full-stack app
- ✅ Common patterns you'll see in professional codebases
- ✅ Why certain architectural decisions are made
- Upload and process documents (PDF, DOCX, TXT)
- AI-powered flashcard generation
- User authentication
- Organize by topics
- Interactive flashcard viewer
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Dining Area │ ←────→ │ Kitchen │ ←────→ │ Pantry │
│ (Frontend) │ │ (Backend) │ │ (Database) │
│ │ │ │ │ │
│ React │ │ Django │ │ SQLite │
│ What you see │ │ The logic │ │ Stored data │
└──────────────┘ └──────────────┘ └──────────────┘
Frontend: What users see and interact with (the dining area) Backend: Where the logic happens (the kitchen) Database: Where data is stored permanently (the pantry) API: How they talk to each other (the order system)
When you upload a document, here's what happens:
1. User Action (Frontend)
You click "Create Flashcards" → React captures the event
The UI responds to your click using event handling.
2. The Request (API Call)
Browser sends HTTP POST → Travels to backend
An HTTP request with your file is sent to an endpoint like /api/flashcards/
3. Backend Receives (Routing)
Django receives request → Routes to the correct view
The server matches the URL and directs it to the right handler.
4. Processing (Database + AI)
View validates → Saves to database → Processes with AI
Django's ORM saves your data, then Gemini AI generates flashcards.
5. Response Sent Back
Backend sends JSON response → Status code indicates success
The server responds with a status code (like 201 Created) and data.
6. UI Updates
Frontend receives response → Updates the page
React's state management triggers a re-render to show your new flashcards.
📚 See ARCHITECTURE.md for detailed diagrams and code references
- React 18 - UI components
- Vite - Fast build tool
- Tailwind CSS - Styling
- Axios - API requests
- Django 5.2.7 - Web framework
- Django REST Framework - API toolkit
- JWT - Authentication
- SQLite - Database (built-in, no installation needed)
- Google Gemini - AI processing
- Python 3.8+
- Node.js 16+
- Git
New to installation or running Windows? Check INSTALLATION.md for easy setup using package managers (Homebrew for macOS, Winget for Windows).
Run the setup script for your operating system:
macOS/Linux:
./setup.shWindows:
setup.batThe script will:
- Check that Python and Node.js are installed
- Create your
.envfiles (backend and frontend) from examples - Install all dependencies
- Set up the database
- Guide you through any required steps
Then start the app:
make devVisit http://localhost:5173 to use the app!
Once the app is running, here's your learning path:
- ⏱️ 5 mins - Create your first flashcard set: Upload a document and see the AI in action
- ⏱️ 30 mins - Follow a request through the code: Open browser DevTools (Network tab), make a request, trace it through the codebase using the flow diagram above
- ⏱️ 1 hour - Read CONCEPTS_GUIDE.md: Learn the terminology you'll see in the code
- ⏱️ 2-3 hours - Explore the codebase: Read through the files in the Project Structure below, see how they connect
- ⏱️ Variable - Try the challenges: See "Challenges" section below to start building!
1. Clone and configure
git clone https://github.com/Alex-cmd-dev/Help2Study.git
cd Help2Study
# Create backend .env
cp .env.example .env
# Create frontend .env
cp frontend/.env.example frontend/.envGet your Gemini API key:
- Go to https://aistudio.google.com and sign in with your Google account
- Click on "Get API Key" in the dashboard
- Click "Create API Key"
- Create a new project (or select an existing one)
- Select the project you want to use
- Click "Generate API Key"
- Copy the generated API key
- Open
.envfile (in root directory) and paste your API key:GEMINI_API_KEY=your_key_here
Note: The project uses two .env files:
Help2Study/.env- Backend configuration (containsGEMINI_API_KEY)Help2Study/frontend/.env- Frontend configuration (containsVITE_API_URL)
2. Install dependencies
make install
# OR manually: pip install + npm install3. Run migrations and start
make migrate
make devhelp2study/
├── backend/ # Django (Server)
│ ├── api/
│ │ ├── models.py # Database structure
│ │ ├── views.py # Request handlers
│ │ ├── serializers.py # Data conversion
│ │ ├── urls.py # API routing
│ │ ├── geminiapi.py # AI integration
│ │ └── utils/ # Utility functions
│ │ └── text_extractors.py
│ └── backend/
│ └── settings.py # Configuration
│
├── frontend/ # React (Client)
│ └── src/
│ ├── components/ # UI components
│ ├── pages/ # Page views
│ ├── services/ # API service layer
│ │ ├── topicService.js
│ │ └── flashcardService.js
│ └── api.js # HTTP client
│
├── ARCHITECTURE.md # System design details
├── ADVANCED_PATTERNS.md # Professional patterns guide
├── CONCEPTS_GUIDE.md # Technical glossary
├── INSTALLATION.md # Beginner installation guide
└── README.md # This file
REST API following standard HTTP methods:
Authentication
POST /api/user/register/- Create accountPOST /api/token/- Login
Flashcards (CRUD)
GET /api/topics/- List topicsPOST /api/topics/- Create topic + upload file to generate flashcardsGET /api/flashcards/<topic_id>/- Get flashcards for a topicDELETE /api/topic/delete/<id>- Delete topic
Goal: Get comfortable modifying the existing codebase
Pick ONE to try:
- Add a "Favorite" button to flashcards (frontend + backend + database)
- Change the flashcard flip animation to a slide transition
- Add a flashcard counter showing "Card 3 of 10"
- Modify the AI prompt in
geminiapi.pyto generate more/fewer questions per document - Add a "dark mode" toggle to the UI
Why this helps: You'll trace code from UI → API → database, understanding the full flow.
Goal: Build something new using the existing patterns
Pick ONE feature to add:
- Study Mode: Track which cards you got right/wrong, show statistics
- Search: Filter flashcards by keyword
- Edit Mode: Let users edit generated flashcards before saving
- Export: Download flashcard set as CSV or JSON
- Quiz Mode: Multiple choice version of flashcards with scoring
Why this helps: You'll apply the patterns you learned to solve new problems.
Goal: Start YOUR project TODAY
Don't wait to feel "ready." Pick an idea and START:
Ideas based on Help2Study's structure:
- Recipe Saver - Upload photos, AI extracts ingredients/steps
- Code Snippet Manager - Save and organize code with AI-generated tags
- Interview Prep - Upload job description, generate practice questions
- Budget Tracker - Scan receipts, auto-categorize expenses
- Habit Tracker - Log daily habits with streak visualization
Or adapt Help2Study directly:
- Change it to quiz generation instead of flashcards
- Make it for a different subject (vocabulary, math problems, etc.)
- Add multiplayer study groups
The Rule: Commit your first code TODAY. Even if it's just the project setup and a README. Starting is the hardest part.
Remember: You learned by doing, not by waiting. Your next project will be easier because you'll recognize the patterns.
make install # Install all dependencies
make migrate # Setup database
make dev # Start both servers
make dev-backend # Start Django only
make dev-frontend # Start React only
make lint # Check code quality
make clean # Clean temp filesWithout Make:
Windows:
# Start backend
cd backend && python manage.py runserver
# Start frontend (in a new terminal)
cd frontend && npm run devmacOS/Linux:
# Start backend
cd backend && python3 manage.py runserver
# Start frontend (in a new terminal)
cd frontend && npm run devFull-Stack Development: Building frontend, backend, and database together Client-Server Model: Browser (client) requests data from server Request/Response Cycle: How clients and servers communicate HTTP Methods: GET (read), POST (create), DELETE (remove) ORM: Work with database using Python objects, not SQL State Management: How React tracks and updates data Environment Variables: Store secrets like API keys safely
📚 Full glossary with links: CONCEPTS_GUIDE.md
This Project:
- INSTALLATION.md - Fast setup using package managers
- ARCHITECTURE.md - Request flow diagrams
- CONCEPTS_GUIDE.md - Technical terms explained
- ADVANCED_PATTERNS.md - Professional patterns & refactoring guide
Official Docs:
- React - Frontend
- Django - Backend
- Django REST Framework - API
- Tailwind CSS - Styling
Learning:
- MDN Web Docs - Web fundamentals
- freeCodeCamp - Free tutorials
Can't find API_KEY
→ Create .env file with your Gemini API key:
- Visit https://aistudio.google.com
- Sign in and click "Get API Key" in the dashboard
- Create a new project or select an existing one
- Generate the API key and copy it
- Paste it in your
.envfile:GEMINI_API_KEY=your_key_here
Can't connect to backend / Getting 404 errors
→ Make sure both .env files exist:
- Backend
.envin root directory:Help2Study/.env - Frontend
.envin frontend directory:Help2Study/frontend/.env→ The frontend.envshould contain:VITE_API_URL=http://localhost:8000→ Make sure Django is running:make dev-backend
Database errors
→ Run migrations: make migrate
Port already in use
→ Kill process: lsof -ti:8000 | xargs kill -9
Think in systems: Plan your data model and API endpoints first Follow the request: Use browser DevTools to trace data flow Build incrementally: Start simple, add features one at a time
- Never commit
.envor API keys - Change Django
SECRET_KEYfor production - Set
DEBUG=Falsein production - Use PostgreSQL instead of SQLite in production
Built with Django, React, Vite, shadcn/ui, and Google Gemini