freshcrate
Home > Security > keel

keel

The full-stack framework built for AI. Auth, database, email, mobile โ€” ready in one command.

Description

The full-stack framework built for AI. Auth, database, email, mobile โ€” ready in one command.

README

Keel

Keel

The full-stack framework built for AI.
Ship production apps faster. Every project ships with typed contracts, predictable patterns, and AI agent instructions โ€” so AI writes better code from the start.

Website ยท Docs ยท npm

React 19 Express 5 TypeScript PostgreSQL Capacitor

a project


Why Keel?

Keel is a full-stack template framework for building web + mobile apps. It gives you auth, database, email, and native mobile support out of the box โ€” and it's designed so that AI coding agents (Cursor, Copilot, Windsurf, etc.) produce better code when working in Keel projects.

Every generated project includes CLAUDE.md, .cursor/rules, .github/copilot-instructions.md, and more โ€” giving AI agents full context about your architecture, conventions, and patterns.

What You Get

Layer Stack
Frontend Vite + React 19 + TypeScript + TailwindCSS v4
Backend Express 5 + TypeScript (ESM)
Auth BetterAuth โ€” email/password, sessions, email verification
Email Resend + React Email โ€” verification, welcome, password reset
Database PostgreSQL + Drizzle ORM (migrations)
Mobile Capacitor 8 โ€” iOS + Android via WebView
Hosting Docker, Fly.io, Railway, Vercel, or self-hosted

Quick Start

# Create a new project
npx @codaijs/keel create my-app

# Follow the setup wizard โ€” it configures everything:
#   โ†’ Project name & branding
#   โ†’ Database connection
#   โ†’ Auth secrets
#   โ†’ Email provider (optional)
#   โ†’ Which sails to install

Zero-Config Start (no Docker needed)

npx @codaijs/keel create my-app --yes --db=pglite
cd my-app
keel dev

Uses PGlite (embedded PostgreSQL via WASM) โ€” full PostgreSQL compatibility without Docker.

Manual Setup (from this repo)

git clone https://github.com/Chafficui/keel.git my-app
cd my-app
npm install

# Start PostgreSQL
docker compose up -d

# Copy environment files
cp packages/backend/.env.example packages/backend/.env
# Edit .env with your database URL, secrets, etc.

# Run database migrations
npm run db:migrate

# Start development
npm run dev

Project Structure

packages/
  shared/      โ†’ @keel/shared    โ€” Types + Zod validators
  email/       โ†’ @keel/email     โ€” React Email templates
  frontend/    โ†’ @keel/frontend  โ€” Vite + React SPA + Capacitor
  backend/     โ†’ @keel/backend   โ€” Express 5 API server
sails/         โ†’ Tracks installed sails (minimal, no code shipped)
cli/           โ†’ create-keel CLI + sail definitions
docs/          โ†’ Architecture, auth flow, mobile, sail development guides
brand/         โ†’ Keel brand assets + design guide

Development

npm run dev               # Frontend (:5173) + Backend (:3005) concurrently
npm run dev:frontend      # Frontend only
npm run dev:backend       # Backend only
npm run dev:email         # Email template preview (:3010)

Database

npm run db:generate       # Generate migration from schema changes
npm run db:migrate        # Apply pending migrations
npm run db:push           # Push schema directly (dev only)
npm run db:studio         # Open Drizzle Studio GUI

Mobile (Capacitor)

npm run cap:sync          # Sync web build to native projects
npm run cap:ios           # Open iOS project
npm run cap:android       # Open Android project

Build & Deploy

npm run build             # Build all packages
npm run typecheck         # Type-check everything
keel deploy               # Show deployment guides

Deployment Options

Platform Config File Command
Docker (self-hosted) docker-compose.prod.yml docker compose -f docker-compose.prod.yml up -d
Fly.io fly.toml fly launch --copy-config && fly deploy
Railway packages/backend/railway.json railway up
Vercel (frontend) packages/frontend/vercel.json vercel --cwd packages/frontend
Any container host packages/backend/Dockerfile docker build -f packages/backend/Dockerfile -t my-app .

Sails โ€” Extend Your App

Sails are optional packages that add functionality to your Keel project. They're not bundled into your app โ€” install only what you need.

# List available sails
npx @codaijs/keel list

# Install a sail (runs interactive setup wizard)
npx @codaijs/keel sail add google-oauth

# Get info about a sail before installing
npx @codaijs/keel info stripe

Available Sails

Sail Category What it adds
google-oauth Auth Google sign-in button + OAuth provider config
stripe Payments Subscriptions, checkout, webhooks, customer portal
gdpr Compliance Consent tracking, data export, account deletion (30-day grace), privacy policy
r2-storage Storage Cloudflare R2 file uploads + profile picture upload component
push-notifications Mobile Firebase Cloud Messaging + device token management
analytics Tracking PostHog โ€” page views, user identification, custom events
admin-dashboard Admin User management, metrics overview
i18n Localization i18next + react-i18next + language detection
rate-limiting Security API rate limiting middleware (planned)
file-uploads Storage Generic file upload system (planned)

Every sail includes a setup wizard that walks you through configuration, prompts for required env vars, and handles file modifications automatically.

How Sails Work

Sails use marker comments in your codebase to know where to insert code:

// [SAIL_IMPORTS]           โ€” import statements
// [SAIL_ROUTES]            โ€” route registrations
// [SAIL_SCHEMA]            โ€” database schema exports
// [SAIL_SOCIAL_PROVIDERS]  โ€” OAuth provider config
// [SAIL_ENV_VARS]          โ€” environment variable declarations
{/* [SAIL_SOCIAL_BUTTONS] */} โ€” social login buttons in forms

If you've modified files and a marker is missing, the installer won't break your code โ€” it prints clear manual instructions instead.

AI Agent Integration

Every project generated by Keel includes instruction files for major AI coding tools:

File Tool
CLAUDE.md Claude Code, Claude Agent SDK
AGENTS.md Generic AI agents
.cursor/rules Cursor
.github/copilot-instructions.md GitHub Copilot
.windsurfrules Windsurf

These files give AI agents full context about your project's architecture, conventions, database schema, auth flow, and available commands โ€” resulting in more accurate code generation and fewer hallucinations.

Environment Variables

Backend (packages/backend/.env)

Variable Required Description
DATABASE_URL Yes PostgreSQL connection string
BETTER_AUTH_SECRET Yes Session signing secret
BACKEND_URL Yes Public backend URL
FRONTEND_URL Yes Public frontend URL
PORT No Server port (default: 3005)
NODE_ENV No development / production
RESEND_API_KEY No Resend API key (logs to console if missing)
EMAIL_FROM No Sender email address

Frontend (packages/frontend/.env)

Variable Description
VITE_API_URL Backend URL (empty = use Vite proxy in dev)
VITE_APP_NAME App display name

Documentation

Detailed guides in the docs/ folder:

Tech Requirements

  • Node.js โ‰ฅ 22
  • PostgreSQL 16+ (or use the included docker-compose.yml)
  • npm 10+

License

MIT


Built with

Release History

VersionChangesUrgencyDate
v0.2.4## What's Changed * Refactor CI/CD pipeline and add release automation by @Chafficui in https://github.com/Chafficui/keel/pull/5 * Bump docker/setup-buildx-action from 3 to 4 by @dependabot[bot] in https://github.com/Chafficui/keel/pull/6 * Bump docker/build-push-action from 6 to 7 by @dependabot[bot] in https://github.com/Chafficui/keel/pull/7 * Group Dependabot PRs and add path-based CI filtering by @Chafficui in https://github.com/Chafficui/keel/pull/26 * Bump actions/setup-node from 4 tHigh4/10/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

vm0the easiest way to run natural language-described workflows automaticallyapp-v0.274.0
claude-team-mcp๐Ÿค– Orchestrate AI models like GPT and Claude for seamless collaboration in multi-agent development tasks with the Claude Team MCP Server.master@2026-04-21
aletheiaOperating framework for AI-assisted work with decision, governance, validation, and learnings before execution.main@2026-04-21
AG3NTBuild and run local AI agents with multi-model support, modular skills, secure controls, and multi-channel access for personal automation tasks.main@2026-04-21
capacitor-mobile-clawRun a full AI agent on mobile with local LLM calls, on-device memory, code execution, and native HTTP support in Capacitor apps.main@2026-04-21