Use this guide before asking CLINE to continue features locally.
When docs or code disagree, follow this order:
docs/SYSTEM_TRUTH.mddocs/14-marketplace-gap-sync-plan.md- Current source code in
src/ - Older stage docs in
docs/ - README summary
Do not implement new advanced marketplace/community features before the current gap-sync checklist is handled.
git checkout main
git pull origin main
npm cicp .env.example .env.localSet at least:
DATABASE_PROVIDER=mock
JWT_SECRET=replace-with-a-long-random-value-at-least-32-chars
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=LapanginGenerate a better local secret with:
openssl rand -base64 48Keep DATABASE_PROVIDER=mock while building normal app features. Use postgres only when the Postgres adapter/migrations are being implemented.
| Password | Role | |
|---|---|---|
| admin@lapangin.id | Admin123!@# | Super Admin |
| owner@lapangin.id | Owner123!@# | Venue Owner |
Do not reintroduce old credentials such as admin@lapangin.com / admin123.
npm run doctorThe doctor script checks:
- required project files
DATABASE_PROVIDERJWT_SECRET- provider-specific environment variables
- warning for dependencies still using
latest
npm run devOpen:
- Public app:
http://localhost:3000 - Admin:
http://localhost:3000/admin/login
Create a feature branch:
git checkout -b feat/<short-feature-name>Ask CLINE to follow this pattern:
- Read
docs/SYSTEM_TRUTH.mdfirst. - Read
docs/14-marketplace-gap-sync-plan.mdif the task touches booking, auth, loyalty, marketplace, referral, owner, or payment. - Read impacted source files before editing.
- Make the smallest useful change.
- Keep service logic in
src/lib/services. - Keep data access in
src/lib/adapters. - Keep domain types in
src/lib/types. - Keep validation in
src/lib/validatorsor route-local schemas. - Do not expose private booking/customer data in public APIs.
- Do not set
DATABASE_PROVIDER=postgresunless implementing PostgreSQL support. - Do not add advanced features before closing the gap they depend on.
- Run checks before finishing.
npm run doctor
npm run type-check
npm run lint
npm run buildOr all at once:
npm run checkUse this when starting a new local task:
You are working on Lapangin MSR.
Read docs/SYSTEM_TRUTH.md, docs/CLINE_LOCAL_WORKFLOW.md, and docs/14-marketplace-gap-sync-plan.md first.
Keep DATABASE_PROVIDER=mock for local feature work unless the task is explicitly about PostgreSQL.
Use canonical demo accounts only: admin@lapangin.id / Admin123!@# and owner@lapangin.id / Owner123!@#.
Do not expose booking/customer private data in public APIs.
Do not bypass service layer or adapter pattern.
Before editing, inspect related files.
Prefer small, testable commits.
After editing, run npm run doctor, npm run type-check, npm run lint, and npm run build.
Task: <describe feature here>- Do not add JWT fallback secrets.
JWT_SECRETmust come from env. - Do not store plaintext passwords.
- Demo in-memory auth may exist for local work, but password handling must still use hashing.
- Production auth must become database-backed.
- Never create booking directly from UI or adapter without service-layer conflict checks.
- New bookings start as temporary holds.
- Booking success/status page is not final confirmation.
- Final booking validity requires admin/owner confirmation.
- Prefer
bookingCode + phone + proofUrlfor public payment proof submission. bookingIdsupport is temporary compatibility only.- Do not expose internal booking IDs as the primary public lookup mechanism.
- Base64 upload is MVP only; production should use object storage.
- Public schedule may show court/date/time/status and opt-in aliases/team names.
- Do not expose full name, phone, email, or address publicly.
- Public roster/open-play must be opt-in.
- Points are awarded only after booking confirmation.
- Avoid duplicate point awards for the same booking.
- Referral rewards should require verified registration and completed/confirmed activity.
- Schema exists, but adapter implementation is still a separate follow-up.
- Keep mock mode for normal feature work.
- Do not assume PostgreSQL is production-ready until adapter, migrations, and tests exist.
- Do not run broad dependency upgrades inside feature PRs.
- Dependency pinning/upgrades should be isolated in a dedicated PR.