# FXCAPXPRESS — System Gaps & Recommendations

Last updated: 2026-06-21 (gaps sprint implemented)

## Executive summary

The platform is a solid PHP SPA with modular hubs, subscriptions, and admin tooling. **Remaining gaps from the roadmap are now implemented:** web push, multi-currency pricing, Aviator/Matatu light theme, Social Posts copy helper, reg-path cleanup, PNG PWA icons, offline fallback, install banner, session retry/maintenance UX, admin ads poster settings, and unlock rules UI.

**Still open (Phase 2+):**

| Area | Status |
|------|--------|
| OAuth cross-platform posting | Phase 2+ (large) |
| External SMM API auto-fulfillment | Phase 2+ |
| Native mobile apps / Capacitor | Later |

---

## 1. Theme (light / dark)

### Status: **Done** for core shell + hub modules including Aviator/Matatu (`assets/hub-theme-light.css`).

---

## 2. Auth session & reload

### Status: **Done**
- Session restore only clears on 401
- Route persistence via `sessionStorage` + hash routing
- Retry `me` once on network/503 before degraded mode
- Separate toasts: maintenance vs connection vs generic

---

## 3. Announcements & notifications

### Status: **Done** (core wiring + web push fan-out from `notify()`)

---

## 4. Ads business model

### Status: **Done** (UI + API gates)
- Multi-currency via `default_currency` + `fmtMoney()` / `fmtCurrency()`
- Admin → Ads: min followers, poster min budget, campaign budget
- Poster subscription plans under Admin → Subscriptions

---

## 5–6. Social modules

### Phase 1: **Done**
- Copy-to-clipboard on Social Posts (user + admin)
- Cron + admin publish for scheduled posts

### Phase 2+: OAuth posting, external SMM API, per-service pricing CRUD

---

## 7. PWA

### Status: **Done**
- PNG icons 192/512 (`assets/branding/icon-*.png`)
- `offline.html` + SW navigation fallback
- `beforeinstallprompt` install banner
- Service worker push handlers

---

## 8. Module manager & subscriptions

### Status: **Done**
- Unlock rules UI under Admin → Module Manager
- Manual grant unlock by phone + module slug

---

## 9. Football / Predictions

### Status: **Done** (unchanged)

---

## 10. Priority roadmap

### Done
- [x] Session restore only on 401
- [x] Route persistence + hash routing
- [x] Announcements → notifications + ticker
- [x] Ads poster subscription gate
- [x] PWA manifest + service worker
- [x] Social modules DB + hub UI
- [x] Hub light theme (Football, Forex, Casino, Ads, Aviator, Matatu)
- [x] Admin Social panel
- [x] Social cron publish
- [x] Web push notifications (VAPID + `push_subscriptions`)
- [x] Multi-currency ads/social pricing
- [x] Social Posts copy-to-clipboard helper
- [x] Clean dead reg-path code
- [x] PNG PWA icons + offline page + install banner
- [x] Retry `me` on network failure
- [x] Session vs maintenance UX
- [x] Admin ads poster budget + follower minimum
- [x] Admin unlock rules UI

### Later
- [ ] OAuth social posting (Meta, Google, X)
- [ ] External SMM API integration
- [ ] Native mobile apps (or Capacitor wrapper on PWA)
- [ ] Announcements list screen (future)
- [ ] KYC requirement for advertisers above threshold

---

## 11. Files reference

| Area | Key paths |
|------|-----------|
| Theme | `assets/theme.js`, `assets/design-tokens.css`, `assets/hub-theme-light.css` |
| Auth | `index.php` (restoreSession, authApiWithRetry, fmtMoney) |
| Push | `config/push_service.php`, `migrations/041-gaps-push-pwa.sql`, `api/user.php` |
| PWA | `manifest.webmanifest`, `sw.js`, `offline.html`, `assets/branding/icon-*.png` |
| Ads currency | `config/ads_service.php`, `assets/ads/ads-hub.js`, `api/auth.php` |
| Social copy | `assets/social/social-hub.js` |
| Unlock rules | `assets/hub-ui.js`, `api/includes/admin_extensions.php` |
