This is an opinionated, robust template for backend development either for serverless or non-serverless using Node.js or SST (Serverless Stack) with Hono, Prisma, and Kysely. The project includes ESLint, Prettier, Husky, and lint-staged for code quality and consistency. It also features Vitest for testing, Swagger and Scalar for API documentation, and Docker for local database management. The template is set up with TypeScript for type safety and uses pnpm as the package manager.
- Please read the repo's Project Structure & Code Organization here README.project-structure.md
- For the coding standards, please read the rules in this folder rules
Choose the approach that best fits your needs:
Branch: main For a basic setup using just the Hono server:
npx degit constROD/template-hono-prisma-kysely
Branch: with-sst-v2 For a setup integrated with Serverless Stack (SST) v2 - AWS Provider:
npx degit constROD/template-hono-prisma-kysely#with-sst-v2
Branch: with-cloudflare For a setup integrated with Wrangler - Cloudflare Provider:
npx degit constROD/template-hono-prisma-kysely#with-cloudflare
Branch: with-jwt-auth For a setup with JWT authentication:
npx degit constROD/template-hono-prisma-kysely#with-jwt-auth
Choose the command that corresponds to your preferred API layer approach.
- Download extension ESLint and Prettier - Code formatter in your VSCode.
- Install node using nvm or fnm (check version in .nvmrc)
- Install pnpm (check version in package.json file look for
packageManager
) - Install Docker for database containerization.
- Install dependencies.
pnpm i
Development Mode:
- Start the database container.
pnpm db:start
- Stop the database container.
pnpm db:stop
- Start the development server.
pnpm dev
Production Mode:
- Build the project.
pnpm build
- Start the build for production.
pnpm start