Skip to content

JSONExpressDrop a JSON file. Get an API.

Stop rewriting your backend. JSONExpress is a modular Node.js framework that generates instant APIs from simple JSON. Scale to production with swappable Postgres adapters, Fastify transports, and built-in Identity management—without changing your code.

GitHub starsnpm downloadsLicenseTypeScript

The Ecosystem

Every capability ships as its own package — install only what you need, swap it out when your requirements change.

.db*.json[{},{},]

Persisting data doesn't always mean running a database. Covering how to store your collections as JSON files with atomic writes — so a crash mid-write never corrupts your data — when file-system persistence is the right choice, and how to graduate to a relational database without changing any application code.

Read more →
req / secBEFOREAFTER2.7×- adapter: 'express'+ adapter: 'fastify'// every route, schema, middleware preserved

The HTTP server is the innermost performance constraint in any API. Covering how to replace Express with Fastify's low-overhead request lifecycle, what throughput gains to expect in practice, and how a single config change migrates every route, schema, and middleware automatically without touching a line of application code.

Read more →
{ }RESTGETPOSTPUTDELGraphQLquery {{}}one model

GraphQL and REST serve different clients well, and you shouldn't have to choose between them. Covering how to generate a complete GraphQL schema from your existing model definitions, expose it alongside your REST endpoints, and inherit all your hooks, access rules, and validation — with no separate schema to write or maintain.

Read more →
derived from modelPOST{}z.object1 invalid4 valid422errors:path:code:msg:

Input validation is the first line of defence against malformed data reaching your business logic. Covering how to derive Zod schemas directly from your model's field definitions, validate every incoming write automatically, and return structured 422 errors with field-level detail — define your data shape once and get validation everywhere.

Read more →

Authentication is one of the most common reasons a backend project grows beyond a prototype. Covering how to add register, login, refresh-token rotation, password reset, and email verification to your API — backed by Argon2id password hashing, anti-enumeration on every endpoint, and JWKS support for Auth0, Firebase, and Cognito.

Read more →

API documentation that goes stale is worse than no documentation at all. Covering how to generate a complete OpenAPI 3.0 spec directly from your model definitions at boot time — no annotations to write, no spec files to maintain — and mount a live Swagger UI that stays automatically in sync as your schemas evolve.

Read more →
$cli db seed--rows 200 --seed 42nameemailcreated_atuuidABCD×200nameemaildateuuid

Realistic test data makes the difference between a demo that lands and one that doesn't. Covering how to populate your database with contextually correct fake data — names, emails, dates, UUIDs, and more — using a single CLI flag, and how to build reproducible CI fixtures and believable local development environments.

Read more →

Structured logging is a foundational practice for any production Node.js application. Covering what logs and loggers are, how log levels work, and how to set up pino — one of the fastest loggers in the Node.js ecosystem — with child loggers, pretty printing, and best practices for capturing the right data without leaking sensitive information.

Read more →

The Prototyping to Production Continuum

The biggest trap in backend development is throwaway code — tools that are great on day one but force a rewrite the moment your needs grow. JSONExpress is built around a single idea: every layer is an explicit, swappable dependency.

1

The Instant Mock API

Drop a JSON file and get a full CRUD API in seconds. No config, no TypeScript required. Real endpoints, real HTTP — just working.

2

TypeScript Schema Mode

When you need types, validation, and field-level security, define a defineModel() schema. REST and GraphQL are generated automatically. Nothing from step 1 changes.

3

The Replaceable Stack

Swap adapter-memory for adapter-json for file persistence. Add plugin-identity for full auth. Change one line in your config — your schemas and hooks never touch.

A Headless CMS Without Framework Lock-In

🔓

Not Tied to Next.js

Payload requires Next.js. JSONExpress works with any frontend — Vue, Svelte, React Native, vanilla HTML, or no frontend at all. Your backend is your backend.

🛠️

MIT, No Restrictions

Strapi and Directus have moved some features behind paid plans. JSONExpress is MIT licensed with no revenue caps, no feature gates, and no SaaS upsell.

🌍

Self-Host Anywhere

Deploy to a $5 VPS, a Kubernetes cluster, or AWS Amplify. No vendor lock-in, no cloud dependency. You own your data and your infrastructure.

How the Modular Architecture Works

One schema definition. Every layer is independently swappable.

Your Data
JSON file or TypeScript schema
↓ choose your database
Adapter Layer
adapter-memory
adapter-json
adapter-postgres ↗
adapter-mongo ↗
adapter-sqlite ↗
↓ choose your protocol
API Layer
api-rest
api-graphql
api-trpc ↗
↓ choose your server
Transport Layer
transport-express
transport-fastify
transport-h3 ↗

↗ on the roadmap  |  Swap any layer by changing one line in your config. Your schemas, hooks, and business logic never change.

Frequently Asked Questions

What makes JSONExpress different from json-server?

json-server is excellent for a 30-second prototype, but it stops there — no TypeScript schemas, no real authentication, no path to a production database. JSONExpress gives you the same zero-config start, and then lets you add persistence, auth, GraphQL, and real databases without rewriting anything. A db.json file from json-server is already valid input for JSONExpress.

How does the swappable database work?

Every database adapter implements the same IDatabaseAdapter interface from @json-express/core. Your schemas, hooks, and access control rules are defined against this interface — not against any specific database. Swap the adapter, and everything else carries over. There is no ORM magic, no migration scripts for the schema layer.

Is JSONExpress production-ready?

It is production-ready for solo developers and small teams who are comfortable managing their own infrastructure. The auth system (plugin-identity) is production-grade — Argon2id, refresh token rotation, JWKS, anti-enumeration. The two available database adapters (memory and JSON file) are suitable for low-to-medium traffic. Postgres and MongoDB adapters are on the roadmap.

Start in 30 Seconds

Install the boot preset, drop a JSON file, and you have a running API.

npm install @json-express/boot