Cloud-based terminal and development environment platform. Runs isolated workspace environments in Docker containers with browser-accessible terminal sessions.
- Isolated workspace environments running in Docker containers
- Multiple terminal sessions with persistent state (tmux-backed)
- Workflow automation engine for CI/CD-like pipelines
- Secret management with encrypted storage
- GitHub OAuth integration
- Team collaboration with organization support
Frontend (Next.js 16 / React 19)
|
v
API Layer (Elysia)
|
+----+----+----+----+
| | | | |
v v v v v
Postgres Redis Docker BullMQ WebSocket
- Frontend: Next.js with React, Tailwind CSS, xterm.js for terminal rendering
- API: Elysia framework running through Next.js catch-all route
- Database: PostgreSQL with Drizzle ORM
- Cache: Redis for session caching and job queue backend
- Containers: Docker for workspace isolation
- Jobs: BullMQ for async workflow execution
- Terminal: WebSocket server streaming terminal I/O to xterm.js
- Bun 1.3.3+ (or Node.js 18+)
- PostgreSQL
- Redis
- Docker daemon
# Option 1: Use defaults
cp .env.example .env
# Option 2: Generate random credentials
./scripts/setup.shThen start the services:
docker compose up -dThis starts PostgreSQL, Redis, and the application. Access at http://localhost:3000.
- Install dependencies:
bun install- Start PostgreSQL and Redis:
# Using Docker
docker run -d --name termflux-postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=termflux postgres:16-alpine
docker run -d --name termflux-redis -p 6379:6379 redis:7-alpine- Configure environment variables:
cp .env.example .env- Run database migrations:
bun run db:generate
bun run db:migrateDevelopment:
bun run devProduction:
bun run build
bun startThe application runs on http://localhost:3000. WebSocket terminal server runs on port 3001.
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://postgres:postgres@localhost:5432/termflux |
REDIS_URL |
Redis connection string | redis://localhost:6379 |
APP_URL |
Application URL | http://localhost:3000 |
NEXT_PUBLIC_APP_URL |
Public application URL | http://localhost:3000 |
DOCKER_SOCKET |
Docker socket path | /var/run/docker.sock |
WORKSPACE_IMAGE |
Docker image for workspaces | termflux-workspace:latest |
WORKSPACE_NETWORK |
Docker network for workspaces | termflux-network |
SECRETS_ENCRYPTION_KEY |
Key for encrypting secrets | (required) |
GITHUB_CLIENT_ID |
GitHub OAuth client ID | (optional) |
GITHUB_CLIENT_SECRET |
GitHub OAuth client secret | (optional) |
| Command | Description |
|---|---|
bun run dev |
Development server with hot reload |
bun run build |
Production build |
bun start |
Production server |
bun run lint |
Run linting |
bun run db:generate |
Generate database migrations |
bun run db:migrate |
Apply pending migrations |
bun run db:push |
Push schema directly to database |
bun run db:studio |
Open Drizzle Studio for database inspection |
src/
app/ # Next.js App Router pages
api/[[...slugs]]/ # Catch-all API route
dashboard/ # Protected dashboard routes
components/
ui/ # Reusable UI components
terminal/ # Terminal components (xterm.js)
lib/
api/ # Elysia API server and routes
db/ # Database schema and connection
docker/ # Docker container management
redis/ # Redis client
terminal/ # WebSocket terminal server
workflows/ # Workflow execution engine
workspace/ # Workspace provisioning
Core tables:
users- User accountsorganizations- Team unitsworkspaces- Isolated dev environments (Docker containers)sessions- Terminal sessions within workspacesworkflows- Workflow definitionsworkflow_runs- Workflow execution historysecrets- Encrypted secrets per workspace
- User creates a workspace, which provisions a Docker container with resource limits
- Terminal sessions are created as tmux sessions inside the container
- WebSocket server pipes terminal I/O between browser (xterm.js) and container
- Workflows execute shell commands in containers via BullMQ job queue
- Secrets are encrypted and injected as environment variables during workflow runs
MIT