From Zero to Service, Build with Best Practices, Minimal Code, and Essential Tools
π Read The Docs π
Installing this template automatically sets up the following libraries/tools. By saving you significant effort, it allows you to focus entirely on writing your product code.π€
App | ||||
Tools | ||||
Testing | ||||
Others |
- Node.js v20 or higher
- Docker
When installing the repository, you can skip the setup section, as the init script will do the equivalent of setup.
$ npx create-app-foundation@latest
The CLI creates a project directory and run internal/init script so it's easy to get started.
This repo is a GitHub template, so click the "Use this template" button to create your repo. Then, you need to execute the below to finish setting it up.
$ node .internal/setup/init.mjs
# enable git hooks and corepack
$ npm run setup
# install deps
$ pnpm i
# create ".env" and modifying environment variables
$ cp .env.sample .env
$ pnpm dev
$ pnpm db:up
$ pnpm build
$ pnpm start
This template uses Jaeger as a tracing platform. The local environment doesn't require TRACE_EXPORTER_URL
environment value.
# open Jaeger
$ open http://localhost:16686/
$ pnpm test
$ pnpm test:watch
A build task must be executed before running tests to bypass JWT logic.
# install chrome
$ pnpm exec playwright install chrome
# build using test environments since it needs to change encode/decode functions of next-auth
$ pnpm build:test
$ pnpm test:e2e
# execute with UI
$ pnpm test:e2e:ui
# create new migration
$ pnpm db:migrate
# reset the DB
$ pnpm db:reset
# view the database items
$ pnpm db:studio