Skip to main content
Use the create-sonamu package to create a new Sonamu project.

System Requirements

The following environment is required to use Sonamu:
  • Node.js v22 or higher
  • pnpm v10.23 or higher
  • Docker (for running the database)
If pnpm is not installed, you can enable it with the corepack enable command.
Checking Node.js, pnpm, Docker versions

Running node --version, pnpm --version, docker --version in terminal

Creating a Project

Run the following command in your terminal to create a new Sonamu project:

Inline Options

You can pass the project name as an argument or use options to skip interactive prompts:
In --pnpm y and --docker y, you can also use yes, true, or 1 instead of y. Similarly, n can be replaced with no, false, or 0.

Running pnpm create sonamu with inline options default values

When the interactive prompt appears, enter your project information:
1

Enter Project Name

Enter the name of the project to create. A directory will be created with this name.
Spaces and hyphens (-) cannot be used in the project name. Use underscores (_) instead.
2

pnpm Setup

Choose whether to automatically set up pnpm. This is the recommended option.
3

Database Setup

Choose whether to set up a PostgreSQL database using Docker. If you select Yes:
  • Docker Compose project name
  • Database username
  • Container name
  • Database name
  • Database password
will be requested, and the packages/api/.env file will be automatically generated with this information.
Project creation complete

Project creation completion message and generated directory structure

Generated Project Structure

create-sonamu creates the following monorepo structure:
VS Code Explorer sidebar

Directory tree structure of the project opened in VS Code

myapp
packages
pnpm-workspace.yaml (Workspace configuration)
README.md

Key Configuration Files

pnpm Workspace

The root pnpm-workspace.yaml manages monorepo packages and common dependency versions:
pnpm-workspace.yaml

API Server Entry Point

The entry point of the generated API server is as follows:
packages/api/src/index.ts file

packages/api/src/index.ts file opened in VS Code

Sonamu Configuration

Manage your project’s main settings in sonamu.config.ts:
packages/api/src/sonamu.config.ts

Docker Compose Configuration

PostgreSQL database is managed with Docker:
packages/api/database/docker-compose.yml

Frontend Configuration

A Vite + React + TanStack Router + SSR based application is generated:
packages/web/vite.config.ts

Port Configuration

Default ports are configured as follows:
  • Sonamu UI: Access via the API server’s /sonamu-ui path, not a separate port. - API server port: Modify the port constant in packages/api/src/sonamu.config.ts (in this case, also modify API_PORT in packages/web/.sonamu.env) - Web app port: Modify server.port in packages/web/vite.config.ts

Next Steps

Once installation is complete, follow the Quick Start guide to create your first entity and build an API.