This repository is a Bun workspace monorepo containing shared packages and deployable applications.
workspace/
├── apps/
│ ├── frontend/ # Next.js 16 app (React 19, Tailwind)
│ └── backend/ # Hono API (Bun runtime)
├── packages/
│ └── shared/ # @cssg/shared – shared code (TS, used by frontend & backend)
├── package.json # Root workspace config and scripts
├── tsconfig.base.json # Shared TypeScript base config
├── eslint.config.mjs # Root ESLint (backend + packages; frontend has its own)
└── .prettierrc # Shared Prettier config (Tailwind plugin)
| Path | Package name | Purpose |
|---|---|---|
apps/frontend |
frontend |
Next.js app (React, Tailwind). Depends on @cssg/shared. |
apps/backend |
backend |
Hono HTTP API run with Bun. Depends on @cssg/shared. |
packages/shared |
@cssg/shared |
Shared TypeScript utilities/types. No app-specific deps. |
- Root
package.jsondefines"workspaces": ["packages/*", "apps/*"]. Dependencies are hoisted where possible. - Shared code: Add types, utils, or constants in
packages/sharedand depend on it with"@cssg/shared": "workspace:*"in an app’spackage.json, then runbun installfrom the repo root. - TypeScript: All packages extend
tsconfig.base.json; apps add their own options (e.g. Next.js in frontend, Hono in backend). - Linting: Root ESLint covers backend and
packages/shared;apps/frontenduses its own ESLint config (Next.js + Prettier). - Formatting: Prettier is configured at root (with Tailwind plugin); each app/package has
formatandformat:checkscripts.
Run these from the repository root unless noted.
| Command | Description |
|---|---|
bun run dev:all |
Start all workspaces that have a dev script (frontend + backend). |
bun run dev:frontend |
Start only the Next.js app (apps/frontend). |
bun run dev:backend |
Start only the Hono backend (apps/backend). |
From a single app:
cd apps/frontend && bun run dev– Next.js dev server.cd apps/backend && bun run dev– Backend with Bun hot reload.
| Command | Description |
|---|---|
bun run lint:all |
Run lint in every workspace that defines it. |
bun run lint:frontend |
Lint frontend (Next.js ESLint config). |
bun run lint:backend |
Lint backend (root ESLint config). |
bun run lint:shared |
Lint @cssg/shared (root ESLint config). |
| Command | Description |
|---|---|
bun run format:all |
Run format in every workspace (writes formatted files). |
bun run format:check |
Check formatting for the whole repo (CI-friendly; no write). |
bun run format:frontend |
Format only apps/frontend. |
bun run format:backend |
Format only apps/backend. |
bun run format:shared |
Format only packages/shared. |
| Command | Description |
|---|---|
bun run test:all |
Run test in every workspace that defines it. |
bun run test:backend |
Run backend tests. |
bun run test:shared |
Run shared package tests. |
From a single app/package:
cd apps/backend && bun testcd packages/shared && bun test
- In the app’s
package.json, add:(e.g. under"@cssg/shared": "workspace:*"
dependencies). - From the repo root, run:
bun install
- Import in code, e.g.:
import something from "@cssg/shared";
Do not use bun add @cssg/shared from the app directory; that will try to install from npm. Use the workspace:* dependency and bun install at root.
| Tool | Scope | Config |
|---|---|---|
| Bun | Install, run scripts, run backend | Root + per-package package.json |
| TypeScript | All packages | tsconfig.base.json + per-package tsconfig.json |
| ESLint | Backend + shared (root); frontend (own) | Root eslint.config.mjs; apps/frontend/eslint.config.mjs |
| Prettier | Whole repo | Root .prettierrc (Tailwind plugin), .prettierignore |