tanstack-monorepo

Monorepo Template (WIP) using Turborepo, SST, Tanstack Router, Bun, Drizzle ORM

Stars
2
Committers
2

Turborepo Monorepo (Tanstack/Hono/SST/Drizzle)

Goals

  • Simplicity over complexity
  • Modularity
  • Taking a bet on the best "rising" libraries offering the best developer experience

Known Issues

See TODO.md for more details

Using this example

Add Environment Variables: Copy the .env.example file to .env and add your environment variables.

CLOUDFLARE_ACCOUNT_ID=<your-cloudflare-account-id>

Add new packages to the repo with Turborepo:

bun turbo gen workspace
# alternatively: `bun turbo gen workspace --type <app/package>` to specify the type of package to create

Update dependencies across the monorepo:

bunx taze -I -r
# or
bunx taze --interactive --recursive
bunx taze --include lodash,webpack # filter by package name

What's inside?

This Turborepo includes the following packages and apps:

Apps

  • api: A Hono server compatible with Cloudflare Workers
  • astro: A Astro for content-driven websites
  • spa: A Tanstack Router SPA

Packages

  • ui: React UI library initialized with Shadcn common components, tsconfig, and globals.css, which are exported to the spa app
  • typescript-config: tsconfig.json's used throughout the monorepo
  • core: Core package for business logic
  • db: Database package for Drizzle ORM

Each package and app is 100% TypeScript.

Utilities

This Turborepo has some additional tools already setup for you:

  • SST for Infrastructure as Code
  • Bun for package management, monorepo workspace, test runner
  • Biome for formatting & linting
  • TypeScript for static type checking
  • taze for updating dependencies across the monorepo

Other Utilities to Consider

Syncing Github Template

Refer to AndreasAugustin/actions-template-sync for a github action to sync the template. This repo uses the .github/workflows/template-sync.yml file to sync the template, which you can manually trigger the action from the Actions tab in Github. You can configure this to automatically sync with a cron schedule if you'd like.

Resources

Syncing Github Template Notes

Notes

Related Projects