1.3.0Release notes

The modern full-stack framework for TypeScript.

Routes, database, auth, queues, mail and pages in one TypeScript framework. One type runs from the column to the form, and every page renders on the server first.

pnpm create marmeon my-app

MIT licence · Node 26.10+ · No transpile step

packages, released as one version
30
layers where a typo is a compile error, from the migration to the form error
7
fakes that come with createTestApp()
9
MCP tools your coding agent can call
12

Everything your app needs, already wired together.

  • Installed packages register themselves
  • Mail, the queue, storage and the schedule each have a fake for tests
  • pnpm dev starts the server, and next to it the queue worker and the scheduler your app uses

Auth and policies

Sign-in, password reset, email verification and API tokens. Policies stand next to the route, and a misspelt ability does not compile.

modules/user-profile/policies/ProfileLinkPolicy.ts

type OwnedLink = Pick<Row<'profile_links'>, 'user_id'>;

export class ProfileLinkPolicy {
  delete(user: AuthUser, link: OwnedLink) {
    return link.user_id === user.id || deny('user-profile.validation.own_profile');
  }
}

@marmeon/authAuthorization

Database and migrations

Tables are declared in migrations, and the table types are generated from them. A transaction rolls back when the code returns an err.

notestable
idid
user_idforeign → users
titlestring(120)
bodytext
pinnedboolean
timestampscreated · updated

@marmeon/databaseMigrations

Queue

Jobs as classes, workers and retries. The worker starts with the dev server.

  • SendPasswordResetLinkJobdone · 96 ms
  • SendWelcomeMailJobrunning
  • RebuildMemberStatsJobretry 2 of 5

@marmeon/queueQueues

Mail

A mail is a class with a React view, written in MJML components with translated text, and a fake for tests.

To ada@example.comSubject Confirm your e-mail address

@marmeon/mailMail

Validation

Rules with messages in the request's language. Errors are typed down to the field.

The title field must not be longer than 120 characters.

@marmeon/validationValidation

Live

A page follows a channel. When a write hints it, the other open tabs reload the props both of them name: the hint says that something changed, never what.

user-profile/Show
  • Website
  • Mastodon
  • Newsletter

hint users.<public_id>reloads profile

@marmeon/liveReal-time updates

Scheduler

Scheduled tasks in code, next to the module they belong to.

  • 03:10auth:prune-tokens
  • hourlyRebuildMemberStatsJob
  • every 15 minsession:prune

@marmeon/schedulerTask scheduling

Modules

A module brings its routes, providers, migrations, views and tests.

modules/notes/
  • routes.ts
  • controllers/
  • views/
  • migrations/
  • policies/
  • notes.test.ts
  • index.ts

@marmeon/coreModules and discovery

Storage

Disks on the server, in S3 or in memory, signed links that expire, and uploads.

  • local
  • s3

exports/user-7.json · signed for 5 min

@marmeon/storageFile storage

Cache

A value under a key for a time to live, counters that expire, and locks.

member-stats 300 s
  • hit: the stored numbers
  • miss: counted again, stored for 300 s

@marmeon/cacheCache

Notifications

A notification is a class: its data, the channels it takes and what it says on each. A worker delivers it.

auth.new-sign-inNewSignInNotification
  • database in the bell

    New sign-in to your account

    From 203.0.113.7 · Firefox · macOS

  • live in open tabs

    The bell and the list reload

  • mail subject, to a confirmed address

    A new sign-in to Marmeon

@marmeon/notificationsNotifications

Localization

Texts by key in each language the app ships, picked per request, with numbers and dates formatted for the locale.

auth.verify.title
en
Confirm your e-mail address
de
E-Mail-Adresse bestätigen
en
format.number(1234.5) 1,234.5
de
format.number(1234.5) 1.234,5

@marmeon/i18nLocalization

All packages

Your business logic gets a home.

Marmeon is a full-stack TypeScript framework, from the database to the React page. Who may open a record, what happens after a sign-up, which failure a caller must handle: each has its place in a module on the server, as code you can read, test and review.

  • Your app grew past its pages.

    You know this
    It started with pages. Then came background jobs, mail, a nightly task and permissions, each with its own tool and its own setup, and the logic spread across request handlers.
    With Marmeon
    Jobs, mail, scheduled tasks, policies and migrations are part of the framework and work together. pnpm dev starts the server, a queue worker and the scheduler together, and every React page still renders on the server first.Running the app
  • You know structure. Now you write TypeScript.

    You know this
    You come from a language where every task has its place and a command that writes the first file. In TypeScript, each project assembles its own stack, and no two are laid out alike.
    With Marmeon
    Every app has the same layout: modules, one class per endpoint, make:* generators and a starter kit with sign-in built in. One type runs from the migration to the form error.Directory Structure
  • Your backend lives in the database.

    You know this
    Sign-in, tables and file storage were running in an afternoon. Now the product is real, and its rules are spread over access policies in the database, its functions and the client.
    With Marmeon
    The rules live in TypeScript on the server, one module per feature. Policies stand next to the route, a misspelt ability does not compile, and a transaction that returns an err rolls back.Authorization
  • Many projects, and agents writing along.

    You know this
    You look after many apps for years. People come and go, part of the code is written by an agent, and each project has to be learnt again before anyone trusts a change.
    With Marmeon
    Know one app and you know them all: the same structure everywhere, tests through the whole kernel. A route that does not say who may call it does not start, and neither does an open route that loads records by id.Every route decides

Not the right fit for a static site: pages built once and served as files, with nothing to run on a server.

A typo anywhere is a compile error.

The notes table is declared once, in a migration. The same type travels through the repository, the controller, the route name and the page, down to the error under a form field.

  1. 1 / 7 Migration

    modules/notes/migrations/2026_10_01_120000_create_notes_table.ts

    compiles
    table.foreignId('user_id').constrained('users').cascadeOnDelete();
    table.string('title', 120);
    table.text('body');
    table.boolean('pinned').default(false);
    table.timestamps();
    table.index('user_id');

    1. Migration

    The source of truth. Table types are generated from the migrations, never from a live database.

    Docs: Migrations

    This does not compile

    table.strng('title', 120);

    error TS2551: Property 'strng' does not exist on type 'Blueprint'. Did you mean 'string'?

  2. 2 / 7 Row

    modules/notes/types.ts

    compiles
    import type { NewRow, Row, RowUpdate } from '@marmeon/database';
    
    export type Note = Row<'notes'>;
    export type NewNote = NewRow<'notes'>;
    export type NoteChanges = RowUpdate<'notes'>;

    2. Row

    Every column of the table, typed. Repositories, controllers and pages all use this one type.

    Docs: Table types

    This does not compile

    export type Note = Row<'ntoes'>;

    error TS2344: Type '"ntoes"' does not satisfy the constraint 'keyof Tables'.

  3. 3 / 7 Repository

    modules/notes/NoteRepository.ts

    compiles
    const query = this.query()
      .select(['id', 'title', 'body', 'pinned'])
      .where('user_id', '=', userId)
      .orderBy('pinned', 'desc')
      .orderBy('updated_at', 'desc')
      .orderBy('id', 'desc');
    return this.paginate(query, page);

    3. Repository

    Kysely's query builder: every name is checked against the table's type. Rows in, rows out.

    Docs: Queries

    This does not compile

    .where('user_ud', '=', userId)

    error TS2345: Argument of type '"user_ud"' is not assignable to parameter of type 'ReferenceExpression<Tables, "notes">'.

  4. 4 / 7 Controller

    modules/notes/controllers/ShowNoteController.ts

    compiles
    return this.view('notes/Show', { note: ctx.params.note });

    4. Controller

    The route binds the note before handle() runs. A missing one is a 404.

    Docs: Route model binding

    This does not compile

    return this.view('notes/Show', { note: ctx.params.nte });

    error TS2551: Property 'nte' does not exist on type '{ note: { body: string; created_at: string; id: string; pinned: boolean; title: string; updated_at: string; user_id: number; }; }'. Did you mean 'note'?

  5. 5 / 7 Route

    modules/notes/views/Show.tsx

    compiles
    <Link route="notes.index">All notes</Link>

    5. Route

    Pages link to routes by name. A name that does not exist does not compile.

    Docs: Routing

    This does not compile

    <Link route="notes.indx">All notes</Link>

    error TS2322: Type '"notes.indx"' is not assignable to type '"'notes.indx' is not a route name — did you mean notes.index?"'.

  6. 6 / 7 Props

    modules/notes/views/Show.tsx

    compiles
    <Head title={note.title} />
    <h1>{note.title}</h1>
    <Link route="notes.index">All notes</Link>

    6. Props

    The page takes its prop types from the controller that renders it.

    Docs: Pages

    This does not compile

    <h1>{note.titel}</h1>

    error TS2551: Property 'titel' does not exist on type '{ body: string; created_at: string; id: string; pinned: boolean; title: string; updated_at: string; user_id: number; }'. Did you mean 'title'?

  7. 7 / 7 Form error

    modules/notes/views/Form.tsx

    compiles
    {form.error('title') && <small role="alert">{form.error('title')}</small>}

    7. Form error

    The form knows its method, URL and field types from the route name, so its errors are typed too.

    Docs: Forms

    This does not compile

    {form.error('titel') && <small role="alert">{form.error('title')}</small>}

    error TS2345: Argument of type '"titel"' is not assignable to parameter of type '"_" | "body" | "title"'.

See what a request did.

Requests, queries, jobs and mails, recorded in development with secrets redacted, in a bar on every page and on a page of its own. Production has none of it. Try the copy below; its data is invented. Read the devtools page

Devtools · localhost:3000

DEVELOPMENT

Requests

TimeMethodPathStatusDurationRouteAnswer
10:41:07.212GET/guests20018 msguests.indexGuests/Index
10:41:09.540POST/guests30341 msguests.store
10:41:09.611GET/guests/720012 msguests.showGuests/Show
10:41:15.034DELETE/guests/74034 msguests.destroy

Queries

TimeStatementDurationOrigin
10:41:07.220select * from guests order by id desc limit 502.1 msrequest 5d1c9a02
10:41:07.224select count(*) from guests0.8 msrequest 5d1c9a02
10:41:09.552insert into guests (name, email) values (?, ?)1.4 msrequest 7be40f13
10:41:09.618select * from guests where id = ?0.6 msrequest c28a6e71

Jobs

TimeJobStatusQueueAttemptDurationOrigin
10:41:09.560SendWelcomeMailqueueddefault/mailrequest 7be40f13
10:41:09.904SendWelcomeMaildonedefault/mail1120 msrequest 7be40f13
10:41:12.310SyncGuestListreleaseddefault/sync1340 msrequest 7be40f13
10:41:20.118PruneOldGuestsfaileddefault/default385 ms

Mails

TimeMailSubjectToModeOrigin
10:41:09.556WelcomeMailWelcome to the guest listada@example.comqueuerequest 7be40f13
10:41:09.902WelcomeMailWelcome to the guest listada@example.comworkerjob 0f3a91c4

Logs

TimeLevelMessageOrigin
10:41:09.548infoGuest 7 createdrequest 7be40f13
10:41:09.600infoSession resumed session_id=[redacted]request c28a6e71
10:41:07.231warnSlow query: 212 msrequest 5d1c9a02
10:41:20.120errorPruneOldGuests failed, retryingjob 9c71d0aa

Exceptions

TimeExceptionMessageWhereOrigin
10:41:20.119TimeoutErrorPruning did not finish within 5 sjobjob 9c71d0aa
10:41:15.036ForbiddenErrorOnly an admin may remove a guestrequest 403 /guests/7request e4a0b5d6

Marmeon devtools bar

Visits

KindRequestStatusTimeDetails
documentGET /20023 msLanding
islandGET /islands/render-clock2006 msonly clock

Page

Page: Landing

PropsSize
version8 B
viewer1.1 kB

Layers & regions

Page: Landing /

IslandStatusViewSize
/islands/render-clockreadysite/islands/RenderClock312 B

Optimistic

No optimistic patches yet (useAction, router.optimistic, a form with optimistic).

Server

GET / → 200 in 23 ms · route home · Landing · SSR 9 ms

Queries (1)

  • 0.6 ms · select slug, title from pages where slug = ?

Log (1)

  • info · Landing rendered

SSR

Server rendering of this document

Landing: 9 ms

Hydration (0)

No hydration errors — the server’s markup matched.

Your coding agent sees what you see.

It reads the app's real routes, the last server error and the docs of exactly the installed version instead of guessing. The MCP server starts only in development, and its tools look things up: none of them edits your code, and the one file they keep current is the generated .marmeon/schema.json.

TERMINAL
pnpm marmeon agents:install
✓ Wrote .claude/skills/marmeon-debugging/SKILL.md.
✓ Wrote .claude/skills/marmeon-feature-module/SKILL.md.
✓ Wrote .claude/skills/marmeon-migration/SKILL.md.
✓ Wrote .claude/skills/marmeon-page/SKILL.md.
✓ Wrote .claude/skills/marmeon-security-review/SKILL.md.
✓ Wrote .claude/skills/marmeon-testing/SKILL.md.
✓ Wrote .mcp.json.
✓ Updated the block of AGENTS.md.
Your agent asks you to approve the server marmeon the next time it starts.

agents:install sets up Claude Code. Cursor and Copilot read the same skills, Codex with --shared, and each takes the server with one entry in its config. Coding agents · MCP server

Skills 6

  • marmeon-debuggingFind out why the app fails before any code changes.
  • marmeon-feature-moduleAdd a feature as a module, with a policy and a test.
  • marmeon-migrationChange the schema and keep its types current.
  • marmeon-pageA page with a form that works without JavaScript, and an island that loads by itself.
  • marmeon-security-reviewReview a change for security and report file and line.
  • marmeon-testingFeature tests, fakes and a refused request for every route.

MCP tools 12

  • routesEvery route with its middleware and who may call it.
  • last_errorThe last 5xx error of the dev server.
  • docs_searchSearch the docs of the installed version.
  • docs_readRead a docs page or one section of it.
  • checkThe report of marmeon check.
  • schemaTables, columns and keys the migrations describe.
  • devtools_entriesRequests, queries, jobs and mails the devtools recorded.
  • migrationsWhich migrations ran and which are pending.
  • databaseTables of a connection with their column and row counts.
  • commandsEvery marmeon command with its options.
  • app_overviewModules, providers, events and schedules.
  • queryOne read-only SQL query on the development database.

Secure when nobody changes a default.

Security overview
  • Fails closed

    In production, and on a server where nobody set NODE_ENV, protections stay on.

    Security Overview
  • CSRF protection

    Every request of the web group that may change something is checked, and a request from another site is refused.

    CSRF Protection
  • Strict Content-Security-Policy

    Every new app turns on a policy with a fresh nonce for each document. The framework renders no style attributes, so styles need no 'unsafe-inline'.

    Content Security Policy
  • Signed-in pages are never cached

    Answers for a signed-in user are sent no-store and private.

    Authentication
  • Page data stays out of browser storage

    A history entry never holds the page props, and nothing a user saw is written to the browser storage.

    Navigation
  • Devtools only in development

    And even there, behind a host guard that refuses every unknown host.

    Security Overview

A test goes through the whole kernel.

Sign in, visit the page, check what it renders and with which props. The session is included, and the database is migrated and empty for each test. Testing pages

modules/notes/show.test.ts
it('shows a note to its author', async () => {
  const app = await createTestApp(application, { database: 'refresh' });
  const ada = await app.factory(UserFactory).create();
  const note = await app.make(NoteRepository).insert({ user_id: ada.id, title: 'Groceries', body: 'Milk' });
  await app
    .actingAs(ada)
    .navigating()
    .get(`/notes/${note.id}`)
    .assertOk()
    .assertPage<ShowNoteController>('notes/Show', { note: { title: 'Groceries' } });
});

A fake for each

  • Mail
  • Queue
  • Notifications
  • Chat
  • HTTP
  • Storage
  • Events
  • Live updates
  • Schedule
Fakes

A part of the page that loads on its own.

An island is the view of another route, with its own controller, middleware and query. The one under the code is live: the server renders it, and the browser reloads only this region every ten seconds.

ShowRenderClockController.ts

export class ShowRenderClockController extends Controller {
  handle() {
    return this.island('site/islands/RenderClock', { renderedAt: new Date() });
  }
}

IslandSection.tsx

const clock = (
  <Island
    route="site.render-clock"
    load="visible"
    pollMs={10_000}
    fallback={<p className="island-fallback">With JavaScript, the browser loads an island here: a part of the page the server renders on its own.</p>}
    className="island-frame"
  />
);

With JavaScript, the browser loads an island here: a part of the page the server renders on its own.

What Marmeon stands for.

The principles every part of the framework follows.

  1. Typed end to end

    From the database column through the controller, validation and route names to the form error in the React component.

  2. No global state

    No facades, no singletons holding request data: one application, a scope per request or job.

  3. TypeScript runs natively on Node

    No transpile step, no decorators.

  4. Modules first

    A module brings its routes, providers, migrations, views and tests; installed packages register themselves.

  5. One endpoint, one class

    Controllers, jobs, listeners, commands, mails and policies are classes with handle().

  6. Batteries included, behind contracts

    Mail, the queue, notifications, storage, events, live updates and the schedule each have a fake for tests.

  7. Secure by default

    In production, and wherever nobody set the environment, protections stay on.

30 packages, one version.

Released together and wired to each other. All packages

In every new app 21

Add when you need it 5

Dev tools 4

@marmeon/vite, @marmeon/testing and @marmeon/devtools are in every new app's dev dependencies; create-marmeon starts a new app.

Three commands to a running app.

The starter kit brings sign-in and registration, a home page, devtools, oxlint and Vitest. SQLite runs in a file, so no database server is needed. --minimal creates a blank app; --docker adds container files. The app answers on http://localhost:3000.