Documentation Index
Fetch the complete documentation index at: https://mintlify.com/InsForge/InsForge/llms.txt
Use this file to discover all available pages before exploring further.
Overview
InsForge is built as a modern, containerized backend-as-a-service platform designed for AI coding agents and developers. The architecture follows a microservices approach with clearly separated concerns.Core Components
The platform consists of five main services orchestrated via Docker Compose:1. PostgreSQL Database
Container:insforge-postgresImage:
ghcr.io/insforge/postgres:v15.13.2Port:
5432
Custom PostgreSQL 15 image with:
- pgcrypto extension for encryption operations
- Custom configuration via
postgresql.conf - JWT extension for token generation
- RLS (Row Level Security) policies automatically created
- Three role system:
anon,authenticated,project_admin
app.encryption_key parameter for sensitive data.
2. PostgREST API Layer
Container:insforge-postgrestImage:
postgrest/postgrest:v12.2.12Port:
5430 (internal: 3000)
Provides automatic RESTful API for PostgreSQL:
- Exposes
publicschema as REST endpoints - JWT-based authentication
- Role-based access control via RLS
- Schema reloading via NOTIFY channel
- OpenAPI documentation generation
3. InsForge Backend
Container:insforgePorts:
7130- Backend API server7131- Frontend dashboard7132- Auth service
- User authentication & session management
- Storage operations (S3-compatible)
- AI model gateway (OpenAI-compatible)
- Serverless function deployment
- Admin operations
- Database migrations
- Backend: Node.js + Express + TypeScript
- Frontend: React + Vite + TailwindCSS
- Validation: Zod schemas
- Database: node-postgres (pg)
4. Deno Runtime
Container:insforge-denoImage:
denoland/deno:alpine-2.0.6Port:
7133
Serverless function execution environment:
- Isolated execution for user-deployed functions
- Worker-based with configurable timeouts (default: 60s)
- Direct PostgreSQL access via connection string
- Encrypted secrets decrypted at runtime
- Hot reload in development mode
5. Vector Log Aggregator
Container:insforge-vectorImage:
timberio/vector:0.28.1-alpine
Log collection and shipping:
- Collects logs from all containers
- Ships to CloudWatch (when configured)
- Falls back to file-based logging
- Exposes health endpoint on
:7135/health
Data Flow
Authentication Flow
JWT Token Generation
- User authenticates via
/auth/loginor OAuth TokenManagergenerates JWT with:sub: User IDemail: User emailrole:authenticatedorproject_admin
- Token signed with
JWT_SECRET - Client stores token and includes in
Authorization: Bearer <token>header
Request Authorization
Middleware Chain:backend/src/api/middlewares/auth.ts
Row Level Security
PostgreSQL enforces data access via RLS policies:Storage Architecture
Flexible storage backend supporting: Cloud Storage:- AWS S3
- S3-compatible services (Wasabi, MinIO, etc.)
- CloudFront CDN for signed URLs
- Docker volume:
storage-data→/insforge-storage - Used when S3 credentials not configured
- Public/private access control
- File size limits via
MAX_FILE_SIZE - Metadata tracking in
auth.storage_objectstable
Networking
Bridge Network:insforge-network
All containers communicate via internal DNS:
postgres:5432postgrest:3000deno:7133insforge:7130/7131/7132
Persistence
Docker Volumes:Monitoring & Logs
Log Aggregation:- Vector collects from
/insforge-logsvolume - Structured JSON logging via Winston
- CloudWatch integration (optional)
- Docker container logs via stdout
Development vs Production
Development (docker-compose.yml)
- Hot reload enabled (Vite HMR)
- Source code mounted as volumes
- Debug logging enabled
npm run devin watch mode
Production (docker-compose.prod.yml)
- Pre-built production images
- No source code volumes
- Optimized builds
npm run startproduction server
Security Considerations
- Database Access: Only via PostgREST (JWT-authenticated) or backend
- Secrets: All sensitive env vars should use Docker secrets in production
- Network: Use reverse proxy (nginx/Caddy) for TLS termination
- RLS Policies: Always enable RLS on tables with user data
- API Keys: Rotate regularly and store securely
Scalability
Horizontal Scaling:- Backend/Frontend: Multiple replicas behind load balancer
- PostgreSQL: Read replicas + connection pooling (PgBouncer)
- Storage: S3 auto-scales
- Increase container resources via
docker-compose.yml - PostgreSQL: Tune
shared_buffers,work_mem - Deno: Adjust
WORKER_TIMEOUT_MS