src/app/: App Router pages and layouts (page.tsx,layout.tsx), routes like/adminand/book.src/components/: UI components.src/components/ui/: shadcn primitives (kebab-case files).src/components/bookly/: app-specific components (PascalCase files).
src/lib/: server actions and utilities (actions.ts,sqlite-db.ts,config-store.ts,utils.ts).src/types/,src/context/,src/hooks/: shared types and hooks.data/: runtime data (bookly.sqlite,rooms.json,bookings.json,app-config.json).docs/,public/: docs and static assets.
npm run dev— Start dev server athttp://localhost:9002(Turbopack).npm run build— Create production build (.next/).npm start— Run built app.npm run lint— ESLint vianext lint.npm run typecheck— Strict TypeScript checks (no emit).
- TypeScript with 2-space indentation; prefer explicit types. Use
@/*path alias. - Components: PascalCase for
src/components/bookly/*.tsx; shadcn UI insrc/components/ui/*.tsx(kebab-case filenames). - Tailwind CSS for styling; merge classes with
cn(...)fromsrc/lib/utils.ts. - Server actions must include
'use server'and live insrc/lib/when reusable.
- No formal test suite yet. Ensure
npm run lintandnpm run typecheckpass. - If adding tests, co-locate under
src/and name*.test.ts[x]. Prioritize booking/date utilities and server actions.
- Commit messages: imperative and concise (e.g.,
fix: refresh home page data). Prefer Conventional Commits:feat|fix|chore|docs|refactor(scope): message. - PRs: small and focused; include description, linked issues, and before/after screenshots for UI changes.
- Call out any DB schema changes (see
src/lib/sqlite-db.ts) and include migration notes.
- Do not commit secrets. Use
.env.local(seesrc/lib/firebase.tsfor optional Firebase keys). - Admin auth uses cookies; set/change the admin password via
/adminafter first run. - Ensure
sqlite3CLI is installed; if not onPATH, configure its path in Admin settings. Data persists indata/bookly.sqlite.