A production-ready Nitro.js starter template with PostgreSQL database integration using Drizzle ORM.
- ⚡ Nitro.js - Full-stack framework for building universal web applications
- 🗄️ PostgreSQL - Powerful relational database
- 🛠️ Drizzle ORM - Type-safe ORM with excellent developer experience
- 📝 TypeScript - Full TypeScript support out of the box
- 🎨 Code Quality - Pre-configured Prettier and Oxlint
- 🔍 Health Checks - Built-in health monitoring endpoints
- 📦 pnpm - Fast, disk space efficient package manager
-
Clone the repository
pnpm dlx gitget xcvzmoon/kickstart-nitro my-nitro-app cd my-nitro-app -
Install dependencies
pnpm install
-
Configure your database
cp .env.example .env
If you don't want to use the default PORT (3000), set the following variable:
NITRO_PORT
Set up your PostgreSQL database and update the environment variables. The runtime configuration expects these database settings:
NITRO_DB_HOSTNITRO_DB_PORTNITRO_DB_DATABASENITRO_DB_USERNAMENITRO_DB_PASSWORDNITRO_DB_SSL
-
Generate and push database schema
pnpm db:generate pnpm db:push
-
Start development server
pnpm dev
-
Open your browser
Visit
http://localhost:3000to see your application running.
pnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production build locallypnpm format- Format code with Prettierpnpm lint- Lint and fix code with Oxlintpnpm db:generate- Generate database migrationspnpm db:push- Push schema changes to databasepnpm db:pull- Pull schema from databasepnpm db:studio- Open Drizzle Studiopnpm db:check- Check database schema
├── server/
│ ├── config/
│ │ └── database.ts # Database configuration
│ ├── database/
│ │ └── index.ts # Database connection and exports
│ └── routes/
│ ├── index.ts # Main route handler
│ └── health/ # Health check endpoints
│ ├── index.get.ts # Basic health check
│ └── ready.get.ts # Readiness probe
├── drizzle.config.ts # Drizzle ORM configuration
├── nitro.config.ts # Nitro configuration
└── package.jsonThe application includes built-in health monitoring:
- GET
/health- Basic health check with uptime and memory usage - GET
/health/ready- Readiness probe for deployment orchestration
This starter uses Drizzle ORM for database management:
- Schema definition: Define your database schema in
server/database/schemas/ - Migrations: Generated automatically with
pnpm db:generate - Studio: Visual database browser with
pnpm db:studio