System Requirements
Minimum Requirements
- Node.js: 18.x or higher
- Package Manager: Bun 1.2.5+ (recommended), npm, yarn, or pnpm
- PostgreSQL: 14 or higher
- Redis: 7 or higher
- Memory: 2GB RAM minimum, 4GB recommended
- Storage: 10GB free space
Recommended Setup
- OS: Linux, macOS, or Windows with WSL2
- Node.js: 20.x LTS
- PostgreSQL: 15 or 16
- Redis: 7.2 or higher
- Memory: 8GB RAM
Installation Methods
- Docker (Recommended)
- Local Development
- Production Deployment
Docker Installation
The easiest way to get started is with Docker Compose, which includes all dependencies.Prerequisites
- Docker 20.10 or higher
- Docker Compose 2.0 or higher
Setup Steps
Start Services
Launch all services:This starts:
- PostgreSQL on port 5432
- Redis on port 6379
- TikTok Miner App on port 3000
- Pipeline Worker (background processing)
Optional Services
Enable optional services with profiles:http://localhost:5050:- Email:
[email protected](or setPGADMIN_EMAIL) - Password:
admin(or setPGADMIN_PASSWORD)
Environment Variables
Complete reference of environment variables:Database Configuration
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string with pgBouncer |
DIRECT_URL | Yes | Direct PostgreSQL connection for migrations |
PASSWORD | No | Database password (legacy) |
Supabase Configuration
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Yes | Your Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Yes | Supabase anonymous key |
AI Configuration
| Variable | Required | Description | Default |
|---|---|---|---|
OPENAI_API_KEY | Yes | OpenAI API key | - |
OPENAI_MODEL | No | Model to use | gpt-4o |
OPENAI_TEMPERATURE | No | Response randomness (0-1) | 0.7 |
OPENAI_MIN_CONFIDENCE | No | Minimum confidence threshold | 0.5 |
GitHub Configuration
| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN | Recommended | GitHub personal access token |
GITHUB_TOKENS | No | Comma-separated tokens for load balancing |
GITHUB_TOKEN_LB_STRATEGY | No | Load balancing strategy |
Social Media APIs
| Variable | Required | Description |
|---|---|---|
TIKTOK_CLIENT_KEY | No | TikTok API client key |
TIKTOK_CLIENT_SECRET | No | TikTok API client secret |
INSTAGRAM_CLIENT_ID | No | Instagram API client ID |
INSTAGRAM_CLIENT_SECRET | No | Instagram API client secret |
TWITTER_BEARER_TOKEN | No | Twitter API bearer token |
YOUTUBE_API_KEY | No | YouTube Data API key |
Email Configuration
- SMTP
- Azure
| Variable | Required | Description |
|---|---|---|
SMTP_HOST | No | SMTP server host |
SMTP_PORT | No | SMTP server port (465 or 587) |
SMTP_USER | No | SMTP username |
SMTP_PASSWORD | No | SMTP password |
SMTP_SECURE | No | Use SSL/TLS (true for 465) |
SMTP_AUTH_METHOD | No | Authentication method |
Application Configuration
| Variable | Required | Description | Default |
|---|---|---|---|
NEXT_PUBLIC_APP_URL | Yes | Application URL | http://localhost:3000 |
LOG_LEVEL | No | Logging level | info |
NODE_ENV | No | Environment | development |
PORT | No | Server port | 3000 |
Database Schema
TikTok Miner uses Prisma ORM with the following main models:Creator Profiles
TikTok Metrics
Budget Management
TikTok Miner includes comprehensive budget tracking:prisma/schema.prisma in the repository.
Verification
Verify your installation:Check Database Connection
Test API Health
Run Tests
Next Steps
Quickstart Guide
Run your first creator search in 5 minutes
Environment Variables
Deep dive into configuration options
CLI Tools
Learn about command-line tools
API Reference
Explore the REST API
Troubleshooting
Common Issues
Prisma generate fails
Prisma generate fails
This usually means the database connection is incorrect or unreachable.Solutions:
- Verify
DATABASE_URLandDIRECT_URLare correct - Check PostgreSQL is running
- Test connection:
psql $DATABASE_URL - Ensure database exists
Port already in use
Port already in use
Another service is using port 3000.Solutions:
- Stop the conflicting service
- Change port:
PORT=3001 bun run dev - In Docker: Update
docker-compose.ymlports section
Redis connection refused
Redis connection refused
Redis is not running or not accessible.Solutions:
- Start Redis:
redis-server - Check if running:
redis-cli ping - Verify REDIS_URL in
.env - Check firewall rules for port 6379
Supabase authentication errors
Supabase authentication errors
Supabase configuration is incorrect.Solutions:
- Verify
NEXT_PUBLIC_SUPABASE_URLmatches your project - Check
NEXT_PUBLIC_SUPABASE_ANON_KEYis valid - Ensure Supabase project is active
- Test in Supabase dashboard first
Migration errors
Migration errors
Database schema doesn’t match expected state.Solutions:
- Reset database:
bun x prisma migrate reset - Check migration history:
bun x prisma migrate status - Apply pending migrations:
bun x prisma migrate deploy - Use DIRECT_URL for migrations, not pooled connection
Getting Help
If you’re still having issues:- Check the logs:
docker-compose logs -fortail -f logs/dev.log - Review the Docker Deployment troubleshooting section
- Check Database Setup for migration issues
- Search GitHub Issues