A full-stack TypeScript application using TanStack Start, Elysia, React 19, and Bun.
Project Roadmap: See PLAN.md for detailed feature planning and progress tracking.
bun install
bun run dev| Command | Description |
|---|---|
bun run setup |
Run full project setup (recommended) |
bun run cleanup |
Clean up build/test artifacts |
bun run dev |
Start Vite dev server |
bun run build |
Build for production |
bun run start |
Run production server |
bun run lint |
Run oxlint with GitHub format |
bun run lint:ci |
Lint + format check (CI mode) |
bun run lint:fix |
Auto-fix lint issues and format |
bun run fmt |
Format code with oxfmt |
bun run fmt:check |
Check formatting without fixing |
bun run typecheck |
TypeScript type checking (tsgo --noEmit) |
bun run react:doctor |
React doctor diagnostics |
bun run changeset |
Create a changeset |
bun run prepare |
Install git hooks |
bun run test:unit |
Unit tests with Bun |
bun run test:e2e |
E2E tests with Playwright |
bun run test:load |
Load tests with k6 |
Run once after cloning the project to set up everything:
bun run setupWhat it does:
- Checks Bun runtime is installed
- Installs project dependencies
- Installs OpenCode LSP packages for enhanced IDE support
- Creates
.envfrom.env.example - Generates database schema and runs migrations
- Seeds the database with initial data
- Sets up git hooks
- Runs typecheck to verify setup
Options:
--skip-db- Skip database setup (if you want to set it up manually)
Clean up build artifacts, test results, and temporary files:
bun run cleanupOptions:
--dry-run- Show what would be deleted without actually deleting--keep-db- Preserve database files (.artifacts/*.db)--full- Full reset includingnode_modules(rarely needed)
Note: Executable files like
k9.exein.artifacts/are automatically preserved during cleanup. Before load test make sure to ran vite previewbun preview --host
Detailed documentation available in docs/:
| Document | Description |
|---|---|
| Agent Skills | AI agent skills and usage guide |
| API Reference | API endpoints and usage |
| Architecture | System architecture overview |
| Authentication | Auth setup and configuration |
| Development | Development guide |
| Docker | Docker deployment guide |
| Environment Variables | Environment configuration |
| Middleware | Middleware documentation |
| Opencode | Opencode documentation |
| Project Overview | Project introduction |
| Testing | Testing guide |
| Troubleshooting | Common issues and solutions |
- Framework: TanStack Start
- Server: Elysia
- Runtime: Bun
- UI: React 19 + TypeScript
- Styling: Tailwind CSS v4
- Validation: Zod v4
src/
├── config.ts # Central configuration (logger, rate-limit, cors, helmet)
├── env.ts # Isomorphic env fetching with type-safe validation
├── lib/ # Library code
│ ├── auth.ts # Better Auth instance
│ └── db/ # Database (Drizzle + SQLite)
│ ├── index.ts
│ └── schema.ts
├── logger.ts # Logger configuration
├── middlewares/ # Middleware implementations
│ ├── cors.ts # CORS headers
│ ├── helmet.ts # Security headers
│ ├── index.ts # Export barrel
│ └── rate-limit.ts # Rate limiting
├── router.tsx # TanStack Router configuration
├── routeTree.gen.ts # Auto-generated route tree
├── routes/ # File-based routing (TanStack Start)
│ ├── __root.tsx # Root route
│ ├── index.tsx # Home route
│ └── api/ # API routes
│ ├── $.ts # API catch-all route
│ └── auth/ # Auth routes (Better Auth)
│ └── $.ts
├── server.ts # TanStack Start server entry
├── types/ # TypeScript type definitions
│ └── subscription.ts
├── utils.ts # Utility functions
└── styles/
└── app.css # Global styles
vite.config.ts # Vite configuration
tsconfig.json # TypeScript configuration- Use oxfmt for code formatting (configured in
.oxfmtrc.json) - Run
bun run fmtbefore committing
- Uses oxlint with plugins:
unicorn,typescript,oxc - Configuration in
.oxlintrc.json
- Path alias:
~/*maps to./src/* - JSX mode:
react-jsx
- Components: PascalCase (e.g.,
RootDocument) - Files: kebab-case for routes (e.g.,
__root.tsx) - Utilities: camelCase (e.g.,
getRouter()) - Constants: SCREAMING_SNAKE_CASE
- Use path alias
~/*for src imports (e.g.,import appCss from "~/styles/app.css?url") - CSS imports require
?urlsuffix for Vite
- Functional components with TypeScript
- Use
createRootRoute,createRoutefrom@tanstack/react-router - Use
<Link>for navigation,<HeadContent />,<Scripts />in root layout - Include
<TanStackRouterDevtools>in development (bottom-right)
- Use
defaultErrorComponentanddefaultNotFoundComponentin router config - Return proper HTTP status codes in server handlers
- Tailwind CSS v4 with Vite plugin
- Import with
@import "tailwindcss";inapp.css
- Uses Zod v4 for runtime validation
- Prefer Zod schemas over custom validation logic
-
Pre-commit hooks run:
lint,typecheck,react:doctor -
Use changesets for version management:
bun run changeset # Create changeset bun run version # Update versions bun run release # Publish to npm
For more detailed troubleshooting guide, see Troubleshooting.
Common issues:
- If imports fail, ensure
bun installhas run - Path alias
~/*requires TypeScript paths configuration - CSS files must use
?urlsuffix for Vite's asset handling
For detailed agent coding guidelines, see AGENTS.md.
For feature planning and progress tracking, see PLAN.md.