Skip to main content
TypeScript has a powerful type system. However, many frameworks fail to fully leverage this strength. Sonamu is designed with TypeScript’s type system at its core.

Who Is This Framework For

Productivity-Focused Developers

Those who want to focus on business logic without wasting time on repetitive tasks

Teams That Trust Type Safety

Teams that prefer compile errors over runtime errors and maximize IDE assistance

Backend Developers Collaborating with Frontend

Those who want to escape the dual work of API spec documentation and client writing

Startups Needing Rapid Prototyping

Teams that want to build MVPs quickly while minimizing technical debt

Core Philosophy: Single Source of Truth

Define one Entity, and TypeScript handles the rest.

🎬 Full flow: Entity creation → Migration execution → Auto-generation of types/schemas/APIs → Frontend Service generation

Define an Entity in one place, and the entire system stays synchronized. No need to manually align types, document API specs, or write frontend clients.

Backend and Frontend Type Synchronization

Typically, when building backend APIs and using them on the frontend, type synchronization is difficult. With Sonamu, backend changes are immediately reflected on the frontend, catching errors at compile time.
Sonamu approach compile error

📸 Compile error shown when accessing non-existent property in Sonamu approach


Fully Type-safe Query Builder: Puri

Sonamu provides Puri, a type-safe query builder based on Knex. Table names, column names, and relationships are all type-checked.

🎬 Needed: Writing type-safe queries with Puri - table name, column name autocomplete

Key Features:
  • ✅ Types auto-extracted from Entity definition
  • ✅ Autocomplete for table names, column names, and relationships
  • ✅ Wrong column names cause compile errors
  • ✅ All Knex features supported

Puri Guide

Write type-safe queries

Frontend Integration

When you define a backend API, frontend Services and TanStack Query Hooks are automatically generated.

🎬 Write backend @api method → Frontend Service auto-generated → Use useQuery

Optimization with Subsets

Query only the fields you need to reduce network costs and improve performance. Exact TypeScript types are automatically generated for each Subset.

SSR

Supports server-side rendering based on Vite + React. Register SSR routes with registerSSR and preload necessary data on the server with the preload callback.
Registered routes are rendered on the server and automatically hydrated on the client. Improve SEO optimization and initial loading speed. Key Features:
  • ✅ Backend changes detected immediately via compile errors
  • ✅ Clean structure with Namespace-based organization
  • ✅ TanStack Query auto-integration (caching, revalidation, optimistic updates)
  • ✅ Accurate type inference per Subset
  • ✅ SSR support for SEO optimization

Using Services

Leverage auto-generated Services

TanStack Query

Data fetching with React Hooks

SSR

Server-side rendering

Testing

Sonamu includes powerful built-in tools for testing.

Fixture System

Easily load pre-seeded test data from Fixture DB with createFixtureLoader.

Naite: Test Data Tracking & Visualization

Track and visualize all data changes during test execution. Debugging becomes much easier.

📸 Naite Viewer screen - UI that visually shows database changes during test execution

Automatic Transaction Rollback

Each test runs in an isolated Transaction and automatically rolls back. Test isolation is guaranteed and no data cleanup is needed.
Key Features:
  • ✅ Reuse test data with Fixtures
  • ✅ Visualize data changes with Naite
  • ✅ Isolated tests with automatic Transaction rollback

Fixture System

Test data management

Naite Guide

Data tracking & visualization

AI Ready

Sonamu natively supports features for the AI era.

Vector Search (pgvector)

Define AI embedding search as an Entity field and you’re done. Native support for pgvector.

🎬 Define vector field in Entity → Auto-generate migration → Implement vector search API

AI SDK Integration

Seamlessly integrates with Vercel AI SDK. Streaming responses are simple.

SSE (Server-Sent Events)

Easily use SSE for real-time streaming with the @stream decorator.

AI Agent Integration

Create Entities in natural language using AI chat in Sonamu UI.

🎬 Type 'Create an e-commerce order system' in Sonamu UI → 4 Entities auto-generated

Key Features:
  • ✅ Native pgvector support (vector search)
  • ✅ Seamless AI SDK integration (streaming)
  • ✅ Real-time events with SSE
  • ✅ Auto-generate Entities with AI Agent

Vector Search

Implement embedding search

SSE Streaming

Real-time event transmission

Seamless DX

Sonamu is designed with developer experience as the top priority.

HMR (Hot Module Replacement)

When you modify code, it’s instantly reflected without server restart. Whether you modify Entity, Model, or API, 2 seconds is all you need.
If you make 50 modifications a day? Traditional approach wastes 25 minutes, Sonamu takes only 1.7 minutes.

Sonamu UI

Define Entities, manage Subsets, and run Migrations directly in the web UI. No need to edit JSON manually.

🎬 Entity definition and management in Sonamu UI

Fast Feedback Loop

Entity change → Auto-generate types/schemas → Re-register APIs → Update frontend Services — everything is automatic. Key Features:
  • ✅ Develop without server restart using HMR
  • ✅ Visual Entity management with Sonamu UI
  • ✅ Syncer auto-synchronizes all code
  • ✅ Detect type errors immediately on change

Learn More

Seamless DX detail page

How HMR Works

Understand the HMR system

Sonamu UI

UI usage guide

Production Ready

Sonamu includes powerful features built for production environments.

BentoCache: Multi-Layer Caching

Easily use memory + Redis multi-layer caching.

Cache-Control: Response Caching

Set HTTP response caching strategies simply with decorators.

i18n: Type-Safe Internationalization

Entity title, prop.desc, and enumLabels are automatically extracted to the dictionary. Manage translations with the type-safe SD() function, and non-existent keys are caught at compile time.

Workflow: Complex Business Logic Management

Systematically manage complex multi-step business logic.

Built-in Performance Optimization

N+1 problem auto-resolution and query optimization are provided by default.
Key Features:
  • ✅ Multi-layer caching with BentoCache (memory + Redis)
  • ✅ HTTP response caching with Cache-Control
  • ✅ Type-safe internationalization with i18n
  • ✅ Complex business logic management with Workflow
  • ✅ N+1 problem auto-resolution

BentoCache

Multi-layer caching strategies

i18n

Internationalization system

Simple Example

The complete flow from defining an Entity to using it.
Note: Auto-generated files
  • api/src/application/sonamu.generated.ts - All types, schemas, Enums
  • web/src/services/sonamu.generated.ts - Frontend types (synchronized)
  • web/src/services/services.generated.ts - All Service methods
  • web/src/services/{entity}/{entity}.types.ts - Custom types (manually written)

1. Define Entity

🎬 Defining User Entity in Sonamu UI

2. Run Migration and Sync

Save Entity → Run Migration → pnpm sync: ✅ TypeScript types (sonamu.generated.ts)
✅ Zod schemas (BaseSchema, BaseListParams)
✅ DB migrations
✅ Frontend Service (services.generated.ts)
✅ TanStack Query Hooks

3. Write Business Logic in Model

4. Use Immediately in React

🎬 Complete flow: Entity definition → Migration → Model writing → Usage in React

Getting Started

3 minutes is all you need.

Quick Start

Create your first API in 5 minutes

Installation

Detailed installation guide

Core Concepts

Understand how Sonamu works

Development Workflow

Learn the development workflow

Community

GitHub

Issue reports and contributions

With Sonamu, developing in TypeScript becomes enjoyable.