Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ SmartNotes

"I hate doing repetitive document summarization... so I automated it!"

AI-powered document summarization and quiz generation application. Upload PDFs or text documents to get instant summaries, keyword extraction, and automatically generated comprehension quizzes.

NEW: AutoNotes batch processor - process entire folders of documents in one command!

Features

SmartNotes (Single Document)

  • πŸ“„ PDF & Text Support: Upload PDF files or paste text directly
  • πŸ€– AI-Powered Analysis: Automatic summarization using LLM
  • πŸ”‘ Keyword Extraction: Identifies key concepts and terms
  • ❓ Quiz Generation: Creates 5 multiple-choice questions
  • πŸ’Ύ Persistent Storage: SQLite database for note history
  • 🎨 Modern UI: Clean, responsive interface

AutoNotes (Batch Processing) πŸš€

  • πŸ“ Batch Processing: Process entire folders of documents
  • ⚑ One Command: Analyze dozens of files automatically
  • πŸ“Š HTML Index: Beautiful overview of all results
  • πŸ—‚οΈ Organized Output: Each document in its own folder with metadata
  • πŸ”„ Cross-Platform: Works on Windows, Mac, and Linux

Quick Start

Prerequisites

  • Python 3.11 or higher
  • pip package manager

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/smartnotes.git
cd smartnotes
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit .env and add your LLM API key
  1. Run the application:
python app/main.py
  1. Run the application:
python run.py
  1. Open your browser to http://localhost:5000

AutoNotes - Batch Processing

Process entire folders of documents automatically:

# Process a folder of documents
python scripts/auto_notes.py /path/to/documents

# Specify output location
python scripts/auto_notes.py /path/to/documents -o my_output

# Run the demo
bash scripts/run_demo.sh

What you get:

  • Organized folder structure (one folder per document)
  • metadata.json with full analysis for each document
  • summary.txt for quick reference
  • Beautiful HTML index showing all results
  • Original files preserved

Example:

# Process test fixtures
python scripts/auto_notes.py tests/fixtures -o auto_notes_output

# Open the index
open auto_notes_output/index.html  # Mac
start auto_notes_output/index.html  # Windows
xdg-open auto_notes_output/index.html  # Linux

Running Tests

Run the complete test suite:

pytest tests/ -v

Run with coverage report:

pytest tests/ -v --cov=app --cov-report=html

API Documentation

POST /api/upload

Upload a document for analysis.

Request:

  • Method: POST
  • Content-Type: multipart/form-data or application/x-www-form-urlencoded

Parameters:

  • file: PDF or text file (multipart/form-data)
  • text: Raw text content (form data or JSON)

Response:

{
  "id": 1,
  "summary": "Document summary...",
  "keywords": ["keyword1", "keyword2", "keyword3"],
  "quiz": [
    {
      "q": "Question text?",
      "options": ["A", "B", "C", "D"],
      "answer_index": 0
    }
  ]
}

GET /api/health

Health check endpoint.

Response:

{
  "status": "healthy",
  "service": "SmartNotes"
}

Deployment

Heroku

  1. Create a new Heroku app:
heroku create your-app-name
  1. Deploy:
git push heroku main
  1. Set environment variables:
heroku config:set LLM_API_KEY=your_key_here

Docker

docker build -t smartnotes .
docker run -p 5000:5000 -e LLM_API_KEY=your_key smartnotes

Project Structure

smartnotes/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py           # Flask application entry point
β”‚   β”œβ”€β”€ api.py            # API endpoints
β”‚   β”œβ”€β”€ models.py         # Data models
β”‚   β”œβ”€β”€ db.py             # Database layer
β”‚   └── services/
β”‚       β”œβ”€β”€ llm_client.py    # LLM integration
β”‚       β”œβ”€β”€ pdf_parser.py    # PDF processing
β”‚       └── summarizer.py    # Text processing
β”œβ”€β”€ templates/
β”‚   └── index.html        # Frontend HTML
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ app.js           # Frontend JavaScript
β”‚   └── styles.css       # Styles
β”œβ”€β”€ tests/               # Test suite
β”œβ”€β”€ .kiro/              # Kiro AI workflows
└── docs/               # Documentation

Configuration

Environment variables (see .env.example):

  • LLM_API_KEY: Your LLM API key
  • LLM_API_URL: LLM API endpoint
  • SECRET_KEY: Flask secret key
  • DATABASE_PATH: SQLite database path
  • FLASK_DEBUG: Enable debug mode
  • HOST: Server host (default: 0.0.0.0)
  • PORT: Server port (default: 5000)

How Kiro Helped

This project was built with assistance from Kiro AI. Here's exactly what Kiro generated:

1. Project Structure & Setup

  • βœ… Complete directory structure (app/, tests/, docs/, .kiro/)
  • βœ… Configuration files (requirements.txt, .env.example, Procfile)
  • βœ… Git configuration (.gitignore with .kiro/ included)

2. Backend Development

  • βœ… Flask application with REST API (app/main.py, app/api.py)
  • βœ… Service layer abstraction (services/llm_client.py, pdf_parser.py, summarizer.py)
  • βœ… Database layer with SQLite (app/db.py, app/models.py)
  • βœ… Error handling and logging throughout
  • βœ… Environment variable configuration

3. Frontend Development

  • βœ… Single-page application (templates/index.html)
  • βœ… Responsive CSS with modern gradient design (static/styles.css)
  • βœ… Interactive JavaScript (static/app.js)
  • βœ… Tab-based interface and quiz functionality

4. Testing Infrastructure

  • βœ… Comprehensive pytest test suite (tests/test_*.py)
  • βœ… Mocked external dependencies (LLM, PDF parsing)
  • βœ… Test fixtures and sample data
  • βœ… Cross-platform compatibility

5. AutoNotes Automation

  • βœ… Batch processing script (scripts/auto_notes.py)
  • βœ… Demo automation (scripts/run_demo.sh)
  • βœ… HTML index generation
  • βœ… Organized output structure
  • βœ… Tests for AutoNotes (tests/test_auto_notes.py)

6. Documentation

  • βœ… Main README with installation and usage
  • βœ… Deployment guide (Heroku, AWS, Docker)
  • βœ… Git commands and workflow
  • βœ… AWS Builder Center blog drafts (2 posts)
  • βœ… Demo recording instructions
  • βœ… Troubleshooting guides

7. Kiro Workflows

  • βœ… Workflow definition (.kiro/kiro.json) with 8 steps
  • βœ… Task prompts for regeneration (4 prompt files)
  • βœ… Kiro usage documentation (.kiro/README_kiro.md)

Total: 40+ files, ~3,000+ lines of production-ready code, all generated with Kiro assistance.

See .kiro/README_kiro.md for detailed Kiro workflow documentation.

License

MIT License - see LICENSE file for details

Contributing

Contributions welcome! Please open an issue or submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages