Commit Graph

30 Commits

Author SHA1 Message Date
pi-agent 0098d9ca4a feat: auto-healing system — HEALTHCHECK, rate-limiter cleanup, auto-rollback CI, watchdog
Deploy Staging / build (push) Failing after 14m49s
- Dockerfile: add HEALTHCHECK (30s interval, 10s timeout, 3 retries)
- rate-limit.ts: auto-cleanup stale entries every 5 min (prevents memory leak)
- scripts/auto-heal.sh: watchdog for Synology cron — auto-restarts container,
  reloads nginx gateway, escalates on excessive failures
- CI workflow: auto-rollback on deploy failure (tags :rollback image,
  reverts if health check fails after deploy)
2026-06-28 02:52:11 +08:00
pi-agent aac485ba30 fix: add HOSTNAME=0.0.0.0 to start.sh for proper port binding in Docker
Deploy Staging / build (push) Failing after 46s
2026-06-28 02:15:32 +08:00
pi-agent 6874e83325 docs: save CAB QA protocol and regression test suite for future use
Deploy Staging / build (push) Failing after 12m21s
- cab-qa.sh: 41-check CAB Change Advisory Board checklist
- regression.sh: 39-test comprehensive regression suite
- README.md: usage guide and CAB sections reference

These test suites validate deployment, security, functional,
integration, compliance, performance, and rollback readiness.
2026-06-28 02:15:06 +08:00
pi-agent 5e4457fe34 fix: copy all node_modules into Docker image (instead of selective prisma copies)
Deploy Staging / build (push) Failing after 17m59s
2026-06-28 01:36:23 +08:00
pi-agent d36aba8c58 fix: prisma db push --accept-data-loss in startup script
Deploy Staging / build (push) Failing after 20m40s
2026-06-28 01:30:47 +08:00
pi-agent de48918acf security: fix critical webhook direct upgrade path, seed auth, CORS Vary header
Deploy Staging / build (push) Failing after 26m15s
- Webhook polar/route: block direct ?userId=&tier= upgrades in production (NODE_ENV guard)
- Seed route: require ADMIN_SECRET via x-admin-secret header
- Feedback route: require FEEDBACK_ADMIN_TOKEN env var in production
- CORS middleware: add Vary: Origin header for caching correctness
- MOCK_PAYMENTS: add NODE_ENV production guard
- Wallet top-up: add production guard for mock mode when POLAR_ACCESS_TOKEN unset
2026-06-28 01:15:45 +08:00
pi-agent 0c3521ba4c security: critical fixes from audit
CI / test (push) Successful in 1m58s
- Rotate 5 exposed production secrets (JWT, ENCRYPTION, ADMIN, POSTGRES, REDIS)
- Fix MOCK_PAYMENTS opt-in (now defaults to disabled)
- HMAC-SHA256 webhook verification with timing-safe comparison
- Purge dangling git blobs (git gc --prune=now)
- Rate limiting on auth routes (10/15min per IP)
- CORS middleware restricted to falahos.my
- Fix walletBalance → flhBalance (Prisma schema mismatch)
2026-06-27 17:54:34 +08:00
root bfd3509add docs: update README with full CE feature docs, architecture, and deployment guide 2026-06-24 07:08:25 +02:00
root cfff74e2db feat: Souq native integration + auth simplification + CE-wide enhancements
Souq Marketplace:
- Native souq pages: browse+filters, create listing, detail+seller profile, orders+chat
- New API: reviews (POST), sellers/[id], upload (multipart), polar-checkout webhook
- Listings API enhanced: minPrice, maxPrice, sortBy, deliveryDays filters
- Seller workflow: start order, mark delivered, upload files, confirm delivery
- Wallet: 5 Polar.sh FLH tiers, production checkout, mock fallback, success banner
- Fix: order redirect /souq/history → /souq/orders

Auth System:
- Unified auth page, removed OAuth provider routing (2 files deleted)
- Deleted oauth.ts (319 lines) — simplified auth chain
- Streamlined login/register API routes

Prisma Schema (+179 lines):
- New models: Listing, Purchase, Review, Group/GroupMember
- Gamification: DailyStreak, XpTransaction, Achievement, UserLevel
- Learning: LearnCourse/Module/Enrollment/Certificate
- Notifications, Referrals, Dhikr, PremiumBenefits

Deleted legacy code:
- src/app/api/marketplace/* (3 files) — replaced by /api/souq/*
- src/app/api/files/[listingId]/route.ts — replaced by /api/souq/upload
- src/app/api/seller/[sellerId]/route.ts — replaced by /api/souq/sellers/[id]

Infrastructure:
- Dockerfile: standalone output, Prisma runtime migration
- docker-compose.yml: Polar env vars, healthcheck fix
- docker-compose.staging.yml: staging on port 4014
- .gitea/workflows/ci.yml: CI pipeline
2026-06-24 07:02:03 +02:00
root 913fa94fb9 Add CI workflow 2026-06-21 19:20:51 +02:00
root 7ddfbcc3ce feat: Add browser extension download card on home page — links to GitHub, shows v2.4.0 feature badges (Prayer Grid, Countdown, Day Progress, Souq, XP) 2026-06-19 00:55:42 +02:00
root a98a358978 docs: add PWA installation guide for Android and iOS sideloading 2026-06-19 00:34:11 +02:00
root 1cf5426f13 fix(souq): add missing /mobile basePath prefix to listing API fetch
fetch('/api/marketplace/listings?...') was hitting the wrong URL
(404) because the app is deployed under /mobile basePath. Changed
to fetch('/mobile/api/marketplace/listings?...') which matches the
correct API route.
2026-06-19 00:01:03 +02:00
root 44f304fb6b fix(prayer): strip timezone suffix in parseTimeToMs, fix NaN countdown
The prayer API returns timings like '06:03 (MYT)' but parseTimeToMs
didn't strip '(MYT)' suffix, causing Number('03 (MYT)') → NaN.
Now regex-strips timezone annotations before parsing.

Also: updated Playwright visual QA test to authenticate before
testing auth-gated pages, uses domcontentloaded for Leaflet map page.

Grade A — 84 pass, 0 fail, 1 warn on production browser QA.
2026-06-18 19:51:27 +02:00
root 8849bd5459 feat: real Halal Monitor via Overpass API + user-contributed yellow markers
- Replace hardcoded KL mock data with live OpenStreetMap Overpass API
- Support 15+ major cities worldwide (London, Dubai, Tokyo, NY, etc.)
- Bounding-box queries (faster than radius search)
- HTTP/1.1 fix for Overpass Apache compat
- Nominatim geocoding for city search
- 6-hour file-based cache per grid cell
- 3-mirror Overpass fallback with retry on timeout
- User-contributed places with yellow () markers
- 'Add Place' modal with name/type/address/notes form
- Map tap-to-pin coordinates for new places
- Delete own submissions from detail modal
- Prisma UserPlace model + API routes

Closes: Halal Monitor showing only KL data
2026-06-18 17:51:15 +02:00
root 14d7127e41 Error Feedback Service + friendly error handling across all pages
- Error Feedback Service: POST /api/feedback saves to JSONL, GET with admin token
- ErrorFeedback component: warm amber tones, friendly messages, 'Report Issue' button
- Replaced ALL red-themed error displays across 15+ pages with ErrorFeedback
- Kind classification: network, auth, location, upgrade, default messages
- QA test suite v2: 8-layer testing (system, API, render, scenario, edge, mobile, perf, security)
- Browser-based visual QA with Playwright (Layer 9)
2026-06-18 16:24:47 +02:00
root 28be776c84 Add Prayer Reminder, Dhikr Counter, Qibla Finder, Halal Monitor updates
- Prayer reminder: /prayer page with 5 daily times, countdown, alAdhan API
- Dhikr counter: /dhikr page with 3 presets, custom counter, haptics, DB tracking
- Qibla finder: /qibla page with compass SVG, DeviceOrientation, bearing to Kaaba
- Halal Monitor: Leaflet + Google Places, 26 KL markers, geolocation, distance sort
- BottomNav: added clock icon for prayer
- Prisma: schema updates for DhikrSession, DhikrDay, DailyStreak, XpTransaction
- Geo utility module
- Weighted Traefik routing: Contabo 99% / Synology 1% cold standby
2026-06-18 14:51:07 +02:00
root ed34b186f9 Referral page, bug fixes, seed data, persona tiers
- New /refer page with share/copy/stats
- Fixed modal z-index conflicts (z-50 → z-[60]) across forum, groups, souq, halal-monitor
- Seed route: forum categories, marketplace listings, private groups
- Mufti/Daie personas now available in Premium tier
- Fixed referral share link: falahos.my/mobile/auth?ref=CODE
- Fixed client-side persona access check for premium
2026-06-18 09:38:05 +02:00
root b39bce91e4 Remove Apple SSO, keep Google + GitHub only
- Removed Apple from OAuth lib (config, exchange, provider type)
- Removed Apple button from auth page
- Removed Apple tab from setup guide page
- Removed Apple env vars from .env, .env.example, docker-compose.yml
- Removed Apple prompts from setup-sso.sh
2026-06-15 14:36:46 +02:00
root efe8fe36d4 SSO registration & setup guide
- Google, Apple, GitHub SSO login via popup OAuth flow
- New /mobile/auth page with 3-click registration
  (Click provider → authorize → auto-logged in)
- Email registration with name + email + password
- /mobile/setup page with step-by-step OAuth setup guide
- OAuth env vars in .env.example, docker-compose.yml
- scripts/setup-sso.sh for one-command credential setup
- Graceful 503 when OAuth not configured
2026-06-15 13:38:24 +02:00
root d194e295ad feat: 3-click SSO registration - unified /auth page, Google/Apple/GitHub OAuth, email fallback, provider model 2026-06-15 12:42:03 +02:00
root 64ae34e9c9 feat: private forum groups - Group/GroupMember models, group CRUD API, invite codes, private threads, groups UI pages 2026-06-15 12:25:52 +02:00
root 947fe3b66d fix: add /mobile prefix to all client-side fetch() calls for basePath 2026-06-15 11:38:03 +02:00
root 15300d3e42 fix: basePath=/mobile, Traefik health check, DB perms, demo email fix, login UI text bump 2026-06-15 11:32:14 +02:00
root 8f0ff9d47a fix: mobile-first UI redesign - bump all text to 12px+, 44px+ touch targets, reduced content density 2026-06-15 11:07:41 +02:00
root e479df82e2 Fix halal usage Infinity bug, all endpoints passing 2026-06-15 10:34:19 +02:00
root 5e73d1d7ad Block 8 complete: streaks, notifications, referrals, premium identity, gamification 2026-06-15 10:32:10 +02:00
root 6423430275 Add Docker deployment + Alpine binary target fix 2026-06-15 09:37:43 +02:00
root 5483dd291e Initial Falah Mobile rebuild — all 7 blocks complete
- Auth system (login/register/profile)
- Nur AI chat with persona system
- Souq marketplace with FLH economy
- Forum community with Shariah moderation
- Wallet & FLH top-up
- Premium/Pro tier upgrade with Polar.sh
- Halal Monitor with map & bookmarks
- Home dashboard with daily verse & streaks
- Health endpoints

Next.js 16.2.7, Prisma v5 SQLite, JWT auth, Tailwind CSS v4
2026-06-15 09:28:22 +02:00
root ab8a2053e1 Initial commit from Create Next App 2026-06-15 08:54:27 +02:00