A modern, TikTok-style short-form video sharing platform built with the T3 Stack, featuring seamless video playback, social interactions, and a beautiful mobile-first UI.
- Automatic Infinite Scroll - Continuously loads more videos as you scroll (TikTok-style)
- Smart Autoplay - Videos play automatically (muted initially), unmuting seamlessly on interaction
- Seamless Audio - Scrolling or tapping anywhere enables audio for the entire session
- Auto-Play & Snap Scrolling - Videos auto-play as you scroll with instant navigation
- Double-Tap to Like - Intuitive gesture-based interactions
- Animated Reactions - Beautiful heart animations on like
- Expandable Descriptions - Click to expand long video descriptions
- Mobile-Optimized - Perfect viewport handling with
dvhunits - Centered Play/Pause - Large, centered controls on all devices
- Performance Optimized - Instant scroll to specific videos without triggering intermediate videos
- Popup Modals - Modern modal-based login/signup (no page navigation)
- Google OAuth - One-click sign in with Google
- Email/Password - Traditional credentials-based authentication
- Protected Routes - Upload and profile pages require authentication
- Guest Browsing - Public video feed accessible without login
- Smart Login Prompts - Friendly popup prompts for protected actions (like videos)
- Logout Confirmation - Consistent confirmation modals across Sidebar and Profile
- Responsive Design - Optimized for mobile, tablet, and desktop
- Dark Theme - Sleek dark mode throughout
- Glassmorphism - Modern UI with backdrop blur effects
- Gradient Accents - Pink-to-purple brand colors
- Mobile Keyboard Handling - Proper viewport adjustments on input focus
- Consistent Branding - KLIP logo and gradient text throughout
- Profile Management - View your uploaded videos and stats
- User Profiles - Click on any username/avatar to view their profile
- Back Navigation - Smart back button returns to exact video position
- Video Upload - Easy video upload with title and description
- Like System - Like videos with instant visual feedback
- Video Grid - Beautiful grid layout for user profiles
- Profile Stats - View video count and total likes
- Next.js 15.5.6 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- PWA Support - Installable app with offline capabilities
- tRPC - End-to-end typesafe APIs
- Prisma - Type-safe database ORM
- Supabase - PostgreSQL database & storage
- NextAuth.js - Authentication
- TanStack Query - Data fetching & caching
- Zod - Schema validation
src/
โโโ app/
โ โโโ _components/ # Reusable React components
โ โ โโโ AuthModalContext.tsx # Global auth modal state
โ โ โโโ AuthModals.tsx # Modal wrapper component
โ โ โโโ LogInModal.tsx # Login modal
โ โ โโโ SignUpModal.tsx # Signup modal
โ โ โโโ Feed.tsx # Video feed with auto-play
โ โ โโโ ProfilePage.tsx # Profile page component
โ โ โโโ UploadForm.tsx # Video upload form
โ โ โโโ Sidebar.tsx # Desktop navigation
โ โ โโโ BottomNav.tsx # Mobile navigation
โ โโโ upload/ # Upload page route
โ โโโ profile/ # Profile routes
โ โ โโโ page.tsx # Own profile page
โ โ โโโ [userId]/ # Dynamic user profile
โ โ โโโ page.tsx # User profile page
โ โโโ layout.tsx # Root layout with providers
โ โโโ page.tsx # Home page (video feed)
โโโ server/
โ โโโ api/
โ โ โโโ routers/ # tRPC routers
โ โ โ โโโ video.ts # Video operations
โ โ โ โโโ auth.ts # Auth operations
โ โ โโโ root.ts # Root router
โ โโโ auth/
โ โ โโโ config.ts # NextAuth configuration
โ โโโ db.ts # Prisma client
โโโ lib/
โ โโโ supabase.ts # Supabase client
โโโ styles/
โโโ globals.css # Global styles
- Node.js 18+ and npm
- Supabase account
- Google OAuth credentials (optional)
-
Clone the repository
git clone <repository-url> cd KLIP
-
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory (see.env.examplefor reference):# Database DATABASE_URL="postgresql://..." DIRECT_DATABASE_URL="postgresql://..." # Supabase NEXT_PUBLIC_SUPABASE_URL="https://your-project.supabase.co" NEXT_PUBLIC_SUPABASE_ANON_KEY="your-anon-key" # NextAuth AUTH_SECRET="your-secret-key" AUTH_GOOGLE_ID="your-google-client-id" AUTH_GOOGLE_SECRET="your-google-client-secret"
Note: Copy
.env.exampleto.envand fill in your actual values. -
Set up the database
npx prisma generate npx prisma db push
-
Run the development server
npm run dev
- User - User accounts and profiles
- Video - Uploaded videos with metadata
- Like - Video likes (user-video relationship)
- Account - OAuth account connections
- Application-level security via tRPC
- Optimized queries with Prisma
- Supabase Storage for video files
- Uses
100dvh(dynamic viewport height) for proper mobile display - Prevents scrolling issues caused by mobile browser address bars
- Responsive modals: smaller on mobile, larger on desktop
- Public video feed for guest users
- Modal-based auth (no page navigation)
- Protected actions trigger friendly login prompts
- Seamless user experience with smart popups
- Smart Login Prompts: Non-intrusive popups for unauthenticated interactions
- Visual Feedback: "Tap to Unmute" indicators and "Resume" animations for clear state communication
- Instant Scroll Navigation:
scrollIntoViewwithinstantbehavior prevents intermediate video playback - AbortError Suppression: Handles rapid scrolling gracefully without console noise
- Double-tap to like - Prevents interference with play/pause
- Instant feedback - Animations before server confirmation
- Consistent naming - "Log In", "Log Out", "Sign Up" throughout
- Clickable profiles - Navigate to user profiles from feed
- Smart back navigation - Returns to exact video position
- Expandable content - Long descriptions expand on click
- Confirmation modals - Logout requires confirmation
- Friendly prompts - Login prompts with KLIP branding
- Dynamic viewport height (
dvh) units - Proper keyboard behavior on input focus
- No manual scrolling required
- Single tap: Play/Pause video
- Double tap: Like video
- Swipe: Scroll to next/previous video
- Mobile:
max-w-sm(384px) with compact padding - Desktop:
max-w-md(448px) with spacious layout - Adaptive text sizes and spacing
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run db:push # Push schema changes to database
npm run db:studio # Open Prisma Studio- TypeScript for type safety
- ESLint for code linting
- Prettier for code formatting (recommended)
- Set up Supabase project
- Configure environment variables
- Run database migrations
- Deploy to Vercel
KLIP is a fully installable Progressive Web App! Users can install it on their mobile devices for a native app-like experience.
- Installable - Add to home screen on iOS and Android
- Offline Support - Cached assets work without internet
- App-like Experience - Full-screen mode without browser UI
- Fast Loading - Service worker caching for instant loads
- Open KLIP in Chrome
- Tap the menu (โฎ) โ "Install app" or "Add to Home screen"
- Confirm installation
- App icon appears on home screen
- Open KLIP in Safari
- Tap the Share button (โกโ)
- Scroll and tap "Add to Home Screen"
- Name it "KLIP" and tap "Add"
- App icon appears on home screen
- Manifest:
/public/manifest.json - Service Worker:
/public/sw.js - Icons: 192x192 and 512x512 PNG icons
- Caching Strategy: Network-first with cache fallback
- Theme Color: Black (#000000)
This project is built with the T3 Stack. Licensed under the MIT License - see the LICENSE file for details.