xynhub.com/
├── apps/
│ ├── web/ # React landing page (Vite + Tailwind CSS 4)
│ ├── api/ # Hono.js REST API
│ └── admin/ # Next.js 15 CMS admin panel
├── packages/
│ ├── shared/ # Shared types, Zod schemas, constants
│ └── supabase/ # Database config, migrations, seed data
npm install # Install all workspace dependencies
cd packages/supabase && npx supabase start # Start local database
npm run dev:api # Start API (port 3000)
npm run dev:web # Start frontend (port 5173)
npm run dev:admin # Start admin CMS (port 3001)| Layer | Stack |
|---|---|
| Frontend | React 19, Vite 8, Tailwind CSS 4, React Router 7 |
| API | Hono.js, Zod, Supabase client |
| Admin | Next.js 15, Zustand, TanStack Query |
| Database | Supabase (PostgreSQL), RLS policies |
| Shared | TypeScript, Zod schemas |
// Components: PascalCase
export function BentoCard() {}
export function PageHeader() {}
// Files: PascalCase for components, kebab-case for utils
// src/components/ui/BentoCard.tsx
// src/lib/utils.ts
// API routes: kebab-case
// /api/v1/page-contents- TypeScript strict mode across all packages
- Zod schemas in
packages/sharedfor API validation - Shared types imported via
@xynhub/shared - No hardcoded content in components - all data from API
- Follow
UI_RULES.mddesign system strictly - Use design tokens from
src/index.css(never arbitrary Tailwind colors) - Use
BentoCard,PageHeader,SectionHeadercomponents - Fetch data from API, show loading states
- All routes validate input with Zod schemas from
@xynhub/shared - Public routes: no auth, read-only
- Admin routes: require Bearer token + email whitelist check
- Use
supabaseAdminfor admin operations,supabasePublicfor public reads - Return consistent
{ success, data }response format
- Migrations in
packages/supabase/supabase/migrations/ - New migration:
npx supabase migration new <name> - RLS enabled on all tables
- Use JSONB for flexible page content, relational tables for dynamic entities
# Create feature branch
git switch -c feature/your-feature
# Make changes and verify
npm run build:web
npm run build:api
# Commit
git commit -m "feat: description of change"
git push origin feature/your-featureFollow conventional commits:
feat:new featurefix:bug fixdocs:documentationrefactor:code restructuringchore:maintenance tasks