# Skipped Features Tracker

This file tracks every feature that was intentionally deferred or skipped during the Firebase migration.
When you're ready to implement any item, this file tells you exactly where to start.

---

## Legend
- 🔴 **Blocked** — Cannot implement without a paid plan / external service
- 🟡 **Deferred** — Can implement in a later phase, no blocker
- ✅ **Done** — Completed in a previous phase

---

## Phase 1 Skips

### 🔴 Firebase Storage (file uploads)
- **Skipped because:** Firebase free Spark plan does not include Storage.
- **What it affects:**
  - Cover images for issues, projects, workspaces
  - User avatar uploads
  - Issue attachments
- **When unblocked:** Upgrade to **Firebase Blaze plan** → Storage is included.
- **Files to create/modify when resuming:**
  - `apps/web/core/services/file.service.ts` — replace Axios upload with Firebase Storage SDK upload
  - `apps/api/buzzwareTech/settings/storage.py` — update `generate_presigned_post` to return Firebase Storage URLs
  - `apps/web/core/components/issues/attachment/` — update upload handlers
- **Implementation note:** Use `ref(storage, 'workspaces/{id}/assets/{uuid}')` + `uploadBytesResumable()`.

---

## Phase 2 Skips

### 🔴 Firebase Cloud Functions (server-side business logic)
- **Skipped because:** Cloud Functions require **Firebase Blaze plan**. Currently on free Spark plan.
- **What it affects (all deferred to "Phase 2B-Pro"):**
  - Server-side permission enforcement (replaced temporarily by Firestore Security Rules)
  - Atomic sequence ID generation with server-side transactions
  - Server-side activity logging (issue history)
  - Email invitation sending
  - Webhook dispatch
  - Notification fan-out
- **When unblocked:** Upgrade to **Firebase Blaze plan** → deploy `functions/` directory.
- **Files to create when resuming:**
  ```
  functions/
    src/
      index.ts
      auth/on-user-created.ts
      workspace/create.ts, update.ts, invite-member.ts
      project/create.ts, update.ts
      issue/create.ts, update.ts, delete.ts, bulk-operations.ts
      cycle/create.ts, add-issues.ts
      module/create.ts, add-issues.ts
      state/create.ts
      utils/auth.ts, activity.ts, permissions.ts
    package.json
    tsconfig.json
  ```
- **Current workaround:** All writes go directly from browser → Firestore SDK. Firestore Security Rules enforce who can read/write what.
- **Risk of workaround:** Business logic (e.g. "only workspace admins can delete a workspace") lives in Security Rules, not in functions. This is less flexible but works for small teams.

### 🔴 Full-Text Search
- **Skipped because:** Firestore has no native full-text search.
- **What it affects:** The `/search/` endpoint used in the command palette (Ctrl+K), workspace search.
- **When unblocked:** Choose one:
  - **Algolia** — Firebase Extension available, easiest to set up
  - **Typesense** — Self-hosted, free alternative
  - **MeiliSearch** — Self-hosted, great DX
- **Files to modify when resuming:**
  - `apps/web/core/services/workspace.service.ts` → `searchEntity()` method
  - `apps/web/core/components/command-palette/` — point to new search service
  - Add `firestore-algolia-search` or equivalent Firebase Extension

### 🟡 apps/admin God-Mode Panel (Phase 3)
- **Skipped because:** Belongs to Phase 3. Admin panel currently talks to Django REST API.
- **What it affects:** The admin interface at `localhost:3001` — instance management, user management, feature flags.
- **Files to rewrite when resuming:**
  - `apps/admin/` — entire app needs to be re-pointed to Firestore
  - Replace all `APIService` calls with Firestore Admin SDK (server-side) or callable functions
  - Consider replacing with a simple Firebase Console + custom admin page

### 🟡 apps/space Project Publishing / Client Portal (Phase 3)
- **Skipped because:** Belongs to Phase 3. Space client portal currently talks to Django REST API via the legacy `@buzzwaretech/services` package.
- **What it affects:** The client-facing public space views — issue viewing/creating from published project pages, public page boards, user profiles, and public comments.
- **Files to rewrite when resuming:**
  - `apps/space/` — entire app needs to be re-pointed to Firestore
  - Replace all `@buzzwaretech/services` REST services (like `SitesProjectPublishService`, `SitesIssueService`, `SitesFileService`, `SitesAuthService`) with Firestore client-side queries/mutators.
  - Safe removal of the legacy `@buzzwaretech/services` package (including legacy REST services for `ai`, `auth`, `cycle`, `dashboard`, `issue`, etc.) once both `apps/space` and `apps/admin` are fully migrated.

### 🟡 Data Migration Script (No Existing Data — Trivially Skipped)
- **Skipped because:** No production data exists yet to migrate from PostgreSQL.
- **If you ever need it:** Create `scripts/migrate-pg-to-firestore.ts` that reads from PostgreSQL via `pg` npm package and writes to Firestore Admin SDK.

### 🟡 apps/live WebSocket Server
- **Skipped because:** Real-time collaboration now uses Firestore's built-in `onSnapshot` listeners — the WebSocket server (`apps/live/`) is no longer needed.
- **Action:** `apps/live/` can be deleted when Django is fully removed in Phase 2E cutover.

### 🟡 Analytics (Phase 3)
- **Skipped because:** Django analytics views are complex aggregations. Firestore is not suited for ad-hoc aggregations.
- **When resuming:** Use Firebase's `count()` / `sum()` aggregation queries (available in Firestore) or integrate Google Analytics / a dedicated BI tool.
- **Files affected:** `apps/web/core/services/analytics.service.ts`

### 🟡 Notification Email Delivery
- **Skipped because:** Requires Cloud Functions (Blaze plan) to send emails via Sendgrid/Mailgun.
- **Current state:** Notifications stored in Firestore (`users/{uid}/notifications/{id}`) and shown in-app.
- **When resuming:** Add Firebase Extension "Trigger Email" (requires Blaze) + point it at `mail/` collection.

### 🟡 Webhook Dispatch
- **Skipped because:** Requires Cloud Functions (Blaze plan) to make outbound HTTP calls.
- **When resuming:** Create `functions/src/webhook/dispatch.ts` — Firestore trigger on issue writes → HTTP POST to registered webhook URLs.
- **Files affected:** `apps/web/core/services/webhook.service.ts`

### 🟡 Issue Export / Import (Exporter / Importer)
- **Skipped because:** Low priority, complex server-side logic.
- **When resuming:** Create a Cloud Function that reads Firestore and generates a CSV/JSON download, or do it client-side with `file-saver` npm package.

---

## Summary Table

| Feature | Status | Blocker | Phase to Resume |
|---|---|---|---|
| Firebase Storage | 🔴 Blocked | Blaze plan | 1.5 (when on Blaze) |
| Cloud Functions | 🔴 Blocked | Blaze plan | 2B-Pro |
| Full-Text Search | 🔴 Blocked | External service needed | 3 or later |
| Admin Panel | 🟡 Deferred | Phase 3 | 3 |
| Space Client Portal | 🟡 Deferred | Phase 3 | 3 |
| Data Migration Script | 🟡 N/A | No data to migrate | Never (unless needed) |
| apps/live WebSocket | 🟡 Deferred | Replaced by Firestore listeners | 2E cutover |
| Analytics | 🟡 Deferred | Phase 3 | 3 |
| Email Notifications | 🟡 Deferred | Blaze plan | 2B-Pro |
| Webhooks | 🟡 Deferred | Blaze plan | 2B-Pro |
| Issue Export/Import | 🟡 Deferred | Low priority | 3 |
