Skip to main content
Run S4Kit on your own infrastructure for full control over your data.

Prerequisites

  • Docker with Compose support
  • Bun 1.3.4+ (install)

Quick Setup

1

Clone and Install

git clone https://github.com/michal-majer/s4kit.git
cd s4kit
bun install
2

Start Database Services

docker compose up -d postgres redis
3

Initialize Database

cd packages/platform/backend
bun x drizzle-kit push --force
bun run db:seed
bun run db:setup-admin
4

Build and Start

cd ../..
bun run build

# Start services (3 terminals or use PM2)
cd packages/platform/backend && bun run start
cd packages/platform/frontend && bun run start
cd packages/platform/proxy && bun run start
Access: http://localhost:3001 | Login: admin@example.com / changeme123

Service Ports

ServicePortDescription
Frontend3001Admin dashboard (Next.js)
Backend3000Admin API
Proxy3002SDK proxy
PostgreSQL5433Database
Redis6379Cache

Configuration

Main config in packages/platform/backend/.env:
DATABASE_URL=postgresql://s4kit:s4kit_dev_password@localhost:5433/s4kit
REDIS_URL=redis://localhost:6379
ENCRYPTION_KEY=<openssl rand -hex 32>
BETTER_AUTH_SECRET=<openssl rand -base64 32>
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=changeme123
FRONTEND_URL=http://localhost:3001
Generate new ENCRYPTION_KEY and BETTER_AUTH_SECRET for production!

Process Management (PM2)

npm install -g pm2
pm2 start packages/platform/backend/src/index.ts --name backend --interpreter ~/.bun/bin/bun
pm2 start packages/platform/frontend/server.js --name frontend
pm2 start packages/platform/proxy/src/index.ts --name proxy --interpreter ~/.bun/bin/bun
pm2 save && pm2 startup

Health Checks

curl http://localhost:3000/api/health  # Backend
curl http://localhost:3002/health      # Proxy

Production Deployment

See DEPLOY.md for infrastructure, SSL, and scaling →