Skip to content

shivammmmpatel/SnapCast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Ή SnapCast

Next-Generation Video Sharing Platform

Create β€’ Record β€’ Share β€’ Discover

Next.js TypeScript TailwindCSS PostgreSQL Vercel

Live Demo β€’ Report Bug β€’ Request Feature


🌟 Overview

SnapCast is a modern, full-stack video sharing platform that revolutionizes how you create, share, and discover video content. Built with cutting-edge technologies and designed for the modern web, SnapCast offers a seamless experience for both content creators and viewers.

🎯 What Makes SnapCast Special?

  • πŸŽ₯ Built-in Screen Recording - Capture and share your screen instantly
  • ⚑ Lightning Fast - Powered by Next.js 15 with Turbopack
  • πŸ”’ Enterprise Security - Arcjet protection with rate limiting and bot detection
  • 🌍 Global CDN - Fast video delivery worldwide via Bunny CDN
  • πŸ“± Fully Responsive - Perfect experience on all devices
  • 🎨 Modern UI/UX - Intuitive design with custom Satoshi font

✨ Features

πŸŽ₯ Video Management

  • Upload & Share - Upload videos with custom thumbnails, titles, and descriptions
  • Screen Recording - Built-in screen recorder with one-click capture
  • Video Player - Custom player with advanced controls and playback options
  • Auto Thumbnails - Automatic thumbnail generation from video content
  • Privacy Controls - Public or private video visibility settings
  • View Analytics - Track video views and engagement metrics

πŸ” Authentication & Security

  • Google OAuth - Secure sign-in with Google accounts
  • Session Management - Persistent sessions with Better Auth
  • Rate Limiting - Arcjet-powered API protection
  • Bot Detection - Intelligent bot blocking and CAPTCHA
  • CSRF Protection - Built-in security against attacks
  • Data Encryption - Secure database with PostgreSQL

🎨 User Experience

  • Modern UI - Clean, intuitive interface with Tailwind CSS
  • Responsive Design - Perfect on desktop, tablet, and mobile
  • Custom Fonts - Premium Satoshi font family
  • Search & Filter - Advanced search with multiple filters
  • Pagination - Smooth navigation through video library
  • User Profiles - Personalized profiles with avatars

πŸ› οΈ Tech Stack

Frontend

  • Next.js 15 - React framework with App Router
  • React 19 - Latest React features
  • TypeScript 5 - Type-safe development
  • Tailwind CSS 4 - Utility-first styling
  • Custom Components - Reusable component library

Backend

  • Next.js API Routes - Full-stack API
  • PostgreSQL - Neon serverless database
  • Drizzle ORM - Type-safe database queries
  • Better Auth - Modern authentication
  • Edge Runtime - Fast API responses

Infrastructure

  • Bunny CDN - Global video delivery
  • Arcjet - Security & rate limiting
  • Vercel - Serverless deployment
  • Neon DB - Serverless PostgreSQL

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have:

  • Node.js 18+ installed
  • PostgreSQL database (we recommend Neon)
  • Google OAuth credentials (Get them here)
  • Bunny CDN account for video storage (Sign up)
  • Arcjet API key for security (Get started)

Quick Start

  1. Clone the repository

    git clone https://github.com/shivaammmmpatel/SnapCast.git
    cd SnapCast
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env file in the root directory:

    # Base URL
    NEXT_PUBLIC_BASE_URL=http://localhost:3000
    
    # Better Auth
    BETTER_AUTH_SECRET=your_random_secret_here
    BETTER_AUTH_URL=http://localhost:3000
    
    # Google OAuth
    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret
    
    # Neon Database
    DATABASE_URL=postgresql://user:password@host/database
    
    # Bunny CDN
    BUNNY_STORAGE_ACCESS_KEY=your_storage_key
    BUNNY_LIBRARY_ID=your_library_id
    BUNNY_STREAM_ACCESS_KEY=your_stream_key
    
    # Arcjet Security
    ARCJET_API_KEY=your_arcjet_key
  4. Set up the database

    npm run db:push
  5. Start the development server

    npm run dev
  6. Open your browser

    Navigate to http://localhost:3000


οΏ½ Project Structure

SnapCast/
β”œβ”€β”€ app/                      # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/              # Authentication pages
β”‚   β”‚   └── sign-in/         # Sign-in page
β”‚   β”œβ”€β”€ (root)/              # Main application
β”‚   β”‚   β”œβ”€β”€ page.tsx         # Home/Dashboard
β”‚   β”‚   β”œβ”€β”€ upload/          # Video upload
β”‚   β”‚   β”œβ”€β”€ profile/         # User profiles
β”‚   β”‚   └── video/           # Video player
β”‚   β”œβ”€β”€ api/                 # API routes
β”‚   β”‚   └── auth/            # Better Auth endpoints
β”‚   └── globals.css          # Global styles
β”œβ”€β”€ components/              # React components
β”‚   β”œβ”€β”€ header.tsx           # Navigation header
β”‚   β”œβ”€β”€ VideoCard.tsx        # Video thumbnail card
β”‚   β”œβ”€β”€ VideoPlayer.tsx      # Custom video player
β”‚   β”œβ”€β”€ RecordScreen.tsx     # Screen recorder
β”‚   └── ...                  # Other components
β”œβ”€β”€ lib/                     # Utilities & configs
β”‚   β”œβ”€β”€ actions/             # Server actions
β”‚   β”‚   └── video.ts         # Video CRUD operations
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”œβ”€β”€ auth.ts              # Better Auth config
β”‚   β”œβ”€β”€ auth-client.ts       # Auth client setup
β”‚   └── utils.ts             # Helper functions
β”œβ”€β”€ drizzle/                 # Database layer
β”‚   β”œβ”€β”€ db.ts                # Database connection
β”‚   β”œβ”€β”€ schema-postgres.ts   # PostgreSQL schema
β”‚   └── migrations/          # DB migrations
β”œβ”€β”€ public/                  # Static assets
β”‚   └── assets/              # Images, icons, fonts
β”œβ”€β”€ fonts/                   # Custom Satoshi fonts
└── scripts/                 # Utility scripts

🎯 Key Workflows

Upload a Video

  1. Click "Upload" in the navigation
  2. Choose "Record Screen" or "Upload File"
  3. Add title, description, and thumbnail
  4. Set visibility (Public/Private)
  5. Click "Upload" to publish

Record Your Screen

  1. Navigate to Upload page
  2. Click "Record Screen"
  3. Select screen/window to record
  4. Click Start Recording
  5. Stop when done and proceed to upload

Manage Videos

  • View all videos on the Home page
  • Filter by newest, oldest, or most viewed
  • Search videos by title
  • Click on a video to watch
  • Access your videos from your Profile

πŸ”§ Available Scripts

# Development
npm run dev              # Start dev server with Turbopack
npm run build            # Build for production
npm run start            # Start production server
npm run lint             # Run ESLint

# Database
npm run db:push          # Push schema changes to database
npm run db:studio        # Open Drizzle Studio (DB GUI)
npm run db:generate      # Generate migrations
npm run db:migrate       # Run migrations

# Utilities
npm run seed             # Seed database with sample data

🚒 Deployment

Deploy to Vercel (Recommended)

  1. Fork this repository to your GitHub account

  2. Import to Vercel

    • Go to Vercel
    • Import your forked repository
    • Vercel will auto-detect Next.js
  3. Set Environment Variables

    Add all required environment variables in Vercel dashboard:

    • BETTER_AUTH_URL = https://your-domain.vercel.app
    • NEXT_PUBLIC_BASE_URL = https://your-domain.vercel.app
    • DATABASE_URL = Your Neon database URL
    • Add all other variables from .env
  4. Update Google OAuth

    Add your Vercel domain to Google OAuth:

    • Authorized JavaScript origins: https://your-domain.vercel.app
    • Authorized redirect URIs: https://your-domain.vercel.app/api/auth/callback/google
  5. Deploy!

    Vercel will automatically deploy your app

Environment Variables Checklist

Make sure these are set in your Vercel project:

  • βœ… BETTER_AUTH_URL
  • βœ… BETTER_AUTH_SECRET
  • βœ… NEXT_PUBLIC_BASE_URL
  • βœ… DATABASE_URL
  • βœ… GOOGLE_CLIENT_ID
  • βœ… GOOGLE_CLIENT_SECRET
  • βœ… BUNNY_STORAGE_ACCESS_KEY
  • βœ… BUNNY_LIBRARY_ID
  • βœ… BUNNY_STREAM_ACCESS_KEY
  • βœ… ARCJET_API_KEY

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

How to Contribute

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

Development Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

Areas We Need Help

  • οΏ½ Bug fixes and improvements
  • πŸ“ Documentation updates
  • 🎨 UI/UX enhancements
  • πŸ§ͺ Test coverage
  • 🌐 Internationalization (i18n)
  • β™Ώ Accessibility improvements

πŸ“ License

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


πŸ™ Acknowledgments

Special thanks to the amazing open-source projects that made SnapCast possible:


πŸ“§ Contact & Support


⭐ Show Your Support

If you find SnapCast useful, please consider giving it a star on GitHub! It helps the project grow and motivates us to keep improving.


Made with ❀️ by the SnapCast Team

Website β€’ GitHub