Project Setup
Get Offworld running locally
Set up Offworld for local development.
Prerequisites
- Bun v1.3+ - Install Bun
- Git - Version control
- GitHub Account - For OAuth app setup
- Convex Account - Sign up free
- Google AI API Key - Get key
Clone the Repository
git clone https://github.com/oscabriel/offworld.git
cd offworldInstall Dependencies
bun installBun installs all workspace dependencies in one command.
Setup Environment Variables
Create .env.dev in project root:
# Convex
CONVEX_SITE_URL=http://localhost:3000
# GitHub OAuth App
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
# GitHub App (for API)
GITHUB_APP_ID=your_app_id
GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
GITHUB_INSTALLATION_ID=your_installation_id
# Google AI
GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_keyGitHub OAuth App Setup
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click New OAuth App
- Fill in:
- Application name: Offworld Local
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Copy Client ID and Client Secret to
.env.dev
GitHub App Setup (API Access)
- Go to GitHub Settings → Developer settings → GitHub Apps
- Click New GitHub App
- Fill in:
- GitHub App name: Offworld Local API
- Homepage URL:
http://localhost:3000 - Permissions: Repository → Contents (Read-only), Issues (Read-only), Pull requests (Read-only)
- Generate a private key (download PEM file)
- Install the app on your account/org
- Copy App ID, Installation ID, and private key content to
.env.dev
Private key must be on one line with \n for newlines: "-----BEGIN...-----\nKEY CONTENT\n-----END...-----"
Google AI API Key
- Go to Google AI Studio
- Sign in with Google account
- Click Get API Key
- Copy key to
.env.dev
Setup Convex Backend
bun run dev:setupThis:
- Creates a new Convex dev deployment
- Pushes schema and functions
- Generates API types
- Sets up environment variables
When prompted:
- Project name:
offworld-dev - Team: Select your team or create new
Copy the Convex deployment URL to .env.dev:
VITE_CONVEX_URL=https://your-deployment-name.convex.cloudSet Convex Environment Variables
In Convex dashboard or via CLI:
npx convex env set CONVEX_SITE_URL http://localhost:3000
npx convex env set GITHUB_CLIENT_ID your_client_id
npx convex env set GITHUB_CLIENT_SECRET your_client_secret
npx convex env set GITHUB_APP_ID your_app_id
npx convex env set GITHUB_PRIVATE_KEY "-----BEGIN..."
npx convex env set GITHUB_INSTALLATION_ID your_installation_id
npx convex env set GOOGLE_GENERATIVE_AI_API_KEY your_google_keyStart Development
bun run devThis starts:
- Convex dev server (hot-reloading functions)
- TanStack Start dev server (http://localhost:3000)
Project Structure
offworld/
├── apps/
│ ├── web/ # Frontend (TanStack Start)
│ └── fumadocs/ # Documentation site
├── packages/
│ ├── backend/ # Convex backend
│ └── config/ # Shared config
├── .env.dev # Development environment
├── package.json # Root workspace config
└── turbo.json # Turborepo configVerification
Check Frontend
Visit http://localhost:3000
- Should see Offworld homepage
- Sign in with GitHub should work
- Search for a repository (e.g.,
facebook/react)
Check Backend
Visit Convex Dashboard (link in terminal output)
- Data tab: Should see
repositories,architectureEntities,conversationstables - Functions tab: Should see queries, mutations, actions
- Logs tab: Should see function execution logs
Test Analysis
- Sign in on http://localhost:3000
- Enter
oscabriel/offworldin search - Click Analyze Repository
- Watch workflow in Convex Dashboard → Workflows
- Verify progressive updates on frontend
Troubleshooting Setup
"Bun not found"
Install Bun:
curl -fsSL https://bun.sh/install | bash"Convex deployment failed"
Check:
CONVEX_SITE_URLis set correctly- Convex CLI is authenticated:
npx convex dev --once - Internet connection is stable
"GitHub OAuth failed"
Check:
GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRETare correct- Callback URL matches:
http://localhost:3000/api/auth/callback/github - OAuth app is not suspended
"GitHub API rate limit"
Without GitHub App:
- Rate limit: 60 requests/hour (unauthenticated)
With GitHub App:
- Rate limit: 15,000 requests/hour
Ensure GITHUB_APP_ID, GITHUB_PRIVATE_KEY, GITHUB_INSTALLATION_ID are set.
"Google AI API error"
Check:
- API key is valid (test at https://ai.google.dev)
- Billing is enabled (if required)
GOOGLE_GENERATIVE_AI_API_KEYis set in Convex env
Next Steps
- Learn the Development Workflow
- Understand the Tech Stack
- Read Architecture Deep Dive