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 |
Please read the features provided by this template first! π Challenges Solved
- 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@latestThe 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.mjsThe following items will be asked whether they are required when the project is initialized:
- Sample Application Code
- Dockerfile
- E2E Testing
- Observability feature
- Stripe
# enable corepack
$ npm run setup
# install deps
$ pnpm i
# create ".env" and modify environment variables
$ cp .env.sample .env$ pnpm dev-
Create a subscription here and get
price_id. -
Modify the environment variables. The test API key is here.
STRIPE_SECRET_KEY=
STRIPE_PRICE_ID=-
Install stripe CLI to bypass the webhook.
-
Execute the following command in another terminal.
$ pnpm dev:stripe- Add webhook signing secret like
whsec_...from the cli output to env file
STRIPE_WEBHOOK_SECRET=whsec_...
- After signing in, you can go to the
http://localhost:3000/me/paymentpage to see how to make a payment.
$ pnpm db:up
$ pnpm build
$ pnpm startThis 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:watchA build task must be executed before running tests to bypass JWT logic.
# install chrome
$ pnpm exec playwright install chrome
$ pnpm build
$ pnpm test:e2e
$ pnpm test:e2e:ui$ pnpm db:migrate
$ pnpm db:reset
# view the database items
$ pnpm db:studio