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