AI-Powered Notebook - Transform your documents into interactive conversations with Google Gemini
NoteMind AI is a modern, intelligent document analysis tool similar to Google's NotebookLM. Upload documents, chat with an AI about their content, and generate comprehensive summaries—all powered by Google's Gemini API with File Search capabilities.
NoteMind AI Python FastAPI Gemini
# Clone e avvia con Docker git clone https://github.com/Gabry848/NoteMind-AI.git cd NoteMind-AI ./start.sh
Oppure vedi la guida completa deployment per più opzioni.
Il sistema esegue automaticamente tutte le migrazioni al primo avvio. Zero configurazione manuale!
- Toggle tema nell'header dashboard (☀️ / 🌙)
- Sincronizzazione preferenza con backend
- Supporto tema automatico (segue il sistema)
Protezione API contro abuse:
- Login: 10 tentativi/minuto
- Chat: 30 messaggi/minuto
- Quiz: 10 generazioni/minuto
- Upload: 20 file/minuto
Cerca documenti per nome o contenuto con debounce intelligente
- Salva configurazioni quiz preferite
- API CRUD completa (
/api/quiz-templates) - Riutilizza impostazioni rapidamente
Converte documenti in conversazioni audio a 2 voci:
- Script conversazionale generato con Gemini
- Preparato per Gemini 2.5 TTS
- Endpoint:
POST /api/documents/{id}/podcast
- Multi-format Support: Upload PDF, DOCX, TXT, JSON, Markdown, and code files
- Drag & Drop Interface: Intuitive file upload with visual feedback
- Real-time Processing: Track document processing status
- Smart Storage: Organized document library with metadata
- Context-Aware Conversations: Chat naturally about your documents
- Citation Support: Get answers with specific references to source material
- Conversation History: Resume previous discussions
- Multi-turn Dialogues: Build on previous questions and answers
- Auto-Generation: Create comprehensive summaries with one click
- Multiple Styles: Choose from brief, medium, or detailed summaries
- Key Topics Extraction: Automatically identify main themes
- Smart Insights: Get the essence of long documents quickly
- Secure Authentication: JWT-based login system
- Personal Workspace: Private document storage per user
- Session Management: Stay logged in securely
- Smooth Animations: Fluid transitions with Framer Motion
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Clean Interface: Minimal, distraction-free design
- Real-time Feedback: Loading states and progress indicators
NoteMind-AI/
├── backend/ # Python FastAPI Backend
│ ├── app/
│ │ ├── api/ # API endpoints
│ │ │ ├── auth.py # Authentication
│ │ │ ├── documents.py # Document management
│ │ │ ├── chat.py # Chat functionality
│ │ │ └── summaries.py # Summary generation
│ │ ├── core/ # Core configuration
│ │ │ ├── config.py # Settings
│ │ │ ├── database.py # Database setup
│ │ │ └── security.py # Auth utilities
│ │ ├── models/ # Database models
│ │ ├── services/ # Business logic
│ │ │ └── gemini_service.py # Gemini API integration
│ │ ├── schemas/ # Pydantic schemas
│ │ └── utils/ # Utilities
│ ├── tests/ # Backend tests
│ └── main.py # FastAPI entry point
├── web/ # Next.js Frontend
│ ├── app/ # Next.js pages
│ │ ├── page.tsx # Landing page
│ │ ├── login/ # Login page
│ │ ├── register/ # Register page
│ │ ├── dashboard/ # Dashboard
│ │ └── document/[id]/ # Document view
│ ├── components/ # React components
│ ├── lib/ # API client
│ ├── store/ # Zustand state management
│ └── types/ # TypeScript types
└── IMPLEMENTATION.md # Detailed roadmap
- Python 3.11+
- Node.js 18+ and npm
- Google Gemini API Key (Get one here)
git clone https://github.com/yourusername/NoteMind-AI.git
cd NoteMind-AIcd backend # Create virtual environment python -m venv venv # Activate virtual environment # On Linux/Mac: source venv/bin/activate # On Windows: # venv\Scripts\activate # Install dependencies pip install -r requirements.txt
cd ../web # Install dependencies npm install
Create a .env file in the project root:
cp .env.example .env
Edit .env with your settings:
# Backend Configuration DATABASE_URL=sqlite:///./notemind.db SECRET_KEY=your-secret-key-change-this-to-random-string ALGORITHM=HS256 ACCESS_TOKEN_EXPIRE_MINUTES=43200 # Google Gemini API (REQUIRED) GEMINI_API_KEY=your-gemini-api-key-here # Frontend URL (for CORS) FRONTEND_URL=http://localhost:3000 # Upload Configuration UPLOAD_DIR=./uploads MAX_UPLOAD_SIZE=10485760
Important: Replace GEMINI_API_KEY with your actual API key from Google AI Studio.
Create .env.local in the web/ directory:
NEXT_PUBLIC_API_URL=http://localhost:8000
cd backend # Make sure virtual environment is activated source venv/bin/activate # or venv\Scripts\activate on Windows # Run the server python main.py
The backend API will be available at http://localhost:8000
- API Documentation:
http://localhost:8000/docs - Health Check:
http://localhost:8000/health
In a new terminal:
cd web # Development mode npm run dev
The frontend will be available at http://localhost:3000
cd backend source venv/bin/activate # Run all tests pytest # Run with coverage pytest --cov=app --cov-report=html # Run specific test file pytest tests/test_auth.py -v
cd web # Run tests (once configured) npm test
- Navigate to
http://localhost:3000 - Click "Get Started" or "Sign up"
- Enter your email and password
- You'll be automatically logged in
- Go to your Dashboard
- Click "Upload Document"
- Drag & drop a file or click to browse
- Wait for processing (usually a few seconds)
- Document will appear with "ready" status
- Click on any document card
- Type your question in the chat input
- Press Enter or click "Send"
- Get AI-powered answers with citations
- Continue the conversation naturally
- In the document view, click the "Summary" tab
- Click "Generate Summary"
- Wait for the AI to analyze the document
- View the summary and key topics
- Regenerate for different insights
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user
GET /api/documents- List all documentsGET /api/documents/{id}- Get document detailsPOST /api/documents/upload- Upload new documentDELETE /api/documents/{id}- Delete document
POST /api/chat- Send messageGET /api/chat/history/{document_id}- Get conversation historyDELETE /api/chat/{conversation_id}- Delete conversation
POST /api/summaries/generate- Generate summaryGET /api/summaries/{document_id}- Get existing summary
Full API documentation available at http://localhost:8000/docs
- FastAPI - Modern Python web framework
- SQLAlchemy - SQL ORM
- SQLite - Lightweight database
- Google Generative AI - Gemini API SDK
- Pydantic - Data validation
- python-jose - JWT tokens
- passlib - Password hashing
- pytest - Testing framework
- Next.js 14+ - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Utility-first styling
- Framer Motion - Smooth animations
- Zustand - State management
- Axios - HTTP client
- React Dropzone - File upload
-- Users table users ( id INTEGER PRIMARY KEY, email TEXT UNIQUE NOT NULL, password_hash TEXT NOT NULL, full_name TEXT, created_at TIMESTAMP, updated_at TIMESTAMP ) -- Documents table documents ( id INTEGER PRIMARY KEY, user_id INTEGER FOREIGN KEY, filename TEXT, original_filename TEXT, file_path TEXT, file_size INTEGER, file_type TEXT, gemini_file_id TEXT, status TEXT, -- processing, ready, error summary TEXT, created_at TIMESTAMP, updated_at TIMESTAMP ) -- Conversations table conversations ( id INTEGER PRIMARY KEY, user_id INTEGER FOREIGN KEY, document_id INTEGER FOREIGN KEY, title TEXT, created_at TIMESTAMP, updated_at TIMESTAMP ) -- Messages table messages ( id INTEGER PRIMARY KEY, conversation_id INTEGER FOREIGN KEY, role TEXT, -- user, assistant content TEXT, citations JSON, created_at TIMESTAMP )
- Password Hashing: bcrypt for secure password storage
- JWT Authentication: Secure token-based auth
- CORS Protection: Configured for specific origins
- Input Validation: Pydantic schemas for all inputs
- SQL Injection Prevention: SQLAlchemy ORM
- File Type Validation: Whitelist of allowed extensions
- File Size Limits: 10MB max per file
- Rate Limiting: (Can be added with slowapi)
- Set environment variables in production
- Use PostgreSQL instead of SQLite
- Set
DEBUG=False - Use production WSGI server (Gunicorn/Uvicorn)
- Enable HTTPS
- Set up database backups
- Build the production version:
cd web
npm run build- Deploy to Vercel, Netlify, or your hosting provider
- Set environment variables in hosting platform
- Configure custom domain
- Backend: Railway, Render, or DigitalOcean
- Frontend: Vercel or Netlify
- Database: PostgreSQL on Supabase or Neon
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini API for powerful AI capabilities
- Next.js team for excellent React framework
- FastAPI for modern Python web development
- All open-source contributors
For issues, questions, or suggestions:
- Open an issue on GitHub
- Email: your@email.com
Made with ❤️ using Next.js, FastAPI, and Google Gemini