Prerequisites
Project Structure
The repository is a monorepo with the following structure:Database Setup
Configure database connection
Create Edit
apps/api/.env with your database credentials:apps/api/.env:Build and Run API Hub
Run in development mode
Start the API with hot-reload:Or use the workspace script:The API will be available at
http://localhost:3001.Build and Run Web UI
Run in development mode
Start the Nuxt dev server:The UI will be available at
http://localhost:3000.Build CLI Agent
The CLI agent is theconnect command that users run on their machines.
Build standalone binary
Create a native binary using Bun:This creates platform-specific binaries:
bin/connect-linux-x64bin/connect-linux-arm64bin/connect-darwin-x64bin/connect-darwin-arm64
Available Scripts
The rootpackage.json includes convenient scripts:
Development
Building
Database Management
Docker
Running All Components
Production Deployment
Using PM2 (Process Manager)
Using systemd (Linux)
Create/etc/systemd/system/privateconnect-api.service:
Environment Variables Reference
API Hub (apps/api/.env)
Web UI (apps/web/.env)
Agent (apps/agent/.env or environment)
Troubleshooting
Build failures
Clear dependencies and rebuild:Database connection errors
Verify PostgreSQL is running and credentials are correct:Port already in use
Find and kill the process using the port:Prisma errors
Regenerate Prisma client:Next Steps
Connect Your First Agent
Connect an agent to your self-hosted hub
API Reference
Explore the REST API endpoints