Skip to main content

Installation Methods

ThinkEx offers two installation approaches: an automated setup script for quick installation, or manual setup for more control.
The interactive setup script handles all configuration automatically.
1

Clone the Repository

git clone https://github.com/ThinkEx-OSS/thinkex.git
cd thinkex
2

Run the Setup Script

./setup.sh
The script will automatically:
  • Check prerequisites (Node.js v20+, pnpm, Docker)
  • Create .env file from .env.example
  • Generate BETTER_AUTH_SECRET automatically using openssl
  • Start PostgreSQL in Docker (or configure local PostgreSQL)
  • Set database connection string
  • Install dependencies with pnpm
  • Initialize database schema with migrations
  • Start the development server
3

Configure API Keys

The setup script will prompt you to configure required API keys. Edit .env and add:
# Required
GOOGLE_GENERATIVE_AI_API_KEY=AIza...
NEXT_PUBLIC_ASSISTANT_BASE_URL=https://...
ASSISTANT_API_KEY=your-key

# Optional
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
The application requires GOOGLE_GENERATIVE_AI_API_KEY and Assistant UI credentials to function. Get keys from Google AI Studio and Assistant Cloud.
4

Access ThinkEx

After setup completes, open your browser to:
http://localhost:3000

PostgreSQL Management (Docker)

If using Docker for PostgreSQL, use these commands:
# Stop PostgreSQL
docker-compose down

# Start PostgreSQL
docker-compose up -d

# View PostgreSQL logs
docker-compose logs -f postgres

# Check PostgreSQL health
docker-compose exec postgres pg_isready -U thinkex

Post-Installation

Verify Installation

Check that all services are running:
docker-compose ps
# Should show postgres container running

docker-compose exec postgres pg_isready -U thinkex
# Should return: accepting connections

Create Your First User

  1. Navigate to http://localhost:3000
  2. Sign up with email or Google OAuth (if configured)
  3. Start creating your first workspace
Better Auth handles authentication at the application level. The auth.jwt() function created during setup is a mock for RLS policies in local development.

Troubleshooting

Symptoms: Cannot connect to databaseSolutions:
  • Verify PostgreSQL is running: docker-compose ps or pg_isready
  • Check DATABASE_URL in .env matches your configuration
  • For Docker: Ensure port 5432 is not already in use
  • Wait for PostgreSQL to be ready (can take 5-10 seconds after starting)
Symptoms: Schema push fails or table creation errorsSolutions:
  • Ensure PostgreSQL version is 12 or higher
  • Check that the database user has CREATE permissions
  • Try running migrations manually:
    pnpm drizzle-kit push --force
    
  • “Already exists” errors are normal and can be ignored
Symptoms: Error about Node.js versionSolutions:
  • Check your Node.js version: node -v
  • ThinkEx requires Node.js v20 or higher
  • Install latest LTS from nodejs.org
  • Consider using nvm to manage Node versions
Symptoms: pnpm: command not foundSolutions:
  • Install pnpm globally:
    npm install -g pnpm
    
  • Or use npx:
    npx pnpm install
    
Symptoms: docker-compose: command not foundSolutions:
  • For newer Docker versions, use: docker compose (no hyphen)
  • Or install Docker Compose plugin: docs.docker.com/compose/install
  • Alternatively, use local PostgreSQL instead

Next Steps

Configuration

Configure environment variables and optional features

Storage Setup

Set up file storage (local or Supabase)

Build docs developers (and LLMs) love