Stream Flow is a cross-platform application designed for recording, managing, and sharing AI-powered video content. It integrates a native desktop recorder with a web-based dashboard, all connected by a real-time backend.
- Screen & Audio Recording: A native Electron application allows users to capture their screen and audio from various sources.
- AI-Powered Content Generation: Automatically generates video titles, descriptions, and summaries using Large Language Models (LLMs).
- Cloud Storage: All video recordings are securely uploaded to AWS S3 for storage and processing.
- Workspace Collaboration: Users can create workspaces, invite team members, manage permissions, and share video content.
- Real-time Notifications: Receive alerts when a user views a video for the first time.
- Modern UI: A responsive and accessible user interface for both web and desktop applications, featuring light and dark themes.
The project is organized as a monorepo with three distinct packages:
stream-flow/
│
├── frontend/ # Next.js web application (Dashboard, Video Management, AI Tools)
├── native/ # Electron desktop application (Screen/Audio Recording, Studio Controls)
├── server/ # Node.js backend (API, WebSocket Server, S3 Uploads, AI Processing)
└── README.md
- Node.js (v20 or newer recommended)
- Yarn, npm or bun package manager
- PostgreSQL database (local or hosted)
- AWS Account with:
- S3 bucket for video storage
- IAM user with S3 access permissions
- CloudFront distribution for video streaming
- Clerk account for authentication (https://clerk.com)
- OpenRouter API key for AI features (https://openrouter.ai)
- Gladia API key for transcription services (https://gladia.io)
- Optional: Wix developer account for integrations
git clone https://github.com/rit3sh-x/stream-flow.git
cd stream-flowInstall the dependencies for each package from the root directory.
# Frontend dependencies (Next.js)
cd frontend && bun install
# Native dependencies (Electron)
cd ../native && npm install
# Server dependencies (Node.js)
cd ../server && npm installAfter installing frontend dependencies, Prisma will automatically generate the client via the postinstall script.
Create a .env file in each package (frontend, native, server) using the provided .env.example files as templates.
The application uses PostgreSQL with Prisma ORM. After configuring your DATABASE_URL in the frontend .env file:
cd frontend
# Run migrations if you're setting up for production
npx prisma migrate dev
# If you want to explore your database
npx prisma studio-
frontend/.env:DATABASE_URL: PostgreSQL database connection stringNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: Your Clerk publishable keyCLERK_SECRET_KEY: Your Clerk secret key- Clerk redirect URLs:
NEXT_PUBLIC_CLERK_SIGN_IN_URL: "/sign-in"NEXT_PUBLIC_CLERK_SIGN_UP_URL: "/sign-up"NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL: "/callback"NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL: "/callback"
MAILER_EMAIL: Email address for sending notificationsMAILER_PASSWORD: Password for the email accountNEXT_PUBLIC_HOST_URL: Base URL for your frontend (e.g., "http://localhost:3000")WIX_OAUTH_KEY: Wix OAuth key if using Wix integrationNEXT_PUBLIC_CLOUD_FRONT_STREAM_URL: CloudFront URL for video streamingGLADIA_API_KEY: API key for Gladia (used for transcription)OPENROUTER_API_KEY: API key for OpenRouter (LLM access)INTERNAL_ELECTRON_APP_KEY: Secret key for secure communication with the Electron app
-
native/.env:VITE_APP_URL: URL for the Vite development server (e.g., "http://localhost:5173")VITE_DEV_SERVER_URL: URL for the development server (e.g., "http://localhost:5173")VITE_CLERK_PUBLISHABLE_KEY: Your Clerk publishable keyVITE_SOCKET_URL: WebSocket URL for the backend server (e.g., "http://localhost:5000")VITE_HOST_URL: Base URL for the frontend (e.g., "http://localhost:3000")INTERNAL_ELECTRON_APP_KEY: Same secret key as defined in frontend's .env
-
server/.env:OPENROUTER_API_KEY: API key for OpenRouterAWS_ACCESS_KEY_ID: Your AWS access keyAWS_SECRET_ACCESS_KEY: Your AWS secret keyAWS_REGION: AWS region for your S3 bucket (e.g., "us-east-1")AWS_BUCKET_NAME: Name of your S3 bucket for video storageNEXT_API_HOST: URL for the frontend's API (e.g., "http://localhost:3000")PORT: Port for the server to run on (e.g., 4000)
Important: Make sure the
INTERNAL_ELECTRON_APP_KEYis identical in both frontend and native environments to allow secure communication between them.
Each part of the application must be run in a separate terminal.
cd server
npm run devThis will start the Node.js server on port 5000 (or whatever port you specified in your .env file). The server handles WebSocket connections from the native app and manages uploads to AWS S3.
cd frontend
bun run devThis will start the Next.js development server on port 3000. Access the web dashboard by navigating to http://localhost:3000 in your browser.
cd native
npm run devThis will launch the Electron development environment with the recording application. The app includes the main widget, studio controls, and webcam view.
Note: All three applications must be running simultaneously for the full functionality of Stream Flow to work properly.
The application follows a specific flow for recording and processing video:
- Initiate Recording: The user starts a recording from the Electron app (
native). - Capture Media: The app captures screen and audio, controlled via a multi-window setup (main widget, studio controls, and a floating webcam view).
- Stream Chunks: Video data is captured in chunks and streamed in real-time to the Node.js backend (
server) via a Socket.io connection. - Assemble and Upload: The backend server receives the chunks, assembles them into a single
.webmvideo file, and uploads it directly to an AWS S3 bucket. - Trigger Processing: After a successful upload, the server makes an API call to the Next.js application's (
frontend) backend to notify it that a new video is ready for processing. - AI Enhancement: The Next.js backend can then trigger AI jobs to transcribe the video and generate metadata like titles and summaries.
- View and Manage: The processed video and its metadata become available for viewing and management in the user's web dashboard.
- Framework: Built with Next.js 15.3.5 and React 19.
- Authentication: Uses Clerk for user management and authentication.
- Data Management:
- Prisma 6.11.1 for database ORM with PostgreSQL
- @tanstack/react-query 5.81.5 for server state management
- Redux Toolkit for client state management
- UI Components:
- Shadcn UI component library
- Tailwind CSS 4 for styling
- Lucide React for icons
- React Hook Form with Zod validation
- AI Integration:
- OpenAI/OpenRouter for LLM capabilities
- Gladia for audio transcription
- Functionality:
- User dashboard and workspace management
- Video playback and management
- AI-powered content generation
- Collaborative workspaces
- Framework: An Electron application powered by:
- Vite as the build tool
- React for UI components
- Electron for desktop capabilities
- Architecture: Features a multi-window design:
electron/main.ts: The main Electron process, responsible for creating and managing windowsindex.htmlwithmain-app.tsx: The main widget for initiating recordingsstudio.htmlwithstudio-app.tsx: A separate window for recording controlswebcam.htmlwithwebcam-app.tsx: A floating, resizable window to display the webcam feed
- System Interaction:
- Uses Electron's
ipcMainanddesktopCapturerAPIs for screen/audio source capture - Custom hooks like
use-media-sources.tsanduse-studio-settings.tsto manage media configurations - Window state management for positioning and appearance
- Uses Electron's
- Real-time Communication:
- Socket.io client to stream video data to the server
- Secure communication with the frontend using the shared
INTERNAL_ELECTRON_APP_KEY
- Framework: A Node.js server built with:
- Express for API endpoints
- TypeScript for type safety
- Socket.io for real-time communication
- Media Processing:
- Handles video chunk assembly from the Electron client
- Processes recordings in the
recordings/directory - Manages video format conversion if needed
- Cloud Integration:
- AWS SDK for S3 bucket integration
- Secure file uploads with proper credentials
- Organized storage structure for user videos
- Workflow Orchestration:
- After upload completion, triggers frontend processing via API call to
NEXT_API_HOST - Coordinates with AI services for video analysis and transcription
- Handles cleanup of temporary files after processing
- After upload completion, triggers frontend processing via API call to
- Fork the repo and create your branch.
- Make your changes and add tests if needed.
- Submit a pull request.
MIT
-
Code Organization: Follow the established patterns in each package:
- Frontend: Group by features in
src/modules/, shared components insrc/components/ - Native: Keep window-specific logic separate between main widget, studio, and webcam
- Server: Maintain clean separation between WebSocket handling and file processing
- Frontend: Group by features in
-
Environment Variables: Never commit
.envfiles to the repository. Use the provided.env.examplefiles as templates. -
Prisma Workflow:
- Make schema changes in
frontend/prisma/schema.prisma - Run
npx prisma migrate dev --name your_change_descriptionto create migrations
- Make schema changes in
-
Database Connection Issues:
- Verify your PostgreSQL connection string in
DATABASE_URL - Ensure the database exists and user has proper permissions
- Run
npx prisma db pushto sync schema changes
- Verify your PostgreSQL connection string in
-
Socket Connection Failures:
- Check that server is running on the expected port
- Verify
VITE_SOCKET_URLin native's .env points to the correct server URL - Inspect browser console and server logs for connection errors
-
AWS S3 Upload Issues:
- Verify AWS credentials are correct
- Ensure the S3 bucket exists and has proper permissions
- Check server logs for any AWS SDK error messages
-
Electron Development:
- If windows don't appear, check the Electron logs for startup errors
- For webcam access issues, verify that proper permissions are granted to the app