File size: 5,322 Bytes
1ef8ad7
eec1aad
792ad00
 
 
1ef8ad7
 
 
 
792ad00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
title: CreatorStudio AI Backend Develop
emoji: πŸš€
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
---

# CreatorStudio AI Backend

CreatorStudio AI is a powerful, enterprise-grade AI content generation and study platform. It leverages state-of-the-art Large Language Models (LLMs) and cloud infrastructure to transform documents and media into a wide array of educational and creative content.

## πŸš€ Features

-   **πŸ” Robust Authentication**: Secure JWT-based authentication system with password hashing and user-scoped data access.
-   **πŸ“‚ Source Management**: Integrated AWS S3 file management for seamless document uploads, listing, and storage.
-   **🧠 Advanced RAG (Retrieval-Augmented Generation)**: Chat with your uploaded documents using Azure AI Search and OpenAI/Gemini, enabling high-precision context-aware interactions.
-   **πŸŽ™οΈ Podcast Generation**: Automatically transform text and documents into professional podcast scripts and audio segments.
-   **🎬 Video Generation**: Create engaging video summaries and slide-based videos from static content using MoviePy and FFmpeg.
-   **πŸ“ Interactive Study Tools**:
    -   **Flashcards**: AI-generated flashcards tailored to your source material.
    -   **Quizzes**: Customizable quizzes with multiple-choice questions, hints, and detailed explanations.
    -   **Mind Maps**: Visualize complex relationships with auto-generated Mermaid.js mind maps.
-   **πŸ“Š Smart Reports**: Generate structured, professional reports and summaries from various source materials.

## πŸ› οΈ Tech Stack

-   **Framework**: FastAPI (Python 3.x)
-   **Database**: SQLAlchemy ORM with support for relational databases (e.g., MSSQL/PostgreSQL).
-   **AI Infrastructure**: 
    -   **LLMs**: OpenAI GPT-4o, Google Gemini Pro.
    -   **RAG**: Azure AI Search, Azure OpenAI Embeddings.
-   **Cloud & Processing**: 
    -   **Storage**: AWS S3, Azure Blob Storage.
    -   **Media**: MoviePy, FFmpeg, Pydub for audio/video processing.
    -   **Documents**: PyPDF2, pdf2image, Pillow for comprehensive document handling.

## πŸ“ Project Structure

```text
CreatorStudio AI/
β”œβ”€β”€ api/                # FastAPI routers and endpoint logic
β”‚   β”œβ”€β”€ auth.py         # Authentication & User management
β”‚   β”œβ”€β”€ sources.py      # S3 Source file management
β”‚   β”œβ”€β”€ rag.py          # Azure RAG indexing and querying
β”‚   β”œβ”€β”€ podcast.py      # Podcast generation endpoints
β”‚   β”œβ”€β”€ flashcards.py   # Flashcard generation logic
β”‚   └── ...             # Quizzes, Mindmaps, Reports, Video Gen
β”œβ”€β”€ core/               # Core application configuration
β”‚   β”œβ”€β”€ config.py       # Pydantic settings & Environment management
β”‚   β”œβ”€β”€ database.py     # DB connection & Session management
β”‚   β”œβ”€β”€ prompts.py      # Centralized AI prompt templates
β”‚   └── security.py     # JWT & Password hashing utilities
β”œβ”€β”€ models/             # Data models
β”‚   β”œβ”€β”€ db_models.py    # SQLAlchemy database models (User, Source, RAG, etc.)
β”‚   └── schemas.py      # Pydantic request/response schemas for API
β”œβ”€β”€ services/           # Business logic & 3rd party integrations
β”‚   β”œβ”€β”€ s3_service.py   # AWS S3 integration
β”‚   β”œβ”€β”€ rag_service.py  # Azure AI Search & RAG logic
β”‚   β”œβ”€β”€ podcast_service.py # Podcast creation & script logic
β”‚   β”œβ”€β”€ video_generator_service.py # Video processing
β”‚   └── ...             # Specialized services for all features
β”œβ”€β”€ main.py             # Application entry point & Router inclusion
└── requirements.txt    # Project dependencies
```

## βš™οΈ Setup & Installation

1.  **Clone the repository**
2.  **Create a Virtual Environment**:
    ```bash
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    ```
3.  **Install Dependencies**:
    ```bash
    pip install -r requirements.txt
    ```
4.  **Configure Environment Variables**:
    Create a `.env` file in the root directory based on the following template:
    ```env
    # AWS Configuration
    AWS_ACCESS_KEY_ID=your_aws_key
    AWS_SECRET_ACCESS_KEY=your_aws_secret
    AWS_S3_BUCKET=your_bucket_name

    # Azure RAG & OpenAI
    AZURE_SEARCH_ENDPOINT=your_endpoint
    AZURE_SEARCH_KEY=your_search_key
    AZURE_OPENAI_API_KEY=your_openai_key
    AZURE_OPENAI_ENDPOINT=your_openai_endpoint

    # LLM Keys
    OPENAI_API_KEY=your_openai_key
    GEMINI_API_KEY=your_gemini_key

    # Database & Security
    DATABASE_URL=your_db_connection_string
    SECRET_KEY=your_jwt_secret_key
    ```
5.  **Run the Server**:
    ```bash
    python main.py
    ```
    The API will be available at `http://localhost:8000`. Access the interactive documentation at `http://localhost:8000/docs`.

## πŸ“– API Documentation

The backend provides a fully interactive Swagger UI at `/docs` for testing and exploration.

-   **Auth**: `/api/auth/register`, `/api/auth/login`
-   **Sources**: `/api/sources/upload`, `/api/sources/list`, `/api/sources/{id}`
-   **RAG**: `/api/rag/index`, `/api/rag/query`
-   **Content Generation**: `/api/podcast`, `/api/flashcards`, `/api/mindmaps`, `/api/quizzes`, `/api/reports`, `/api/video_generator`

---
Β© 2026 CreatorStudio AI Team. All rights reserved.