Skip to content

code-craka/streamvault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StreamVault

A modern, aesthetic live streaming platform with subscription-based monetization and enterprise-grade features.

πŸš€ Features

  • Live Streaming: Professional quality broadcasting with RTMP ingest and HLS delivery
  • VOD Management: Secure video-on-demand with signed URLs and content protection
  • Subscription Monetization: Tiered plans (Basic $9.99, Premium $19.99, Pro $29.99)
  • Real-time Engagement: Advanced chat system with AI moderation and custom emotes
  • AI Enhancement: Automated content processing, thumbnails, and recommendations
  • Enterprise Features: White-label customization, comprehensive APIs, and multi-tenancy

πŸ› οΈ Tech Stack

  • Framework: Next.js 15.0.1 with App Router
  • Language: TypeScript with 100% type coverage
  • Styling: Tailwind CSS v4 + shadcn/ui
  • Authentication: Clerk with OAuth (Google, GitHub, Discord)
  • Database: Firebase Firestore
  • Storage: Google Cloud Storage with signed URLs
  • Payments: Stripe with subscription management
  • Streaming: HLS.js with adaptive bitrate
  • AI: Content moderation and enhancement
  • Testing: Jest + Playwright

πŸ“ Project Structure

streamvault/
β”œβ”€β”€ app/                    # Next.js 15 App Router
β”‚   β”œβ”€β”€ (auth)/            # Authentication pages
β”‚   β”œβ”€β”€ (dashboard)/       # Protected dashboard routes
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   └── globals.css        # Global styles
β”œβ”€β”€ components/            # Reusable React components
β”‚   β”œβ”€β”€ ui/                # shadcn/ui components
β”‚   β”œβ”€β”€ auth/              # Authentication components
β”‚   β”œβ”€β”€ player/            # Video player components
β”‚   └── chat/              # Chat system components
β”œβ”€β”€ lib/                   # Utility functions and services
β”‚   β”œβ”€β”€ auth/              # Authentication utilities
β”‚   β”œβ”€β”€ streaming/         # Streaming services
β”‚   β”œβ”€β”€ storage/           # GCS and file management
β”‚   └── stripe/            # Payment processing
β”œβ”€β”€ types/                 # TypeScript type definitions
└── hooks/                 # Custom React hooks

🚦 Getting Started

Prerequisites

  • Node.js 18+
  • pnpm 8+
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/code-craka/streamvault.git
cd streamvault
  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp .env.example .env.local
# Fill in your actual values in .env.local
  1. Start the development server:
pnpm dev
  1. Open http://localhost:3000 in your browser.

πŸ“ Available Scripts

Development

pnpm dev          # Start development server
pnpm build        # Build for production
pnpm start        # Start production server
pnpm lint         # Lint code
pnpm format       # Format code with Prettier
pnpm type-check   # TypeScript type checking

Testing

pnpm test         # Run unit tests
pnpm test:watch   # Run tests in watch mode
pnpm test:coverage # Run tests with coverage
pnpm test:e2e     # Run E2E tests with Playwright

πŸ”§ Configuration

Environment Variables

Key environment variables (see .env.example for complete list):

# Core
NEXT_PUBLIC_APP_URL=http://localhost:3000
GCP_PROJECT_ID=your-project-id
GCS_BUCKET_NAME=your-bucket-name

# Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...

# Stripe
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...

# Firebase
FIREBASE_PROJECT_ID=your-firebase-project
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key

Git Hooks

The project uses Husky for git hooks:

  • pre-commit: Runs linting and type checking
  • commit-msg: Validates commit message format (conventional commits)

πŸ—οΈ Architecture

Core Services

  • Authentication: Clerk-based auth with role management
  • Streaming: RTMP ingest β†’ HLS transcoding β†’ CDN delivery
  • Storage: Google Cloud Storage with 15-minute signed URLs
  • Real-time: Firebase Firestore for chat and live updates
  • Payments: Stripe subscriptions with webhook handling
  • AI: Content moderation, thumbnails, and recommendations

Performance Targets

  • Page Load: LCP < 2.5s, FID < 100ms, CLS < 0.1
  • API Response: < 100ms for authenticated requests
  • Video Start: < 3 seconds for HLS initialization
  • Chat Delivery: < 500ms end-to-end
  • Uptime: 99.9% availability SLA

πŸ§ͺ Testing

Unit Tests

pnpm test

E2E Tests

pnpm test:e2e

Coverage Requirements

  • Minimum 80% code coverage
  • All critical paths must be tested
  • Integration tests for API endpoints

πŸš€ Deployment

Production Build

pnpm build
pnpm start

Environment Setup

  1. Configure production environment variables
  2. Set up Google Cloud Storage bucket
  3. Configure Stripe webhooks
  4. Set up Firebase project
  5. Configure Clerk production instance

πŸ“Š Monitoring

  • Performance: Core Web Vitals tracking
  • Errors: Automated error reporting
  • Analytics: User engagement metrics
  • Uptime: 99.9% availability monitoring

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'feat: add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Commit Convention

We use Conventional Commits:

  • feat: New features
  • fix: Bug fixes
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Test additions/changes
  • chore: Maintenance tasks

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Links


Author

Sayem Abdullah Rihan

Built with ❀️ by the TechSci Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published