A Ruby Sinatra web application that helps organize Google Keep notes by automatically splitting them into categorized sub-notes using AI, with optional Google Tasks integration for seamless task management.
- AI-Powered Note Splitting: Uses LLM to intelligently split large Keep notes into focused sub-notes
- Smart Categorization: Automatically categorizes sub-notes by topic (TODO, Projects, Shopping, etc.)
- Interactive Organization: Drag & drop interface for recategorizing and managing sub-notes
- Google Tasks Integration: Automatically creates Google Tasks from organized notes (optional)
- Flexible Saving: Export organized notes to YAML files for backup and reference
- Ruby 3.0+ installed on your system
- Bundler gem (
gem install bundler) - An Anthropic API key (for LLM functionality)
-
Clone the repository
git clone <repository-url> cd keep-organizer
-
Install dependencies
bundle install
-
Environment configuration Create a
.envfile in the project root:touch .env
Add your Anthropic API key to the
.envfile:ANTHROPIC_API_KEY=your_api_key_hereGet your API key from Anthropic Console
-
Google Tasks Integration (Optional) To enable automatic Google Tasks creation:
a. Create Google Cloud Project:
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the Google Tasks API
b. Setup OAuth2 Credentials:
- Go to "Credentials" in the Google Cloud Console
- Create "OAuth 2.0 Client ID" credentials
- Set application type to "Desktop application"
- Download the credentials JSON file
c. Install Credentials:
- Rename the downloaded file to
secret.json - Place it in the project root directory
- The first run will require OAuth2 authentication in your browser
d. Task List Mapping:
- Notes categorized as "Todo" go to your default Google Tasks list
- Other categories attempt to match existing task list names
- Unmatched categories fall back to the default list
-
Verify directories The
testcases/directory should already exist for saving organized notes.
Production mode (with LLM):
ruby app.rbDevelopment mode (mock LLM, no API calls):
ruby app.rb --mockLLMThe app will start on http://localhost:4567
- Input: Paste your Google Keep note content into the text area
- Process: Click "Process Note" to split and categorize using AI
- Organize: Review and edit the categorized sub-notes using:
- Drag & drop to move notes between categories
- Split buttons to break up multi-line notes
- Delete buttons to remove unwanted notes
- Add buttons to create new notes in any category
- Save: Click "Save to YAML" to:
- Export organized notes to YAML files in
testcases/directory - Automatically create Google Tasks (if configured)
- Get confirmation of successful task creation
- Export organized notes to YAML files in
- Use
--mockLLMflag to avoid API costs during development - Mock mode splits notes line-by-line and categorizes everything as TODO
- The app uses Sinatra with vanilla JavaScript frontend
The project uses RSpec for testing Ruby code.
Install test dependencies:
bundle installRun all tests:
# Run all tests together
bundle exec rspecCode linting:
# Check Ruby code style and potential issues
bundle exec rubocop
# Auto-fix correctable issues
bundle exec rubocop --autocorrectTest structure:
spec/unit/- Unit tests for all Ruby componentsapp_index_spec.rb- Tests for index route (GET /)app_process_spec.rb- Tests for process route (POST /process) including both LLM and mock modesapp_save_spec.rb- Tests for save route (POST /save) with filesystem mockingllm_spec.rb- Tests for LLMService class with comprehensive API mocking
spec/integration/- End-to-end integration testsindex_page_spec.rb- JavaScript testing with Selenium Chrome headless driver for complete workflow:- AJAX form submission and DOM updates
- Add note button functionality
- Drag and drop between categories
- Textarea drag prevention (preserves text selection)
- Split button appearance and functionality for multiline notes
- Split button logic for blank lines (buttons hidden when next line is blank)
- Delete button functionality (with confirmation for non-empty notes)
Test Safety:
- All tests remove the
ANTHROPIC_API_KEYenvironment variable to prevent real API calls - External HTTP requests are blocked using WebMock for unit tests only (doesn't interfere with integration tests)
- LLM service calls are mocked to avoid costs and ensure reliable testing
- Filesystem operations are mocked to prevent writing test files to disk
- Mock LLM mode testing uses test-specific app subclasses for proper isolation
- Integration tests use Selenium Chrome headless driver and can run alongside unit tests