Skip to content

luastoned/fastpi

Repository files navigation


⚡ FastPI

A pragmatic Fastify + TypeScript starter for modular Node.js services

License Node.js 20+ Fastify TypeScript strict

FeaturesStackQuick StartScriptsArchitectureLicense


✨ Features

  • 🚀 Fastify-first — Keeps the HTTP layer concrete, typed, and easy to replace or extend.
  • 🧱 Modular monolith baseline — Starts with explicit domains, logic, platform, and utilities boundaries without forcing premature structure.
  • 🦾 Strict TypeScript — Uses strict compiler options, path aliases, ESM, and modern Node.js assumptions.
  • 🔧 Modern tooling — Ships with Oxfmt, Oxlint, TypeScript checks, esbuild bundling, and Docker helpers.
  • 🌱 Starter-friendly — Lightweight scaffolding leaves the first real feature free to define the first real domain.

📦 Stack

Tool Purpose
Fastify HTTP server and plugin runtime
TypeScript Strict application and config typing
esbuild Production Node.js bundle
Oxfmt Formatting and import organization
Oxlint Fast static linting
Pino Structured logging

🚀 Quick Start

Create a new project from the starter:

npx degit luastoned/fastpi app-name
cd app-name
git init
yarn
yarn dev

The development server listens at http://localhost:42000 by default.

🧰 Scripts

Command Purpose
yarn dev Start the server with hot reload
yarn build Typecheck and bundle src/app.ts to dist/
yarn serve Run the bundled output with Node.js
yarn start Run the TypeScript source directly with TSX
yarn check:all Run typecheck, lint, and format check
yarn typecheck Run TypeScript without emitting files
yarn lint Run Oxlint
yarn lint:fix Run Oxlint with fixes
yarn format Format with Oxfmt
yarn format:check Check formatting with Oxfmt
yarn docker Build and run the Docker image locally

🏗️ Architecture

FastPI follows a pragmatic modular-monolith structure:

Path Ownership
src/app.ts Process lifecycle, startup, shutdown, errors
src/config.ts Application-facing runtime config
src/domains/* Business capabilities and business rules
src/logic/* Cross-domain workflows once they exist
src/platform/* Fastify transport and future infrastructure
src/utilities/* Technical helpers with no business ownership

The current starter keeps only src/platform/fastify concrete. Everything else is intentionally lightweight so the first real feature can define the first real domain boundary cleanly.

See docs/architecture.md for growth guardrails and dependency direction.

🐳 Docker

Build and run the app locally:

yarn docker

The container exposes FastPI on port 42000.

📄 License

MIT License © 2024-PRESENT LuaStoned

About

A pragmatic Fastify + TypeScript starter for modular Node.js services

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors