Minimal, sensible defaults, fast.
Read the blog post about this template.
- Vite
- React with React Compiler enabled
- Tailwind
- fbtee for i18n
- Better Auth for authentication
- React Router
- TypeScript
- pnpm
- (Optional) Relay for data fetching -> check out the
with-relaybranch.
Check out the nkzw-tech/server-template for a GraphQL based server with Pothos and Prisma, or the nkzw-tech/expo-app-template for building mobile apps.
- Press the "Use this template" button on the top of this repository's GitHub page.
- Run
pnpm install(ornpm installif you don't usepnpm). - Run
pnpm dev:setup. pnpm devfor development.- Use
pnpm testto run tests. pnpm buildfor production builds.
Note: You can install pnpm via homebrew on macOS: brew install pnpm.
- Use
npm-run-all2to parallelize local test runs. - Prettier and eslint have
--cacheflags. Use them! - Do not run prettier inside of
eslint. It commonly takes 50% of the eslint runtime! - Automatically sort imports when running prettier/saving the document via
@ianvs/prettier-plugin-sort-imports. - Use
swcwithts-nodefor fast node scripts with ESM. See below ↓
You can simply remove everything related to Better Auth in the src/user directory.
Create a script.ts file, run chmod x script.ts and execute it via ./script.ts.
#!/usr/bin/env node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm
console.log('Your code goes here.');
Use this to restart your scripts instantly when a file changes:
#!/usr/bin/env NODE_ENV=development node --watch --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm
console.log('This processes instantly restarts when a file changes.');