This project provides a YouTube Transcript Summarizer, with a backend Flask API to process transcripts and an Electron-based frontend for managing API keys and submitting playlists or transcripts for summarization. The application supports different summarization actions (summarize, enrich, simplify) and integrates with Obsidian for note management.
- Electron Frontend: A user-friendly interface to manage API keys and submit requests to the backend.
- Flask Backend API: Processes YouTube playlists or transcripts and provides summaries.
- Database & Key Management: Stores API keys securely using SQLite and Keytar.
- Supports Summarization Options: Summarize, enrich, or simplify video transcripts.
- Obsidian Integration: Stores generated summaries in an Obsidian vault.
- Backend: Flask (Python)
- Frontend: Electron (JavaScript)
- Database: SQLite (for API keys)
- API Key Management: Keytar (secure storage of API keys)
- YouTube Transcript API: For fetching video transcripts
- Mistral AI: For summarizing and processing transcripts
- Obsidian: Optional integration for storing summaries locally
-
Backend:
- Python 3.x
- Flask
- Mistral AI Key
- YouTube API Key
- Obsidian Vault (if using Obsidian integration)
-
Frontend:
- Node.js
- Electron
- SQLite
- Keytar
git clone https://github.com/aprici7y/FOCUS.git
cd your-repo/backend
pip install -r requirements.txt
python main.py
The API will be available at http://localhost:5000
.
cd ../frontend
npm install
npm start
This will launch the Electron application for managing API keys and submitting requests.
- Flask API: Handles requests for summarizing YouTube playlists or transcripts.
- Endpoints:
/api/playlist_transcripts
: Summarizes a YouTube playlist./api/summarize
: Processes and stores summaries in Obsidian./api/process_transcript
: Processes and summarizes individual transcripts.
- Electron App: Provides a user interface to input playlists, manage API keys, and configure settings.
- SQLite & Keytar: For securely managing API keys locally.
- Main Files:
main.js
: Main Electron script that creates windows, handles database initialization, and processes API key management.preload.js
: Securely exposes specific APIs to the renderer process.index.html
: Frontend UI for interacting with the app.
- Key Storage: API keys are stored securely using Keytar and a SQLite database.
- Database: A SQLite database is used to keep track of key names and services.
- IPC Handlers:
save-api-keys
: Saves the API keys securely.get-api-keys
: Retrieves stored API keys from Keytar.submit-playlist
: Submits a playlist for summarization.submit-transcript
: Submits a transcript for summarization.
- Open the Electron app.
- Go to API Keys & Paths.
- Enter the API keys for YouTube, Mistral, and Obsidian (if applicable), and click Save Settings. The keys are securely stored using Keytar.
- Enter the YouTube playlist ID and select the action (
summarize
,enrich
, orsimplify
). - Click Submit to send the request to the backend.
- Summaries will be saved either in your Obsidian vault or processed and returned via the API.
- To run the backend API server, navigate to the backend directory and run
python app.py
. - You can modify API endpoints or integrate additional services as needed.
- For frontend development, modify the Electron app and run
npm start
to test changes. - You can add more features, such as advanced settings or integrations, by extending
main.js
orindex.html
.
Contributions are welcome! Please feel free to submit a pull request or open an issue if you encounter any bugs or have suggestions for new features.