Skip to content
/ web-app-template Public template

A minimal template for web service app πŸŽƒ "npx create-app-foundation@latest" !

License

Notifications You must be signed in to change notification settings

hiroppy/web-app-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

️️A minimal template for web app πŸŽƒ

icon

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
nextjs
Next.js
tailwind
Tailwind CSS
next-auth
NextAuth.js
react-hook-form
React Hook Form
zod
Zod
otel
OpenTelemetry
prisma
Prisma
prisma
PostgreSQL
Tools
typescirpt
TypeScript
pnpm
pnpm
biome
Biome
prettier
Prettier
editorconfig
EditorConfig
lefthook
lefthook
docker
Docker
Testing
vitest
Vitest
testing-library
Testing Library
playwright
Playwright
testcontainers
Testcontainers
Others
actions
GitHub Actions
renovate
Renovate
vscode
VSCode
copilot edits
Copilot Edits

Prerequisites

  • Node.js v20 or higher
  • Docker

Installation

When installing the repository, you can skip the setup section, as the init script will do the equivalent of setup.

Using CLI (recommended)

$ npx create-app-foundation@latest

The CLI creates a project directory and run internal/init script so it's easy to get started.

Using GitHub Template

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

Setup

# enable git hooks and corepack
$ npm run setup
# install deps
$ pnpm i
# create ".env" and modifying environment variables
$ cp .env.sample .env

Development

$ pnpm dev

Production

$ pnpm db:up
$ pnpm build
$ pnpm start

Observability

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/

Test

Unit Test

$ pnpm test
$ pnpm test:watch

E2E Test

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

Database

# create new migration
$ pnpm db:migrate
# reset the DB
$ pnpm db:reset
# view the database items
$ pnpm db:studio

Links