2.6 KiB
2.6 KiB
Master Implementation Plan
This document serves as the central roadmap, referencing tasks from:
database-todos.md(DB)security.md(SEC)caching.md(CACHE)
Phase 1: Foundation (Schema & Data Security)
Goal: Secure the data layer and enable collaboration primitives.
- [DB] Split
profilesintoprofiles_public&user_secrets- Create table & Migrate data (Ref:
src/integrations/supabase/types.ts). - [SEC] Apply RLS to
user_secrets(user_id = auth.uid()).
- Create table & Migrate data (Ref:
- [DB] Create
page_collaboratorsTable- Define columns & Unique Constraints.
- [SEC] Implement RLS for shared Page access (Viewer/Editor logic).
Phase 2: Server Core & API
Goal: Build the "Smart Proxy" layer to handle data fetching and caching.
- [CACHE] Implement
CacheAdapter- Create Interface (Target:
server/src/commons/cache/types.ts). - Implement
MemoryCache(default) &RedisCache(optional).
- Create Interface (Target:
- [DB] Implement Server Endpoints in
ServingProductGET /api/feed(Hydrated View-Ready Feed).GET /api/profile/:id(Public Profile).GET /api/me/secrets(Secure Settings access).
- [CACHE] Apply Caching to Endpoints
- Cache Feed (60s) & Profiles (5m).
Phase 3: Client Security & Refactor
Goal: Stop leaking keys and move to the Proxy.
- [SEC] Critical: Remove Client-Side Key Fetching
- Scrub
profilesselects inProfile.tsxanddb.ts. - Remove API Key inputs from Profile UI in
Profile.tsx.
- Scrub
- [DB] Client Data Layer Refactor
- Update
db.tsto usefetchFeedFromProxy/fetchProfileFromProxy. - Deprecate direct Supabase
selectcalls for core content.
- Update
- [SEC] Hardening
- [SEC] Handle 404s/403s in
Post.tsxcorrectly.
- [SEC] Handle 404s/403s in
Phase 4: Performance & Optimization
Goal: Instant loads and "feels native" speed.
- [DB] Server-Side Injection (SSR-Lite)
- Inject
window.__INITIAL_STATE__intoindex.htmlviaServingProduct.
- Inject
- [CACHE] Client Hydration
- Configure React Query to hydrate from
__INITIAL_STATE__. - Set global
staleTimeto 5m.
- Configure React Query to hydrate from
- [SEC] Rate Limiting
- Add limits to API endpoints.