AAperture — Application Cleanup Map
Living pilot doc for iterative cleanup. Update after each wave MR.
Related audits (do not duplicate): TECH_DEBT_AUDIT.md (racine du dépôt), DB_CLEANUP_AUDIT.md , BACKEND_STRUCTURE_IMPROVEMENT_PLAN.md , CLIENT_LEGACY_DECOMMISSION_CHECKLIST.md , QUEUE_SYSTEM.md , ACCOUNTING_EXPORT_GUIDE.md , MOBILE_APP_DEVELOPMENT.md .
Mental model
flowchart TB subgraph clients [Clients] Web[React frontend studio] Mobile[aaperture-mobile sibling] Portal[Client portal] Public[Public site booking galleries] end subgraph nest [Nest monorepo] API["API RUN_MODE=api"] Worker["Worker RUN_MODE=worker"] MobileRoutes["backend/src/mobile routes"] end PG[(PostgreSQL)] Redis[(Redis BullMQ cache)] R2[(Cloudflare R2)] Py[python-service FastAPI] Qdrant[(Qdrant)] Web --> API Mobile --> MobileRoutes Mobile --> API Portal --> API Public --> API API --> PG API --> Redis API --> R2 Worker --> Redis Worker --> PG Worker --> R2 Worker --> Py Py --> Qdrant API -.->|Socket.IO app + /agent| Web API -.->|/agent| Mobile
Surface Role Location Studio CRM (FE) Auth, contacts, sessions, docs, pipeline, Iris, search frontend/Backend studio CRM REST + Iris + Doublons/Discord backend/src/ hors mobile/Backend mobile routes Native contract only backend/src/mobile/**, OpenAPI paths/mobile/Portal client /portalfrontend + client-* backendPublic Booking, galleries, lead forms pages/public*, booking, public-siteApp native Second Frame client Sibling ../aaperture-mobile (hors monorepo) Worker Background jobs WorkerModule + workers/ + queue/processors/Python PDF/docx/xlsx, embeddings, Qdrant python-service/
Rule: In this monorepo, “mobile” means backend routes for the sibling app. Do not treat RN as a package under aaperture.
Keep map — Frontend web vs Backend mobile
Frontend web — keep
Domain Notes Core CRM Dashboard, contacts, sessions, pipeline, calendar Docs Quotes, invoices, contracts Iris / search Agent overlay + Cmd+K (no recommendations block) Insights / analytics Charts; CREATE_TASK navigates deepLink Orgs / social Organizations, Friends , Messages Doublons + Discord share FE deleted (web) ; BE + Discord kept for mobile portSettings Templates, providers, workflows, lead forms, rates, export (SMS hidden ) Account Profile, company, connections, subscription; Gmail freeze Other FE clients Portal /portal/*, public booking / galleries
Backend mobile routes — keep (native contract)
Zone Routes Auth device POST /mobile/auth/login, /mobile/auth/googlePush POST/DELETE /mobile/push-tokens (+ mobile-push worker)Sync CRM POST /mobile/syncCommunity façade /mobile/me, map, /mobile/network* , messages
Shared APIs (web + native): /agent, CRM REST, Friends domain (via /mobile/network), notifications.
Absent from mobile contract (MVP): progression (deleted), Gmail, dense editors, SMS (hidden on web). Doublons/Discord product UI removed on web; BE kept for mobile port backlog .
Friends
KEEP web + BE + /mobile/network.
Port UX to sibling aaperture-mobile (Second Frame / circles) — tracked in mobile docs, not deleted here.
Domain inventory (post cleanup)
Domain / folder Decision Notes agent/ (Iris)keep Primary conversational AI insights/keep Rule-engine; CREATE_TASK → navigate billing/ + billing/exports/keep Issuance + accounting CSV (export-first) export/keep CRM list exports external-billing/ (Pennylane)deleted Code removed; DB drop 0270/0274 file-objects/keep Documents / exports / artifacts crm-entity-files/keep Session/contact CRM files on file_objects session-files/ / contact-files/controllers only HTTP routes; logic in CrmEntityFilesService Legacy session_files / contact_files tables dropped 0272file_objects.shared_with_clientdropped 0273outbox/ Nest moduledeleted Table outbox_events dropped (0276) queue/processors/* routerskeep Sole @Processor for email/AI progression/deleted Gamification removed (tables → later DB wave) recommendations/deleted Cmd+K doublon of Insights Search ai-actions* / ai-chat / orphan conversation.service deleted Superseded by Iris CSRF scaffold deleted Unused module/guard Portal ClientQuoteExternalBilling deleted Zombie empty payload removed sms-templates BEkeep (hidden UI) Provider backlog Gmail plugin freeze (scope à part) Later dedicated MR — not part of this cleanup wave Doublons + Discord keep BE Web FE hard-deleted; BE + Discord kept for mobile port galleries.service F001done Facade now ~1.5k LOC; owner library CRUD → GalleriesLibraryService, client/public portal + selections → GalleriesSelectionsService, shared detail/ownership helpers → GalleriesDetailService GalleryEditorSlideshowTab F002partial Export window, timeline layout, patch queue, and Konva cover/ending-persist state extracted into gallery-editor-slideshow/ hooks; handleSaveDraft/handleQueueSlideshowRender orchestration left inline (needs test coverage before extracting)
Completed waves (this branch)
Files SoT
Billing export-first
Queues / stubs
Vague A — dead product + hygiene (2026-07-24)
Vague C — Proposal deleted (FE/BE + DB)
Hard-remove Proposal product (builder, public /proposal, upsells panel, email new-proposal, settings defaults, routes, OpenAPI paths/schemas, E2E)
FE + BE code deleted on chore/remove-proposal-product
DB: Liquibase 0277 drops proposal_* tables, user_settings.proposal_default_*, email_new-proposal, quote_revisions, ADDON quote lines / columns, and user_rates addon flags
KEEP : sessions day-planner client proposals (sessions.*.dayPlanner i18n + planning proposal APIs) — not the commercial Proposal product
KEEP : contacts marketing copy where “proposal” means quote / commercial offer
KEEP : session user_rate_id (session ↔ rate link; unrelated to Proposal add-ons)
FREEZE : R2 prefixes proposal-covers/ / proposal-defaults/ (writes denied; optional later GC)
Quotes CRM flow verified post-removal (list/create/edit/view/send/session tab)
Vague D — orphan schema drop (2026-09-05)
Progression DB drop (post Vague A) (2026-07-24)
Insights deep-links (2026-07-24)
Deferred trio cleanup (2026-07-24)
Remaining / deferred
Item Notes Friends UX port MVP done on aaperture-mobile (Circles accept/reject/add/remove)Doublons → mobile Web FE deleted; BE /duplicates + Discord kept — port in aaperture-mobile SMS provider Deleted (Vague E, 2026-09-06) — Twilio/Vonage service, templates, workflow tasks, DB (0279-0281), OpenAPI, i18n; see [[sms-feature-removed]] session memoryGmail plugin FREEZE — inbox UI + /gmail redirected; page/BE code kept for dedicated MR — GMAIL_PLUGIN_IMPLEMENTATION_PLAN.md Galleries F002 (remaining) handleSaveDraft / handleQueueSlideshowRender orchestration still inline in GalleryEditorSlideshowTab.tsx (~4.2k LOC); extracting further needs UI/integration test coverage firstoutbox_eventsDropped (0276)Portal /client Phase 4 Done — CLIENT_LEGACY_DECOMMISSION_CHECKLIST.md Notion / PayPal on /connections Product call — not Vague B Cmd+K generate-action Product call vs Iris-only
Vague B — hide leftovers (2026-08-21)
Liquibase on this line
Id Purpose 0271shared_with_client + backfill from legacy0272Drop session_files / contact_files + views 0273Drop file_objects.shared_with_client 0274Drop external billing tables + settings flag 0275Drop progression / gamification tables 0276Drop outbox_events 0277Drop Proposal product tables + settings columns + email_new-proposal + ADDON quote/user_rates rollback 0278Drop orphan professional_type_profiles / organization_settings / gdpr_processing_activities
Merge note: main may already have 0270 for billing drop; keep a single drop changeset in changelog.
Before / after
Area Before After CRM files Dual tables + dead EntityFilesService file_objects + CrmEntityFilesServiceSession share Orphan /share API Removed Billing sync Pennylane in product Accounting CSV export Email/AI queues Competing @Processors Routers + injectable handlers Scheduled export Job name export (rejected) export:buildProgression XP / badges / nav Deleted Recommendations Cmd+K block Deleted (Insights remains) Portal quote billing Empty external_billing Removed SMS Visible settings / contact tab Hidden UI; BE kept Doublons Sidebar + dashboard widget Web FE deleted; BE + Discord kept for mobile port outbox_eventsOrphan table after Nest module delete Dropped (0276) Legacy /client pages Residual DTOs + dead PayPal URLs Phase 4 closed; /client?returnUrl= bridge kept Galleries god-file ~8.5k LOC single service F001 done — facade ~1.5k + subdomain services; F002 partial (~4.2k FE tab) Commercial Proposal Builder + /proposal + ADDON upsells Deleted FE/BE + DB 0277; day-planner proposals KEEP; R2 GC optionalOrphan schema bags Profiles / org settings JSON / GDPR Art.30 register Dropped 0278 (unused at runtime)