This is an opinionated & minimalistic template for quickly starting new projects.
-
Frontend/backend folder structure:
- less nesting than other monorepo approaches.
- almost 0 additional configuration compared to separate frontend/backend repos.
- easy to swap out either frontend or backend for other, even non-typescript, tech.
- supports frontend/backend-specific vscode settings, linting, formatting, searching.
-
Domain Driven Design (DDD) oriented backend:
- highly modular, scales well with application complexity.
- more intuitive folder structure than grouping by responsibility e.g. src/models, src/controllers, etc.
-
Next.js (App Router) frontend:
- rapid development with file-based routing.
- clean, reusable components with shadcdn + tailwind.
-
GraphQL & Apollo Client:
- strongly typed API + automatic GQL validation and type hints with Apollo VSCode extension.
bun codegen
generates typesafe react hooks for executing queries, mutations, and subscriptions.- [TODO] dataloader for the n+1 query problem.
-
Docker:
- consistent dev environment.
- easy deployment anywhere, can deploy frontend and backend separately if necessary.
- simple to scale up and down.
-
ESLint, Prettier:
- standardized code style across entire the codebase.
- opinionated rules to enforce best practices and avoid common mistakes.
-
Firebase auth:
- easy to implement and integrate into projects.
From the root directory: cursor frontend && cursor backend
From the backend: bun infra
Alternatively if you don't want to use docker, you can run bun dev
in the frontend and backend directories.
To keep your project in sync with updates to this template, you can periodically run bun backend/bin/sync.ts
. Though due to the fact that starting a project using a template clears the git history, there is a heightened chance of a merge conflict occuring if your project has significantly diverged from the template.