A feature-rich Twitch clone built with modern web technologies! ๐ฎโจ This project replicates core functionalities of Twitch, incorporating live streaming, real-time chat, authentication, and much more. ๐
Here are the technologies that power this Twitch clone:
-
Backend:
-
Frontend:
- โก Next.js 15 - The React framework for production.
- ๐ Apollo Client - State management for GraphQL.
- ๐ Next Intl - Internationalization support.
-
Authentication:
- ๐ OTP Authentication for secure login.
-
Real-Time Streaming:
- ๐น LiveKit - Scalable WebRTC for real-time communications.
-
Payments:
- ๐ณ Stripe - Secure and seamless payment integration.
-
Validation:
- โ Zod - Schema declaration and validation.
-
Caching:
-
๐๏ธ Redis - Lightning-fast in-memory data store.
-
UI Components:
- ๐จ Shadcn UI - Accessible and reusable components.
-
State Management:
- ๐ Zustand - Simplified state management for React.
-
Bundler:
- โก Bun - Ultra-fast JavaScript runtime and bundler.
-
Messaging Integration:
- ๐ฉ Telegram Bot API - Integration for notifications and updates.
- ๐ด Live Streaming and Real-Time Chat
- ๐ Multi-Language Support with Translations
- ๐ Secure OTP Authentication
- ๐ธ Stripe-Powered Payment Integration
- ๐๏ธ User-Friendly Dashboard and Controls
- ๐ Modular and Scalable Codebase
- โก Ultra-Fast Bundling with Bun
- ๐ฉ Telegram Notifications for Updates and Alerts
- ๐๏ธ Enhanced Performance with Redis Caching
Before you get started, ensure you have the following installed:
- Node.js (v18 or higher) ๐ข
- Bun (optional, for faster builds) โก
- Docker (for database and LiveKit setup) ๐ณ
- A Stripe account ๐ณ
- A Telegram Bot API key ๐ฉ
- LiveKit API keys โก
Follow these steps to set up the project locally:
$ git clone https://github.com/BernieTv/twitch-clone.git
$ cd twitch-clone
# cd to backend server
cd backend && yarn
# cd to frontend folder
$ cd frontend && bun install
Create a .env
file in frontend and backend folders and add the following:
# for backend
NODE_ENV='development'
APPLICATION_PORT=4000
APPLICATION_URL='http://localhost:${APPLICATION_PORT}'
GRAPHQL_PREFIX='/graphql'
ALLOWED_ORIGIN='http://localhost:3000'
COOKIES_SECRET='secret'
SESSION_SECRET='secret'
SESSION_NAME='session'
SESSION_DOMAIN='localhost'
SESSION_MAX_AGE='30d'
SESSION_HTTP_ONLY=true
SESSION_SECURE=false
SESSION_FOLDER='sessions:'
POSTGRES_USER='root'
POSTGRES_PASSWORD='123456'
POSTGRES_HOST='localhost'
POSTGRES_PORT='5433'
POSTGRES_DATABASE='*'
POSTGRES_URI='postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}'
REDIS_USER='default'
REDIS_PASSWORD='123456'
REDIS_HOST='localhost'
REDIS_PORT='6379'
REDIS_URI='redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}'
MAIL_HOST='*'
MAIL_PORT=*
MAIL_LOGIN='*t'
MAIL_PASSWORD='*'
S3_ENDPOINT='*'
S3_REGION='*'
S3_ACCESS_KEY_ID='*'
S3_SECRET_ACCESS_KEY='*'
S3_BUCKET_NAME='*'
LIVEKIT_API_URL='*'
LIVEKIT_API_KEY='*'
LIVEKIT_API_SECRET='*'
TELEGRAM_BOT_TOKEN='*'
STRIPE_SECRET_KEY='*'
STRIPE_WEBHOOK_SECRET=''
# for frontend
NEXT_PUBLIC_APP_URL='http://localhost:3000'
NEXT_PUBLIC_SERVER_URL='http://localhost:4000/graphql'
NEXT_PUBLIC_WEBSOCKET_URL='ws://localhost:4000/graphql'
NEXT_PUBLIC_MEDIA_URL='*'
NEXT_PUBLIC_LIVEKIT_WS_URL=''
Start the databases using Docker:
$ docker-compose up -d
# for backend
$ yarn run start:dev
# for frontend
$ bun run dev
- Nest.js Documentation
- Next.js Documentation
- Prisma Documentation
- GraphQL Documentation
- Stripe Documentation
- Telegram Bot API Documentation
- Redis Documentation
This project is licensed under the MIT License. ๐
Check out the live demo here: Twitch Clone Demo ๐ฅ