StartXKit docs

Introduction

StartXKit is a TypeScript CLI toolkit for creating backend projects with clear framework and architecture choices.

StartXKit helps you create a backend project without deciding every folder, script, and starter file by hand.

It is similar in spirit to create-vite, but focused on backend APIs. You choose a framework, an architecture, and a few optional features. StartXKit writes a working TypeScript project that you can run, extend, and inspect.

What StartXKit Generates

  • A TypeScript backend project with package.json, tsconfig.json, and startxkit.config.json
  • A working health endpoint
  • Framework-specific server setup for Express, Fastify, or Hono
  • One of three architecture layouts: minimal, modular, or layered
  • Optional CORS, env config, Zod validation, Pino logging, error handling, Vitest, and Docker
  • A project CLI for adding modules after the project is created

The Big Picture

create command
  |
  v
choose framework + architecture + features
  |
  v
generated project
  |
  +-- run the API
  +-- add modules
  +-- inspect config with doctor/info

Framework Choices

FrameworkBest fit
ExpressFamiliar Node.js APIs, middleware-heavy apps, broad ecosystem
FastifyHigh-throughput APIs, plugin-based organization, built-in logger support
HonoSmall, fast APIs with a clean router model and lightweight runtime footprint

Architecture Choices

ArchitectureLayout styleBest fit
MinimalFlat route filesPrototypes, small APIs, simple services
Modularsrc/modules/users/...Feature-based APIs where each module owns its files
Layeredsrc/routes, src/controllers, src/services, ...Larger APIs that need strict separation by responsibility

First Command

npm create @startxkit@latest

After generation:

cd my-api
pnpm dev

Then open the health endpoint. With the default prefix, it is:

http://localhost:4000/api/v1/health
  • Start with Getting Started if you are creating your first project.
  • Read add module when you want to add users, auth, products, or another feature.
  • Read the architecture pages if you are choosing between minimal, modular, and layered.