🚀 Setup Universal Apps
Documentation
Guide
🚀 Setup Universal Apps
Complete guide to set up and run Universal apps locally with core features configured
Documentation
Guide
0 Pages
Available
Quick Start
1. Clone and Checkout the Universal Apps Branch
After purchasing TSStarter, clone the repository and checkout the tsstarter-uni branch (the main branch is for Web app only):
git clone https://github.com/tsstarter/tsstarter your-project-name
cd your-project-name
git checkout tsstarter-uni
2. Install Dependencies
bun install
3. Set Up Environment Variables
Copy the example environment file and configure it:
cp env.example .env
Edit .env and configure the following variables:
Required Variables
# Use this command to generate (openssl rand -base64 32)
BETTER_AUTH_SECRET=your-secret-key-here
CSRF_SECRET=your-csrf-secret-key-here
# Database - Use SQLite for local development
DATABASE_URL=file:./local.db
# Development Servers
BASE_URL=http://localhost:3000
VITE_BASE_URL=http://localhost:3000
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
4. Configure Local Database
For local development, the database is already configured to use SQLite. Check the drizzle.config.ts for details:
5. Set Up the Database
# Generate migration files
bun run db:generate
# Push schema to database
bun run db:push
# Open Drizzle Studio
bun run db:studio
6. Start the Development Servers
Terminal 1 - Web App:
bun run dev
Terminal 2 - API Gateway:
cd apps/api
bun run dev
Your applications will be available at:
- Web App: http://localhost:3000
- API Gateway: http://localhost:3001
- API Docs: http://localhost:3001/api/docs
Optional Configuration
1. AI Integration
# AI Providers
ANTHROPIC_API_KEY=your-anthropic-api-key
2. Payment Integration (Polar)
# Polar Payments
VITE_POLAR_SUCCESS_URL=http://localhost:3000/payment/success
POLAR_WEBHOOK_SECRET=your-polar-webhook-secret
# Tier 1 (High PPP) - No discount
VITE_POLAR_TIER1_YEARLY_CHECKOUT_URL=https://sandbox.polar.sh/checkout/your-tier1-yearly-link
VITE_POLAR_TIER1_LIFETIME_CHECKOUT_URL=https://sandbox.polar.sh/checkout/your-tier1-lifetime-link
# Tier 2 (Medium PPP) - 30% discount
VITE_POLAR_TIER2_YEARLY_CHECKOUT_URL=https://sandbox.polar.sh/checkout/your-tier2-yearly-link
VITE_POLAR_TIER2_LIFETIME_CHECKOUT_URL=https://sandbox.polar.sh/checkout/your-tier2-lifetime-link
# Tier 3 (Lower PPP) - 50% discount
VITE_POLAR_TIER3_YEARLY_CHECKOUT_URL=https://sandbox.polar.sh/checkout/your-tier3-yearly-link
VITE_POLAR_TIER3_LIFETIME_CHECKOUT_URL=https://sandbox.polar.sh/checkout/your-tier3-lifetime-link
Getting Help
- 📚 Check the documentation for detailed guides
- 💬 Contact support at tsstarter@icloud.com
Happy coding! 🚀