This repo is a TypeScript monorepo built around vite-plus for workspace orchestration, builds, linting, and package workflows.
apps: runnable applications such asdemo-bloganddemo-apppackages: shared workspace packages such asapi,auth,db, anduitooling: internal generators and shared tooling
- Pre-commit hooks run automatically on staged files.
- Create new packages via
vpr new:package. - Run
vp check --fixto apply lint and format fixes. - Workspace builds and tasks are orchestrated with
vite-plus.
Environment variables are managed with dotenvx and layered like this:
.env.production # production builds
.env # preview builds and shared local defaults
.env.local # local-only overridesSet a variable in the root .env file:
vpr env:set <VARIABLE_NAME> <VALUE> #defaults to .envTarget a specific file with -f:
vpr env:set <VARIABLE_NAME> <VALUE> -f .env.production.env.local and .env.key are ignored by Git. Feel free to add values in .env.local without going through the CLI.
By default, dotenvx encrypts values so they can be shared safely across the team.
-
Install workspace dependencies:
vp install # shorthand: vp i -
Push the default schema to the local database:
docker compose up -d # Spin up the database vp run db#push -
Configure
.envvariables.Required for local setup:
VITE_BLOG_URL: public URL for the marketing siteVITE_APP_URL: public URL for the demo appDATABASE_URL: database connection stringVITE_AUTH_EMAIL_VERIFICATION_TYPE: email verification mode for password auth, currentlycodeortokenAUTH_ENCRYPTION_KEY: auth encryption key, minimum 32 charactersAUTH_FROM_EMAIL: sender address for auth emails
Optional auth providers:
AUTH_DISCORD_IDandAUTH_DISCORD_SECRETAUTH_GITHUB_IDandAUTH_GITHUB_SECRETAUTH_REDDIT_IDandAUTH_REDDIT_SECRETAUTH_GOOGLE_IDandAUTH_GOOGLE_SECRET
-
Start the demo-blog app:
vpr dev:demo-blog
-
Start the demo-app app:
vpr dev:demo-app
The main development entrypoints are:
vpr dev:demo-blog
vpr dev:demo-appWorkspace builds are exposed through vite-plus tasks at the repo root:
vp run build:preview
vp run build:productionTo build individual apps directly:
vp run www#build:preview
vp run www#build:production
vp run demo-app#build:preview
vp run demo-app#build:productionThis repository includes a GitHub Action for automated deployments to Cloudflare.
The workflow:
- deploys preview environments for pull requests
- deploys production on pushes to
main - supports manual preview and production deploys from GitHub Actions
- deploys both apps in the same run
Configure these repository secrets in GitHub:
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKENDOTENV_PRIVATE_KEYDOTENV_PRIVATE_KEY_PRODUCTION
When adding new deployable apps, update .github/workflows/cloudflare.yml so build, deploy, preview comments, and cleanup stay in sync.
This repository was originally inspired by create t3 turbo.