A Flask-based web application that leverages Google's Gemini AI to help users create, manage, and learn from their notes. The application automatically generates quizzes and summaries from note content, making it an ideal tool for learning and revision.
- ✍️ Create and store notes with titles and content
- 🤖 AI-powered quiz generation using Google's Gemini AI
- 📝 Intelligent note summarization
- 🎯 Interactive quiz interface with reveal-able answers
- 💫 Modern, responsive user interface
- 🚀 Real-time AI processing
Before you begin, ensure you have:
- Python 3.10 or higher installed
- A Google Cloud account with Gemini API access
- Your Gemini API key
- Create a Python virtual environment:
python -m venv venv- Activate the virtual environment:
- Windows:
venv\Scripts\activate- Unix/MacOS:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt-
Configure your Gemini API key:
- Open
app/app.py - Replace the API key with your own:
genai.configure(api_key="your-api-key-here")
- Or set it as an environment variable:
set GEMINI_API_KEY=your-api-key-here # Windows export GEMINI_API_KEY=your-api-key-here # Unix/MacOS
- Open
-
Run the application:
python app/app.py- Open your browser and navigate to
http://127.0.0.1:5000
-
Backend:
- Flask 3.0.0 - Web framework
- SQLAlchemy 3.1.1 - Database ORM
- Google Generative AI - Gemini model for AI features
- NLTK - Natural Language Processing
-
Frontend:
- HTML5 and CSS3
- Bootstrap - Responsive design
- JavaScript - Interactive features
.
├── app/
│ ├── app.py # Main application file
│ ├── static/
│ │ ├── script.js # Frontend JavaScript
│ │ └── style.css # Custom styles
│ └── templates/
│ └── index.html # Main template
├── instance/
│ └── notes.db # SQLite database
└── requirements.txt # Python dependencies
-
Creating Notes
- Click "Add Note" at the top of the page
- Enter a title and your note content
- Click "Save Note" to store it
-
Generating Quizzes
- Find your note in the list
- Click "Generate Quiz"
- Wait for the AI to create questions
- Use "Reveal Answer" buttons to check your knowledge
- The questions are contextual and test understanding
-
Getting Summaries
- Locate the note you want to summarize
- Click "Summarize"
- The AI will generate a concise summary
- Summaries focus on key points and main ideas
For local development, the built-in Flask server is sufficient:
python app/app.pyFor production deployment, follow these steps:
-
Server Setup
- Install Gunicorn/uWSGI as WSGI server
- Set up Nginx as reverse proxy
- Configure SSL/TLS certificates
-
Environment Configuration
export FLASK_ENV=production export GEMINI_API_KEY=your-api-key
-
Database Configuration
- Consider using PostgreSQL for production
- Update SQLAlchemy configuration
- Set up regular backups
-
Gunicorn Deployment Example
gunicorn -w 4 -b 127.0.0.1:8000 app:app
-
Nginx Configuration Example
server { listen 80; server_name your-domain.com; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }
-
API Security
- Keep API keys secure
- Use environment variables
- Implement rate limiting
-
Data Protection
- Regular database backups
- Input sanitization
- XSS protection
-
User Security
- Consider adding authentication
- Implement CSRF protection
- Use HTTPS in production