Project Structure#
csharpstackflare/
├── src/
│ ├── routes/ # Pages + API Server Routes (TanStack Start file-based routing)
│ │ ├── en/ # English marketing pages
│ │ ├── zh/ # Chinese marketing pages
│ │ ├── _app/ # Authenticated dashboard
│ │ │ ├── dashboard/
│ │ │ ├── profile/
│ │ │ ├── subscription/
│ │ │ ├── credits/
│ │ │ ├── invoices/
│ │ │ └── owner/ # Admin panel (owner only)
│ │ └── v1/ # API Server Routes
│ ├── components/ # Frontend components
│ ├── lib/ # Frontend utilities
│ │ ├── http.ts # HTTP client
│ │ ├── auth.ts # Token management
│ │ └── stores/ # Zustand stores
│ ├── hooks/ # React hooks
│ └── server/ # Backend logic
│ ├── config/ # Environment config
│ ├── modules/ # Business services (auth, billing, admin, etc.)
│ ├── shared/ # Core services (db, jwt, stripe, mailer, turnstile, storage)
│ └── utils/ # Utilities (auth, error, validate, crypto)
├── content/ # Docs & blog Markdown
├── public/ # Static assets
├── scripts/ # Scripts (migrate, build-content, free-packages)
├── package.json # Single package (not monorepo)
├── vite.config.ts
├── Dockerfile
└── tsconfig.json
Backend Module Structure#
Each module in src/server/modules/ follows:
bashmodules/auth/
├── auth.service.ts # Business logic
├── register.service.ts
└── google.service.ts
Frontend Route Groups#
| Route | Purpose | Auth |
|---|---|---|
_app/ | Authenticated dashboard | Required |
en/, zh/ | Marketing website | Public |
v1/ | API endpoints | Varies |
Environment Variables#
All in root .env:
- No prefix: server-only
PUBLIC_prefix: exposed to browser