NoteSpark is a smart, minimal notes application built with Django. It goes beyond a simple notepad by integrating Google's Gemini API, allowing you to generate detailed, structured notes from just a few keywords.
This app serves as a powerful personal knowledge base, a writing assistant, and a demonstration of how to integrate modern AI into a classic full-stack web application.
- Full CRUD Functionality: Create, read, update, and delete notes.
- AI-Powered Content Generation: Uses the Google Gemini API to generate rich, formatted notes directly from your title or keywords.
- Markdown Rendering: Write in Markdown and have it beautifully rendered as HTML on the detail page.
- PDF Export: Download any note as a PDF document for offline use or sharing.
- Responsive UI: A clean, mobile-friendly interface built with Bootstrap and custom CSS.
- Dynamic Loader: A simple JavaScript loader provides user feedback (and funny quotes) while waiting for the AI to respond.
- Backend: Python, Django
- AI: Google Gemini API (
google-generativeai) - Frontend: HTML, Bootstrap 5, CSS, vanilla JavaScript
- Database: SQLite3 (development)
- Key Libraries:
xhtml2pdf(for PDF generation)markdown(for template filtering)python-dotenv(for API key management)
Follow these steps to get the project running on your local machine.
-
Clone the Repository:
git clone https://your-repo-url/notespark.git cd notespark -
Create and Activate a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
(Note: You may need to create a
requirements.txtfile first:pip freeze > requirements.txt) -
Set Up Environment Variables:
- Create a file named
.envin the root project directory (wheremanage.pyis). - Add your Gemini API key to this file:
GOOGLE_API_KEY="YOUR_API_KEY_HERE"
- Create a file named
-
Run Database Migrations:
python manage.py migrate
-
Run the Development Server:
python manage.py runserver
Your app will be live at
http://127.0.0.1:8000/.
This project is built to grow. Here's a look at what's planned next:
- Secure Authentication: Implement Django's built-in
authsystem to add user login/logout. All notes will be private to the user who created them. - Rich Text Editor: Replace the plain
<textarea>with a WYSIWYG editor likedjango-ckeditorfor a friendlier editing experience. - Note Sharing: Add a "Share" button to generate a secret, public URL (using UUIDs) for read-only note sharing.
- QR Code Sharing: Alongside the share link, generate a downloadable QR code for easy desktop-to-mobile sharing.
- Tagging System: Implement a
ManyToManyFieldto add tags to notes (e.g., "work," "python") and filter by them.
- AI Tag Suggester: Use the Gemini API to automatically suggest relevant tags for a note based on its content.
- Semantic Search: Integrate PostgreSQL with
pgvectorto create embeddings for each note, enabling a search bar that finds notes by meaning, not just keywords. - Decoupled Frontend (Streaming): Re-architect the frontend using JavaScript (like React or Vue) and a Django REST Framework (DRF) backend to enable live, word-by-word text streaming from the AI.