Skip to content

[WIP] Perform deep technical analysis of entire system architecture#11

Draft
NipunBasnayake with Copilot wants to merge 1 commit into
mainfrom
copilot/full-system-analysis
Draft

[WIP] Perform deep technical analysis of entire system architecture#11
NipunBasnayake with Copilot wants to merge 1 commit into
mainfrom
copilot/full-system-analysis

Conversation

Copilot AI commented May 29, 2026

Copy link
Copy Markdown

Cloud agent has begun work on # FULL SYSTEM OVERVI... and will update this pull request as work progresses.

Original prompt

FULL SYSTEM OVERVIEW + NANO FUNCTION IDENTIFICATION ANALYTICS PROMPT

Analyze the entire project completely and generate a deep technical system overview for BOTH frontend and backend.

Create a markdown file named:

FULL_SYSTEM_ANALYS.md

The analysis must be extremely detailed, enterprise-grade, and architecture-level.


PRIMARY OBJECTIVE

Perform a complete reverse-engineering and architecture analysis of the entire application.

The goal is to fully understand:

  • System architecture
  • Business logic
  • Nano-level functions
  • Feature flows
  • Module dependencies
  • API relationships
  • Database usage
  • Tenant structure
  • Authentication flow
  • Routing structure
  • Security risks
  • Performance bottlenecks
  • Dead code
  • Scalability concerns
  • Missing validations
  • State management flow
  • Reusable components
  • Technical debt
  • Production-readiness

This is NOT a simple code summary.

This must behave like a senior software architect + senior tech lead + senior security engineer auditing the system.


OUTPUT REQUIREMENTS

Generate ONE comprehensive markdown file:

FULL_SYSTEM_ANALYS.md

The document must contain:

  • Table of contents
  • Structured sections
  • Architecture diagrams (markdown diagrams if possible)
  • Tables
  • Dependency mappings
  • Flow explanations
  • Folder breakdowns
  • Function-level analysis
  • Risk analysis
  • Improvement recommendations

ANALYZE BOTH FRONTEND + BACKEND


FRONTEND ANALYSIS REQUIREMENTS

Analyze the frontend completely.

1. FRONTEND ARCHITECTURE

Identify:

  • Framework
  • Build tools
  • Routing system
  • State management
  • API layer structure
  • Authentication handling
  • Tenant handling
  • Layout architecture
  • Component architecture
  • Shared utilities
  • Hooks usage
  • Service layer
  • Context providers
  • Middleware/interceptors
  • Form handling
  • Validation system
  • Permission system
  • Environment configuration
  • Error handling strategy

Explain architecture quality.


2. ROUTING ANALYSIS

Analyze ALL routes.

Generate:

RoutePagePurposeAuth RequiredTenant AwareAPI DependenciesIssuesDetect:

  • Broken routes
  • Inconsistent route naming
  • Missing tenant prefixes
  • Unauthorized route exposure
  • Duplicate pages
  • Dead routes
  • Unused pages

Special focus:

Check whether ALL system routes follow tenant structure:

Example expected pattern:

/{tenant}/dashboard
/{tenant}/employees
/{tenant}/finance

Identify violations like:

/app/dashboard
/analytics
/employees


3. PAGE-LEVEL ANALYSIS

For EVERY page:

Identify:

  • Purpose
  • API calls
  • State dependencies
  • Child components
  • Forms
  • Tables
  • Modals
  • Permissions
  • Loading states
  • Error handling
  • Performance risks

Generate page dependency flow.


4. COMPONENT ANALYSIS

Analyze ALL components.

Classify:

  • Shared components
  • Business components
  • Layout components
  • UI wrappers
  • Form components
  • Modal systems
  • Table systems

Detect:

  • Duplicate components
  • Over-engineered components
  • Prop drilling
  • Missing memoization
  • Re-render risks
  • Massive components
  • Tight coupling
  • Dead components

5. NANO FUNCTION IDENTIFICATION (VERY IMPORTANT)

Analyze ALL frontend functions at nano level.

For EVERY function identify:

FunctionFilePurposeInputsOutputsAPI UsageState ImpactSide EffectsReusableRisk LevelInclude:

  • Utility functions
  • Hooks
  • Handlers
  • Validators
  • API transformers
  • Data mappers
  • Table generators
  • Form processors
  • Auth functions
  • Tenant functions

Detect:

  • Duplicate logic
  • Unused functions
  • Dangerous mutations
  • Async issues
  • Race conditions
  • Missing try/catch
  • Large functions
  • Hidden business logic

6. API INTEGRATION ANALYSIS

Map ALL frontend API calls.

Generate:

APIMethodUsed InBackend MappingAuth RequiredTenant AwareError HandlingRiskDetect:

  • Unused APIs
  • Missing interceptors
  • Missing refresh-token handling
  • Missing retry handling
  • Inconsistent error handling
  • Duplicate requests
  • Hardcoded URLs
  • Security risks

7. AUTHENTICATION + SESSION ANALYSIS

Deeply analyze:

  • Login flow
  • Logout flow
  • Token storage
  • Refresh token handling
  • Session expiry handling
  • Auto logout
  • Unauthorized redirects
  • Role-based access
  • Tenant isolation

Verify:

When session expires:

  • user is automatically redirected to login
  • tokens are cleared properly
  • refresh-token flow works correctly

Detect all flaws.


8. STATE MANAGEMENT ANALYSIS

Analyze:

  • Global state
  • Local state
  • Context usage
  • Zustand/Redux/etc
  • Cache handling
  • Query invalidation
  • State duplication
  • Memory leaks
  • Infinite render loops

9. FRONTEND SECURITY ANALYSIS

Identify:

  • XSS risks
  • Token leakage
  • LocalStorage risks
  • Missing sanitization
  • Permission bypasses
  • Se...

Created from VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants