CORTEX

I have a PWA that has a lot of performance issues and gotโ€ฆ

Roles

TASKS.md
# TASKS โ€” I have a PWA that has a lot of performance issues and got a score of 65 on Vercel speed insights
## Phase 1 โ€” Foundation
- [ ] [ARCH] Analyze the current system topology and identify potential bottlenecks and areas for optimization, focusing on database queries, caching, and authentication workflows.
- [ ] [FE] Analyze the current component hierarchy and identify opportunities for optimization and lazy loading
- [ ] [BE] Analyze API endpoint performance using Vercel speed insights and identify bottlenecks
- [ ] [QA] Develop a comprehensive test strategy, including unit, integration, and e2e tests, with a focus on critical user paths and high-risk edge cases
- [ ] [QA] Implement load testing for critical endpoints and operations to identify performance bottlenecks
## Phase 2 โ€” Core Features
- [ ] [ARCH] Design and implement a comprehensive caching strategy using a solution like Redis or Memcached, and optimize database queries using Prisma's built-in features.
- [ ] [FE] Implement a state management strategy that takes advantage of Next.js 16's built-in support for Server Components and React Server Components
- [ ] [BE] Implement API endpoint caching using Redis and optimize database queries
- [ ] [FE] Optimize database queries using Prisma 7's built-in support for query optimization and caching
## Phase 3 โ€” Production
- [ ] [BE] Test and deploy optimized API endpoints to production environment
- [ ] [QA] Conduct end-to-end testing using Vitest + Playwright to ensure that performance optimizations do not introduce regressions or bugs
- [ ] [QA] Refactor existing tests to align with the defined test pyramid and quality gates
## Notes
- Cross-cutting concerns include security, scalability, and maintainability. Ensure that all tasks consider these aspects.