Install dependencies with Bun, then run the dev
script in all packages (where a dev
script exists)
bun install
bun run all:dev
.
└── packages/ - Any new projects belong here
├── add/ - Package configured to be published to npm
├── db/ - Database schemas and scripts
├── elysiajs/ - Backend with ElysiaJS (web framework)
├── env/ - Type-safe environment variables
└── nextjs/ - Frontend with Next.js (web framework)
-
To Railway - deploy
packages/elysiajs
(using Docker) -
To Vercel - deploy
packages/nextjs
- see the Railway template for required environment variables (including NODE_ENV=production)
Any environment variables in packages/<package>/.env
are available to the package (thanks to Bun)
If not already present in the package, add the workspace env package and install the new dependency
"dependencies": {
+ "env": "workspace:*"
}
bun install
Import environment variables (schema defined in packages/env/index.ts)
import { env } from 'env';
const PORT = env.PORT; // PORT: number