Introduction to InsForge
Relevant source files
The following files were used as context for generating this wiki page:
InsForge is an open-source backend-as-a-service (BaaS) platform specifically engineered for AI-native development. It serves as a semantic layer between AI coding agents (such as Claude or GPT) and core backend primitives including databases, authentication, file storage, and serverless functions. By providing structured schemas and documentation that agents can reason about, InsForge enables autonomous end-to-end application management and infrastructure orchestration.
The platform is designed to be "Agent-Native," meaning it performs backend context engineering so that agents can understand, operate, and inspect backend systems directly. It exposes backend state and logs through structured schemas, allowing for rapid prototyping and production deployment of full-stack applications via natural language prompts.
Sources: README.md:12-18, deploy/zeabur/template.yml:10-12, AGENTS.md:7-14
Core System Architecture
InsForge operates as a monorepo containing several interconnected services and packages. The architecture is centered around a "Semantic Layer" that translates AI agent requests into operations performed on backend primitives.
Component Overview
The platform consists of several primary services:
- PostgreSQL: The relational database engine providing persistent storage.
- PostgREST: Automatically generates a RESTful API directly from the PostgreSQL schema.
- Deno Runtime: An isolated environment for executing serverless "Edge Functions."
- InsForge Dashboard: A React-based admin interface for managing projects, users, and deployments.
The diagram above illustrates how InsForge acts as the central orchestrator (Semantic Layer) between external agents/applications and the underlying infrastructure.
Sources: README.md:21-43, CONTRIBUTING.md:14-22, deploy/zeabur/template.yml:84-511
Key Backend Primitives
InsForge provides several core products that are accessible via the SDK or through Model Context Protocol (MCP) tools.
Database and API
InsForge uses PostgreSQL for relational data. It includes a specific system for schema management and Row Level Security (RLS) to ensure data isolation. The PostgREST service exposes these tables as an OpenAI-compatible API.
| Component | Description |
|---|---|
| PostgreSQL | Relational database (v15.13.2) with extensions like pg_cron, http, and pgcrypto. |
| PostgREST | Layer that turns the database into a RESTful API (v12.2.12). |
| RLS Policies | Automatic policy creation for the project_admin role on new tables. |
Sources: deploy/zeabur/template.yml:84-250, README.md:46-47, AGENTS.md:9
Authentication and User Management
The platform includes built-in user management supporting email/password and OAuth providers like Google and GitHub. It manages sessions and issues JWTs for secure access to other primitives.
Sources: README.md:45, AGENTS.md:10, deploy/zeabur/template.yml:540-555
AI Model Gateway
The Model Gateway provides an OpenAI-compatible API that interfaces with multiple LLM providers via OpenRouter. It supports chat completions, image generation, and embeddings.
Edge Functions
Edge functions are serverless JavaScript/TypeScript snippets executed in a sandboxed Deno environment. They are used for custom business logic and can access database secrets via a mock Deno.env object.
Sources: deploy/zeabur/template.yml:252-470, functions/examples/README.md:3-12
Agent Integration and MCP
A defining feature of InsForge is its integration with AI agents via the Model Context Protocol (MCP). This allows agents to "reason" about the backend infrastructure.
MCP Tools vs. SDK
Developers use the SDK for application logic, while AI agents use MCP tools for infrastructure management.
| Type | Intended Use | Key Operations |
|---|---|---|
| SDK | Application Code | CRUD, Auth, AI Chat, Function Invocation |
| MCP Tools | Agent Operations | fetch-docs, run-raw-sql, create-bucket, create-function |
The Claude Plugin
The project provides a specific plugin for Claude Code that includes "Skills" like insforge-schema-patterns. This teaches the agent best practices for social graph patterns, junction tables, and hierarchical data structures specific to the InsForge environment.
Sources: AGENTS.md:47-66, CLAUDE_PLUGIN.md:1-45
Deployment and Environment Configuration
InsForge supports multiple deployment strategies, ranging from local development to cloud-hosted environments.
Docker Deployment
For self-hosting, InsForge uses Docker Compose to orchestrate its microservices. Multiple projects can run on a single host by isolating them with unique project names (-p flag) and port mappings.
# Example port configuration in .env for isolated projects
POSTGRES_PORT=5442
POSTGREST_PORT=5440
APP_PORT=7230
AUTH_PORT=7231
DENO_PORT=7233
Sources: deploy/docker-deploy.md:20-55, README.md:112-140
One-Click Cloud Templates
InsForge provides templates for rapid deployment on platforms like Zeabur and Railway. These templates pre-configure the necessary environment variables and service dependencies.
| Variable | Type | Description |
|---|---|---|
PUBLIC_DOMAIN | DOMAIN | The access URL for the application. |
ADMIN_EMAIL | STRING | Admin credentials for the dashboard. |
OPENROUTER_API_KEY | STRING | Optional key for AI services. |
JWT_SECRET | STRING | Key used for signing authentication tokens. |
Sources: deploy/zeabur/template.yml:14-40, README.md:144-150
Conclusion
InsForge provides a complete backend ecosystem that bridges the gap between traditional cloud primitives and the requirements of AI-driven development. By combining a robust PostgreSQL-based data layer with a semantic interface for agents, it allows developers to build full-stack applications with significantly reduced infrastructure overhead.