Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AllenGao6/Briefly2.0

Repository files navigation

Briefly 2.0

AI-powered learning platform that transforms your videos, audio, and text into summaries, transcripts, quizzes, and interactive learning experiences.

Features

  • AI Transcription: Automatically transcribe videos and audio using OpenAI Whisper
  • Smart Summarization: Get concise summaries with key bullet points powered by GPT-4
  • Quiz Generation: Auto-generate quizzes from your content
  • Interactive Q&A: Ask questions about your content and get instant answers
  • Collection Management: Organize your media into collections
  • Multi-format Support: Videos, audio files, text, and YouTube URLs

Tech Stack

Backend

  • Framework: FastAPI (Python 3.11+)
  • Database: PostgreSQL with SQLAlchemy 2.0 (async)
  • Object Storage: MinIO (S3-compatible)
  • AI: OpenAI GPT-4 & Whisper API
  • Package Manager: uv

Frontend

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS + shadcn/ui
  • State Management: TanStack Query + Zustand

Infrastructure

  • Containerization: Docker Compose
  • Database: PostgreSQL 16
  • Storage: MinIO

Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 20+
  • Python 3.11+
  • uv (Python package manager)

Development Setup

  1. Clone the repository

    git clone https://github.com/yourusername/Briefly2.0.git
    cd Briefly2.0
  2. Set up environment variables

    # Copy example env file
    cp .env.example .env
    
    # Edit .env and add your OpenAI API key
    OPENAI_API_KEY=your-api-key-here
  3. Start infrastructure services

    make dev
    # This starts PostgreSQL and MinIO
  4. Install dependencies and start backend

    # In a new terminal
    cd backend
    uv sync
    make dev-backend
  5. Start frontend

    # In another terminal
    cd frontend
    npm install
    npm run dev
  6. Access the application

Using Docker Compose (Full Stack)

# Start all services
docker compose up -d

# View logs
docker compose logs -f

# Stop services
docker compose down

Project Structure

briefly/
├── backend/
│   ├── app/
│   │   ├── api/routes/      # API endpoints
│   │   ├── core/            # Config, database, storage
│   │   ├── models/          # SQLAlchemy models
│   │   └── schemas/         # Pydantic schemas
│   ├── alembic/             # Database migrations
│   ├── pyproject.toml       # Python dependencies (uv)
│   └── Dockerfile
├── frontend/
│   ├── src/
│   │   ├── app/             # Next.js pages
│   │   ├── components/      # React components
│   │   ├── hooks/           # Custom hooks
│   │   └── lib/             # Utilities & API client
│   ├── package.json
│   └── Dockerfile
├── docker-compose.yml
├── Makefile
└── README.md

API Endpoints

Endpoint Method Description
/api/collections GET/POST List/Create collections
/api/collections/{id} GET/PUT/DELETE Collection CRUD
/api/media GET/POST List/Upload media
/api/media/{id} GET/PUT/DELETE Media CRUD
/api/ai/media/{id}/transcribe POST Transcribe media
/api/ai/media/{id}/summarize POST Generate summary
/api/ai/media/{id}/quiz POST Generate quiz
/api/ai/media/{id}/chat POST Q&A on content

Environment Variables

# Database
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/briefly

# MinIO
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_BUCKET_NAME=briefly-media

# OpenAI
OPENAI_API_KEY=your-api-key

# Backend
SECRET_KEY=your-secret-key
BACKEND_CORS_ORIGINS=["http://localhost:3000"]

# Frontend
NEXT_PUBLIC_API_URL=http://localhost:8000

Development Commands

# Start services
make dev              # Start PostgreSQL & MinIO
make dev-backend      # Start backend with hot reload
make dev-frontend     # Start frontend dev server

# Database
make migrate          # Run migrations
make migrate-create   # Create new migration

# Docker
make up               # Start all containers
make down             # Stop containers
make logs             # View logs
make clean            # Remove containers and volumes

License

MIT License - see LICENSE for details.


Legacy Version

The original Django + React version (2021) is preserved in the Briefly/ directory for reference.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5