mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 11:24:43 +00:00
docs: refine documentation to be user-oriented and remove database jargon
This commit is contained in:
@@ -1,67 +1,38 @@
|
||||
---
|
||||
title: Overview
|
||||
description: Learn about Shumai, a modern AI agent and media processing platform for creative work.
|
||||
description: Learn about Shumai, a modern collaboration and media review platform.
|
||||
---
|
||||
|
||||
## What is Shumai?
|
||||
|
||||
**Shumai** is a highly modular, self-hosted media collaboration platform and AI agent playground. It allows teams to securely store, organize, and review creative assets (video, audio, images, etc.) while leveraging advanced AI capabilities to automate metadata tagging, perform semantic visual searches, and run sandboxed automation scripts.
|
||||
**Shumai** is a self-hosted media collaboration platform designed for creative teams, video editors, designers, and clients. It provides a centralized workspace where you can upload, organize, and review assets (video, audio, images, and documents) in real-time. With built-in AI capabilities and background transcoding, Shumai helps streamline asset organization and feedback workflows.
|
||||
|
||||

|
||||

|
||||
_Placeholder: Dashboard view showing the file explorer, active projects, and sidebar options._
|
||||
|
||||
---
|
||||
|
||||
## High-Level Features
|
||||
## Core Features
|
||||
|
||||
- **S3-Compatible & Local FS Storage**: Flexibly store creative assets locally or connect directly to standard S3-compatible providers (AWS S3, Cloudflare R2, MinIO, etc.).
|
||||
- **Media Commenting & Drawing**: Leave frame-level and timestamped feedback with sketch overlays on image and video assets.
|
||||
- **Version Stacking**: Version control for assets by stacking multiple file revisions together.
|
||||
- **AI-Powered Metadata & Search**: Automatically analyze files using Gemini to populate metadata fields, and search them visually or semantically via vector databases.
|
||||
- **Custom Agent Skills**: Write scripts to automate repetitive workflow actions inside secure sandboxed environments.
|
||||
- **Production-Ready Media Transcoding**: Offload heavy media processing workloads using distributed workers.
|
||||
- **Secure Storage**: Host your creative assets locally on your server or connect directly to any S3-compatible cloud storage provider (like AWS S3, Cloudflare R2, or MinIO).
|
||||
- **Media Commenting & Drawing**: Speed up review cycles with frame-level comments and drawing tools that let you sketch directly onto video frames or images.
|
||||
- **Version Control**: Stack multiple versions of the same file into a single entry to keep your workspace organized and track revision history.
|
||||
- **AI-Powered Tags & Search**: Automatically tag your files on upload using Google Gemini, and find assets based on visual or conceptual meaning.
|
||||
- **Custom Automations**: Build tailored background workflows using custom scripts to automate repetitive team actions.
|
||||
- **Proxy Transcoding**: Automatically convert heavy camera and design files in the background into web-friendly streaming formats for smooth playback.
|
||||
|
||||
---
|
||||
|
||||
## Architectural Layout
|
||||
## Deployment Scales
|
||||
|
||||
Shumai is developed as a modern, strictly decoupled monorepo managed with **Bun Workspaces**. Its architecture ensures clear separations of concerns across the following layers:
|
||||
Depending on your team size and production volume, Shumai can be configured to run in one of two modes:
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
WebUI[WebUI: packages/webui - React & Tailwind] --> API[API Layer: packages/api - Hono]
|
||||
API --> Core[Core Service Layer: packages/core - Business Logic]
|
||||
Core --> DB[Database Layer: packages/db - Prisma]
|
||||
Core --> DTOs[DTO Layer: packages/dtos - Shared Schemas]
|
||||
Core --> Workers[Workers: Agent/Transcode Workflows]
|
||||
```
|
||||
### 1. Single-Server Deployment (Default)
|
||||
|
||||
### The Monorepo Packages
|
||||
Ideal for small teams, local development, or low-volume workflows. In this setup, the main web server, database, and background tasks (like transcoding and AI tagging) all run on a single machine.
|
||||
|
||||
1. **WebUI (`packages/webui`)**: The user interface. Built on React and styled with Tailwind CSS and Shadcn UI.
|
||||
2. **API (`packages/api`)**: The HTTP server. Built on Hono and Bun. Acts as the entrypoint for all frontend requests.
|
||||
3. **Core (`packages/core`)**: The business logic and services layer. Interacts with the database, S3 storage, and external providers.
|
||||
4. **Database (`packages/db`)**: Holds the database schema, Prisma client generation, and migrations (using PostgreSQL with `pgvector`).
|
||||
5. **DTOs (`packages/dtos`)**: Shared data transfer object definitions and Zod schemas, guaranteeing end-to-end type safety between the frontend and backend.
|
||||
6. **Workers**: Specialized packages for running background operations:
|
||||
- `@shumai/workflow-core`: Common workflow engine logic.
|
||||
- `@shumai/agent`: AI agent workflows and activities.
|
||||
- `@shumai/transcode`: Media processing workflows and activities.
|
||||
### 2. High-Scale Distributed Deployment
|
||||
|
||||
---
|
||||
Recommended for production environments with high-volume video uploads. In this setup, background tasks are managed via a centralized queue (Temporal). This allows you to offload heavy workloads to specialized worker machines (for example, putting video transcoding tasks on high-CPU/GPU machines and AI agents on separate sandboxed environments).
|
||||
|
||||
## Dual Workflow Engines
|
||||
|
||||
To cater to different environments, Shumai implements a custom background execution layer that supports two modes:
|
||||
|
||||
### 1. Local Executor (Default)
|
||||
|
||||
In local development or lightweight self-hosted setups, Shumai uses a polling-based engine. It continuously polls the database for pending background tasks (such as metadata autofill, embedding generation, or transcoding) and executes them directly on the main application container.
|
||||
|
||||
### 2. Temporal Executor (Production-Ready)
|
||||
|
||||
For heavy production workflows, Shumai decouples background task execution entirely using **Temporal**.
|
||||
|
||||
- **Orchestration**: The main Hono application registers tasks to the Temporal Cluster.
|
||||
- **Specialized Workers**: Separate worker machines run `@shumai/transcode` and `@shumai/agent` processes. They poll tasks from the Temporal queue and execute them independently.
|
||||
- **S3 Requirement**: In Temporal mode, **you must use an S3-compatible storage backend**. Because workers run on separate machines, they cannot access a local filesystem to retrieve or write files.
|
||||
_Note: S3-compatible cloud storage is required for distributed deployments so that all workers can access the uploaded files._
|
||||
|
||||
@@ -1,55 +1,48 @@
|
||||
---
|
||||
title: Quickstart
|
||||
description: Get Shumai up and running in minutes using Docker, NPM, or from source.
|
||||
description: Get Shumai up and running using Docker, NPM, or from source.
|
||||
---
|
||||
|
||||
We support three installation paths depending on your needs. For most users, **Docker Compose** is the fastest and easiest way to run Shumai.
|
||||
We support three installation options. For most administrators, **Docker Compose** is the fastest and easiest way to deploy Shumai.
|
||||
|
||||
---
|
||||
|
||||
## Option 1: Docker Compose (Recommended)
|
||||
|
||||
Docker Compose configures and runs all required services (web application, PostgreSQL with pgvector, and S3 local storage) automatically.
|
||||
Docker Compose automatically configures and spins up all required services (the web application, a database, and local storage).
|
||||
|
||||
### Local Stack
|
||||
|
||||
A lightweight setup to run the core API and frontend using pre-built images.
|
||||
|
||||
1. Download the docker-compose configuration:
|
||||
```bash
|
||||
curl -o docker-compose.yaml https://raw.githubusercontent.com/shumaiOne/shumai/main/docker-compose/local/docker-compose.yaml
|
||||
```
|
||||
2. Spin up the containers:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
3. Open your browser and navigate to **`http://localhost:3000`** to access the Shumai Web UI.
|
||||
|
||||
### Temporal Stack (Production-Ready / Development)
|
||||
|
||||
For details on running the full Temporal worker orchestration stack, refer to the [Docker Setup Guide](/getting-started/docker).
|
||||
1. **Download the Configuration**:
|
||||
```bash
|
||||
curl -o docker-compose.yaml https://raw.githubusercontent.com/shumaiOne/shumai/main/docker-compose/local/docker-compose.yaml
|
||||
```
|
||||
2. **Start the Services**:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
3. **Access the Dashboard**:
|
||||
Open your browser and navigate to **`http://localhost:3000`** to access the Shumai Web UI.
|
||||
|
||||
---
|
||||
|
||||
## Option 2: Install from NPM
|
||||
## Option 2: Install via NPM
|
||||
|
||||
You can run Shumai as a global npm package. This requires installing the system-level dependencies manually.
|
||||
You can run Shumai as a global service using the Node Package Manager (NPM).
|
||||
|
||||
### Prerequisites
|
||||
### System Prerequisites
|
||||
|
||||
1. **FFmpeg & FFprobe**: Required for media transcoding and metadata extraction.
|
||||
- **macOS**: `brew install ffmpeg`
|
||||
- **Linux**: `sudo apt-get install ffmpeg`
|
||||
2. **Sandbox Executable Dependencies**: Shumai runs AI agents inside secure, isolated sandboxes.
|
||||
- **macOS**: Requires `ripgrep` (`brew install ripgrep`).
|
||||
- **Linux**: Requires `bubblewrap`, `socat`, and `ripgrep` (`sudo apt-get install bubblewrap socat ripgrep`). On Ubuntu 24.04+, run:
|
||||
```bash
|
||||
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
```
|
||||
To handle media processing and security isolation, the host machine must have the following system utilities installed:
|
||||
|
||||
### Step-by-Step NPM Setup
|
||||
- **FFmpeg & FFprobe**: Required for video transcoding and metadata extraction.
|
||||
- _macOS_: `brew install ffmpeg`
|
||||
- _Linux (Ubuntu/Debian)_: `sudo apt-get install ffmpeg`
|
||||
- **Agent Sandbox Utilities**: Used to run custom automation scripts securely.
|
||||
- _macOS_: `brew install ripgrep`
|
||||
- _Linux (Ubuntu/Debian)_: `sudo apt-get install bubblewrap socat ripgrep`
|
||||
|
||||
1. **Start PostgreSQL with pgvector**:
|
||||
### Step-by-Step Setup
|
||||
|
||||
1. **Start a Database**:
|
||||
Shumai requires a PostgreSQL database with the `pgvector` extension. Start a database container:
|
||||
```bash
|
||||
docker run --name shumai_postgres \
|
||||
-e POSTGRES_USER=shumai \
|
||||
@@ -58,50 +51,52 @@ You can run Shumai as a global npm package. This requires installing the system-
|
||||
-p 5432:5432 \
|
||||
-d pgvector/pgvector:pg18
|
||||
```
|
||||
2. **Install Shumai globally**:
|
||||
2. **Install Shumai**:
|
||||
```bash
|
||||
npm install -g @shumai-one/shumai
|
||||
```
|
||||
3. **Configure Environment Variables**:
|
||||
Create a new directory and save a `.env` file inside it:
|
||||
Create a new directory, navigate into it, and create a `.env` file:
|
||||
```bash
|
||||
mkdir shumai && cd shumai
|
||||
```
|
||||
Create `.env`:
|
||||
Create a `.env` file with the following variables:
|
||||
```env
|
||||
DATABASE_URL=postgresql://shumai:shumai_password@localhost:5432/shumai_db?schema=public
|
||||
BETTER_AUTH_SECRET=your-random-32-byte-secret-key
|
||||
BETTER_AUTH_SECRET=your-random-32-character-secret-key
|
||||
STORAGE_BACKEND=local
|
||||
AWS_ENDPOINT_URL_S3=http://localhost:3000
|
||||
```
|
||||
4. **Run the application**:
|
||||
4. **Start Shumai**:
|
||||
```bash
|
||||
shumai
|
||||
```
|
||||
Access the UI at `http://localhost:3000`.
|
||||
Open your browser to `http://localhost:3000`.
|
||||
|
||||
---
|
||||
|
||||
## Option 3: Run from Source (For Developers)
|
||||
|
||||
Follow these steps to run Shumai locally for development:
|
||||
If you wish to run Shumai locally to customize the platform or contribute:
|
||||
|
||||
1. **Clone the Repository & Install Dependencies**:
|
||||
1. **Clone the Repository**:
|
||||
```bash
|
||||
git clone https://github.com/shumaiOne/shumai.git
|
||||
cd shumai
|
||||
```
|
||||
2. **Install Dependencies**:
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
2. **Start the Database**:
|
||||
Spin up a `pgvector` container as shown in the NPM option above.
|
||||
3. **Prepare Environment Variables**:
|
||||
Copy the environment variables template or create a `.env` file at the root of the workspace.
|
||||
4. **Run Database Migrations**:
|
||||
3. **Start a Database**:
|
||||
Launch a local database container (as described in the NPM section above).
|
||||
4. **Run Migrations**:
|
||||
Set up your `.env` file at the root, then apply database migrations:
|
||||
```bash
|
||||
bun run db:migrate
|
||||
```
|
||||
5. **Start the Development Server**:
|
||||
5. **Start the Dev Server**:
|
||||
```bash
|
||||
bun run dev
|
||||
```
|
||||
This launches the React frontend (running on port `3000`) and the Hono API backend simultaneously.
|
||||
This spins up the web server on port `3000` with hot-reloading active.
|
||||
|
||||
Reference in New Issue
Block a user