A modern, addictive TikTok clone with AI-powered recommendations, built with Next.js, TypeScript, and Pyodide.
- 🎥 Vertical Video Feed - Smooth infinite scroll with swipe gestures
- 🤖 AI-Powered Recommendations - Python algorithm running in browser via Pyodide
- 🎨 Modern UI - Minimal, bold, and highly addictive design
- ⚡ Real-Time Data - Integrated with TikTok API using TikTok-Api and insights from reverse-engineered source
- 📱 Mobile-First - Optimized for mobile and desktop
- 🔄 Pull-to-Refresh - Native-like mobile experience
- 🎯 Personalized Feed - Adapts to user behavior in real-time
┌─────────────────────────────────────────────────────────┐
│ Next.js Frontend (Vercel) │
│ - React + TypeScript │
│ - Tailwind CSS + Framer Motion │
│ - Pyodide (Python in Browser) │
└──────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ TikTok API Integration │
│ - TikTok-Api library approach │
│ - Reverse-engineered source insights │
│ - Real-time video data │
└─────────────────────────────────────────────────────────┘
- Frontend: Next.js 14, React 18, TypeScript
- Styling: Tailwind CSS, Framer Motion
- Algorithm: Python (Pyodide) - runs in browser
- API: Next.js API Routes
- Hosting: Vercel (free tier)
- CDN: jsdelivr (Pyodide runtime)
# Clone repository
git clone https://github.com/xazalea/oxygen.git
cd oxygen
# Install dependencies
cd web
npm install
# Run development server
npm run devOpen http://localhost:3000 in your browser.
Create .env.local in the web/ directory:
# Optional but recommended for better rate limits
TIKTOK_MS_TOKEN=your_tiktok_ms_token_here
# Google Photos Storage Integration
GOOGLE_PHOTOS_CLIENT_ID=your_client_id_here
GOOGLE_PHOTOS_CLIENT_SECRET=your_client_secret_here
GOOGLE_PHOTOS_REFRESH_TOKEN=your_refresh_token_here
GOOGLE_PHOTOS_DEVICE_MODEL=Pixel XL- Go to tiktok.com and log in
- Open browser developer tools (F12)
- Go to Application/Storage → Cookies → tiktok.com
- Find
ms_tokencookie and copy its value
- Go to Google Cloud Console
- Create a project and enable "Photos Library API"
- Create OAuth credentials (Client ID & Secret) with redirect URI:
http://localhost:3000/api/storage/google-photos/callback(or your production URL) - Navigate to
/api/storage/google-photos/authin your browser to authorize and get yourGOOGLE_PHOTOS_REFRESH_TOKEN - Add credentials to
.env.local
-
Push code to GitHub:
./publish.sh
-
Go to vercel.com
-
Import your GitHub repository
-
Configure:
- Root Directory:
web - Framework: Next.js (auto-detected)
- Root Directory:
-
Set environment variable
TIKTOK_MS_TOKEN(optional) -
Deploy!
See DEPLOYMENT.md for detailed instructions.
- Deployment Guide - Complete deployment instructions
- TikTok Integration - API integration details
- Production Migration - Migration from mock data
VideoFeed.tsx- Main vertical scrolling feedVideoPlayer.tsx- Full-screen video playerRecommendationEngine.tsx- Pyodide integration wrapperUI/- Reusable UI components
/api/trending- Get trending videos/api/video/[id]- Get video by ID/api/interaction- Record user interactions/api/health- Health check
algorithm_core.py- Core recommendation logicranking.py- Ranking algorithmsuser_model.py- User representation
- TikTok-Api: davidteather/TikTok-Api
- TikTok Source: huaji233333/tiktok_source
- Pyodide: pyodide.org
- Minimal: Clean, uncluttered interface
- Modern: Smooth animations, glassmorphism effects
- Bold: High contrast, vibrant colors, strong visual hierarchy
- Addictive: Infinite scroll, instant feedback, haptic-like interactions
See LICENSE file for details.
- TikTok-Api for TikTok data access
- huaji233333/tiktok_source for reverse-engineered insights
- Pyodide for Python in the browser
- User authentication
- Video upload
- Social features (follow, comments)
- Advanced algorithm optimizations
- Analytics dashboard
Contributions welcome! Please open an issue or submit a pull request.
Built with ❤️ using Next.js, TypeScript, and Pyodide