Documentation

Getting Started

Getting Started

Prerequisites

  • Node.js 18+
  • pnpm: npm install -g pnpm
  • Expo CLI: npm install -g @expo/cli

Setup

# 1. Clone and install
git clone <repo-url>
cd CodeBaseHub
pnpm install

# 2. Environment setup
cp apps/web/.env.example apps/web/.env.local
cp apps/native/.env.example apps/native/.env

# 3. Start development
pnpm dev        # Both apps
pnpm dev:web    # Web only (localhost:3001)
pnpm dev:native # Mobile only

Environment Variables

Required:

# Better-auth
BETTER_AUTH_SECRET="your-32-char-secret"
BETTER_AUTH_URL="http://localhost:3001"

# Mobile (apps/native/.env)
EXPO_PUBLIC_SERVER_URL="http://localhost:3001"

Optional:

# RevenueCat
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY=""
EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY=""

# AppsFlyer
EXPO_PUBLIC_APPSFLYER_DEV_KEY=""
EXPO_PUBLIC_APPSFLYER_APPLE_ID=""

# OAuth
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""

Project Structure

apps/
├── web/              # Next.js app (port 3001)
└── native/           # React Native + Expo

packages/
├── auth-utils/       # Better-auth setup
├── config/           # Shared configuration
├── i18n/            # Multi-language support
├── onesignal/       # Push notifications
└── tailwind-config/ # Styling

Key Features

  • Shared Auth: Better-auth works on both platforms
  • Shared Config: Single config file for both apps
  • Multi-language: en, tr, ar with RTL support
  • Push Notifications: OneSignal integration
  • Mobile Payments: RevenueCat integration
  • Analytics: AppsFlyer for mobile

Next Steps

  1. Update packages/config/index.ts with your app details
  2. Configure authentication providers
  3. Set up push notifications (OneSignal)
  4. Configure mobile payments (RevenueCat)
  5. Add analytics (AppsFlyer)

Common Issues

# Port in use
lsof -ti:3001 | xargs kill -9

# Clear Metro cache
npx expo start --clear

# Clean install
rm -rf node_modules && pnpm install