A comprehensive AI-powered learning platform that converts PDF documents and YouTube videos into interactive flashcards and summaries for enhanced learning.
- Upload PDF documents and automatically generate flashcards
- AI-powered content extraction and question generation
- Interactive flashcard interface for spaced repetition learning
- Extract transcripts from YouTube videos
- Generate flashcards from video content with timestamps
- Support for multiple languages and auto-generated captions
- Organize flashcards into study decks
- Save cards from different sources into unified decks
- Track learning progress and performance
- Generate citation-backed summaries from source materials
- Interactive summaries with source references
- Support for both PDF and YouTube content
- FastAPI - Modern Python web framework
- Celery - Distributed task queue for background processing
- Redis - Message broker and caching
- SQLAlchemy - Database ORM
- OpenAI API - AI content generation
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Modern UI components
- Docker - Containerized deployment
- Docker Compose - Multi-service orchestration
- Docker and Docker Compose
- OpenAI API key
-
Clone the repository
git clone git@github.com:first-order-coder/Second-Brain.git cd Second-Brain -
Set up environment variables
# Create .env file in the project root echo "OPENAI_API_KEY=your_openai_api_key_here" > .env
-
Start the application
docker-compose up -d
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Navigate to the main page
- Upload a PDF document using the file upload interface
- Wait for processing to complete
- Review and study the generated flashcards
- Optionally save cards to a deck for future study
- Paste a YouTube video URL in the YouTube section
- Select language preferences for transcript extraction
- Generate flashcards from the video content
- Review flashcards with timestamps and evidence
- Save cards to a deck for organized study
- Create and manage study decks
- Add cards from different sources to the same deck
- Use the deck interface for focused study sessions
- Track progress and performance over time
├── backend/ # FastAPI backend application
│ ├── routes/ # API route handlers
│ ├── services/ # Business logic services
│ ├── models.py # Database models
│ ├── main.py # FastAPI application entry point
│ └── worker_tasks.py # Celery background tasks
├── frontend/ # Next.js frontend application
│ ├── app/ # Next.js App Router pages and API routes
│ ├── components/ # React components
│ ├── lib/ # Utility functions and configurations
│ └── types.ts # TypeScript type definitions
├── docker-compose.yml # Docker services configuration
└── README.md # This file
-
Backend Development
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt uvicorn main:app --reload --host 0.0.0.0 --port 8000
-
Frontend Development
cd frontend npm install npm run dev -
Background Worker
cd backend celery -A worker_tasks worker --loglevel=info
OPENAI_API_KEY=your_openai_api_key_here
REDIS_URL=redis://localhost:6379/0NEXT_PUBLIC_API_URL=http://localhost:8000
ENABLE_DEBUG_ENDPOINTS=false
NEXT_PUBLIC_FEATURE_SUMMARY_CITATIONS=trueThe backend provides comprehensive API documentation available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
POST /upload-pdf- Upload PDF for processingGET /flashcards/{pdf_id}- Retrieve generated flashcardsPOST /youtube/flashcards- Generate flashcards from YouTube videoGET /youtube/tracks- Get available transcript tracksGET /decks- List all study decksPOST /decks- Create new deck
cd backend
python -m pytestcd frontend
npm test-
Update environment variables for production
# Update docker-compose.prod.yml with production settings docker-compose -f docker-compose.prod.yml up -d -
Configure reverse proxy (nginx)
server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:3000; } location /api { proxy_pass http://localhost:8000; } }
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the AI capabilities
- The open-source community for the amazing tools and libraries
- Contributors and users who help improve this platform
For support, email support@secondbrain.app or create an issue in the GitHub repository.
Made with ❤️ for learners everywhere