Gitwit
An open source, AI-native coding platform which allows you to build apps in minutes
Install / Use
/learn @gitwitorg/GitwitREADME
GitWit 📦🪄
<img width="2552" height="1422" alt="image" src="https://github.com/user-attachments/assets/64b42130-4986-4619-989b-0fd338ebabb3" />GitWit is an open-source cloud-based code editing environment with custom AI code generation, live preview, and AI chat.
For the latest updates, join our Discord server: discord.gitwit.dev.
Minimal Setup
A quick overview of the tech before we start: This is a Turborepo monorepo with a Next.js app for the frontend (with Hono API routes), and an Express server on the backend for WebSocket/real-time connections.
Required accounts to get started:
AI Provider Options:
GitWit supports multiple AI providers. You can either:
- Use system-level API keys (set in
.env- recommended for development) - Let users configure their own API keys via Dashboard Settings (recommended for production)
Supported providers:
- Anthropic: Claude models for code generation and chat
- OpenAI: GPT models for code generation and chat
- OpenRouter: Access to multiple AI models through a single API
- AWS Bedrock: Claude models via AWS infrastructure
1. Clone the repository
No surprise in the first step:
git clone https://github.com/jamesmurdza/gitwit
cd gitwit
Copy .env files:
cp .env.example .env
cp web/.env.example web/.env
cp server/.env.example server/.env
Install dependencies:
npm install
2. Create a database
Install and start Postgres:
brew install postgresql
brew services start postgresql
Create a database:
psql postgres -c "CREATE DATABASE gitwit;"
# psql postgres -U postgres -c "CREATE DATABASE gitwit;" # Use this if the above fails
Initialize the database schema (run from project directory):
npm run db:generate
npm run db:migrate
After making any changes to your database schema, run these commands again to update your local database. The migration files created are not committed to version control.
Production database management
<details> <summary>Instructions</summary>Create a .env.production file with your production database credentials:
DATABASE_URL=
Initialize or migrate the database:
npm run db:generate:prod
npm run db:migrate:prod
Production migration files are committed to version control.
</details>3. Configure environment variables
Get API keys for E2B and Clerk (required), plus at least one AI provider (optional for system-level access).
Add them to the .env file along with the database connection string.
Required:
DATABASE_URL='🔑'
E2B_API_KEY='🔑'
CLERK_SECRET_KEY='🔑'
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY='🔑'
Optional (Custom API Keys Feature):
ENCRYPTION_KEY='🔑' # 32-byte hex string for encrypting user API keys
To enable the custom API keys feature (allowing users to configure their own API keys), set ENCRYPTION_KEY. Generate one using:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# or
openssl rand -base64 32
Optional (System-level AI providers):
OPENAI_API_KEY='🔑'
ANTHROPIC_API_KEY='🔑'
Optional (AWS Bedrock):
AWS_ACCESS_KEY_ID='🔑'
AWS_SECRET_ACCESS_KEY='🔑'
AWS_REGION='us-east-1'
AWS_MODEL_ID='qwen.qwen3-32b-v1:0'
# AWS_MODEL_ID='qwen.qwen3-coder-30b-a3b-v1:0'
Setting up AWS Bedrock keys
Follow these steps to call the qwen.qwen3-32b-v1:0 model through Amazon Bedrock:
- Create an AWS account – Sign up at aws.amazon.com if needed.
- Create an IAM user with programmatic access – In the AWS Console, open IAM →
Users→Add users, choose a name, and enable "Programmatic access". - Attach Bedrock permissions – Assign a policy similar to:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["bedrock:*", "kms:GenerateDataKey", "kms:Decrypt"], "Resource": "*" } ] } - Create and store the access keys – Download the access key ID and secret access key once, keep them in a password manager, and map them to
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY. - Configure your environment – Set
AWS_REGION, optionally overrideAWS_MODEL_ID, and confirm your Bedrock calls referenceqwen.qwen3-32b-v1:0(or another valid Qwen model ID you prefer).
Once complete, restart the app so the updated credentials are loaded.
Note:
- If
ENCRYPTION_KEYis not set, the custom API keys feature will be disabled, but the app will still work using system-level API keys. - You must provide at least one of:
ENCRYPTION_KEY(for user-configured keys) OR system-level API keys (OPENAI_API_KEY/ANTHROPIC_API_KEY).
4. Run the IDE
Start the web app and server in development mode:
npm run dev
Features
Custom API Key Management
Users can configure their own API keys for AI providers through Dashboard Settings:
- Navigate to Dashboard → Settings → API Keys
- Configure keys for any supported provider:
- Anthropic: Access to Claude models (Sonnet, Opus, Haiku)
- OpenAI: Access to GPT-4.1 series models
- OpenRouter: Access to multiple AI models with custom model IDs
- AWS Bedrock: Claude models via AWS infrastructure
- Optionally specify custom model IDs for each provider
- API keys are encrypted using AES-256-GCM before storage
Model Selection:
- The chat interface automatically shows available models based on configured API keys
- Users can switch between models using the dropdown in the chat input
- If no model is specified, sensible defaults are provided for each provider
Priority Order: When multiple providers are configured, the system uses this priority: OpenRouter > Anthropic > OpenAI > AWS Bedrock
User Profiles & Dashboard
Users have access to a comprehensive dashboard with:
- Profile Management: Edit name, username, bio, personal website, and social links
- API Keys: Securely configure and manage AI provider credentials
- Sandboxes: View, manage visibility (public/private), and delete projects
- Public Profiles: Each user gets a public profile page at
/@usernameshowing their public projects
Supported AI Models
Anthropic (Claude):
- Claude Sonnet 4.5
- Claude Haiku 4.5
- Claude Opus 4.1
- Claude Sonnet 4
- Claude Opus 4
- Claude Sonnet 3.7
- Claude Haiku 3.5
OpenAI (GPT):
- GPT-4.1
- GPT-4.1 Nano
- GPT-4.1 Mini
OpenRouter & AWS: Custom model IDs supported
Optional setup
Add GitHub integration
<details> <summary>Instructions</summary>Setup GitHub OAuth for authentication.
Update .env:
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
To get your GitHub Client ID and Client Secret:
- Go to GitHub Developer Settings and create a new OAuth App
- Set the "Authorization callback URL" to
http://localhost:3000/loadingif running locally - Set the "Homepage URL" to
http://localhost:3000if running locally - Get the "Client ID" and "Client Secret" from the OAuth App
To get a Personal Access Token (PAT):
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Give it a descriptive name (e.g., "GitWit Testing")
- Select the necessary scopes (typically
repo,user,read:org) - Generate the token and copy it securely
Add Deployments
<details> <summary>Instructions</summary>The steps above do not include steps to setup Dokku, which is required for deployments.
Note: This is completely optional to set up if you just want to run GitWit.
Setting up deployments first requires a separate domain (such as gitwit.app, which we use).
We then deploy Dokku on a separate server, according to this guide: https://dev.to/jamesmurdza/host-your-own-paas-platform-as-a-service-on-amazon-web-services-3f0d
And we install dokku-daemon with the following commands:
git clone https://github.com/dokku/dokku-daemon
cd dokku-daemon
sudo make install
systemctl start dokku-daemon
The GitWit platform connects to the Dokku server via SSH, using SSH keys specifically generated for this connection. The SSH key is stored on the GitWit server, and the following environment variables are set in .env:
DOKKU_HOST=
DOKKU_USERNAME=
DOKKU_KEY=
</details>
Templates
<details> <summary>Instructions</summary>Templates are pre-built sandbox environments for new projects, powered by the E2B SDK. Each template is a directory inside templates/ containing a template.ts file that defines the environment programmatically.
Architecture
templates/base/template.ts— Master template with shared dependencies (Node.js 20, git, curl, ripgrep, fzf, opencode, claude-code). Node-based templates inherit from this viafromTemplate("gitwit-base").templates/{reactjs,nextjs,vanillajs,empty}/template.ts— Inherit from the base template and add framework-specific setup.templates/{php,streamlit}/template.ts— UsefromDockerfile()to parse their owne2b.Dockerfilesince they require different base images.templates/deploy.ts— Orchestrates building and deploying all templates.templates/index.ts— Exports template configs (run commands, conventions) used by the web app.
Available templates
| Template | Base | Description |
|----------|------|-------------|
| base | node:20 | Master template with sh
