# eudoca/wisecomply_new architecture

> Architecture diagram of the GitHub repository eudoca/wisecomply_new, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eudoca/wisecomply_new
- Repository: https://github.com/eudoca/wisecomply_new

## Overview

##### Project Type and Purpose
- WiseComply is a single‐page web application (SPA) built with React and TypeScript, bundled with Vite, styled with Tailwind CSS and shadcn/ui components. Its purpose is to guide users through compliance tasks and constitution generation for New Zealand incorporated societies. There is no custom backend API in this repo—data is managed in‑memory or via client‑side persistence (e.g., browser storage) if implemented.

##### Architecture Analysis from File Structure & README
- Top‑level:
- public/ & src/ → static assets and application code
- README.md, vite.config.ts, tsconfig.json, tailwind.config.js → build, type, and style configuration
- vercel.json → deployment target (static hosting on Vercel)
- src/ contains:
- main.tsx → application entry point, ReactDOM.render, Router setup
- App.tsx → route definitions (React Router DOM) and high‑level layout selection
- layouts/ → wrapper components (AuthLayout, DashboardLayout)
- pages/ → route targets (HomePage, ComplianceActivitiesPage, ConstitutionPage, etc.)
- components/ → feature modules (compliance, constitution, disputes, officers, settings) plus core UI and wizard building blocks
- lib/, utils/, types/ → shared code, helpers, and TypeScript definitions

##### Main Components & Relationships
- Frontend SPA (React + TS)
- Router Layer (React Router DOM)
- Layout Layer (DashboardLayout, AuthLayout)
- Feature Modules (each mapped to a page):
– Compliance Activities (multi‑step wizard)
– Constitution Wizard (block‑based wizard)
– Disputes Management
– Officer Management
– Settings/Configuration
- Shared UI Library (shadcn/ui + custom wrappers in components/ui)
- State Layer: React Context API for cross‑component state in wizards; local `useState` for per‐component state
- Styling: Tailwind CSS, PostCSS
- Build & Deploy
- Vite dev server (npm run dev) for local development
- Vite build → dist/ (bundled .js, .css, index.html)
- Static Host (Vercel or any CDN) serves dist/ over HTTPS
- Runtime Flow
Browser → index.html → main.tsx → App.tsx (Router) → Page component → Feature Components → UI components

##### Architectural Patterns & Principles
- Component‑based decomposition: UI split into small, reusable pieces (components/ui, wizard, feature‑specific components)
- Page‑oriented routing: one top‑level page per feature (pages/)
- Layered organization: layouts → pages → components → UI primitives
- Build‑time configuration: centralized config files (tailwind.config.js, tsconfig.json, vite.config.ts)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build & Deploy Pipeline
    subgraph "Vite Build & Deploy Pipeline"
        direction TB
        SC["Source Code (GitHub)"]:::build
        VDS["Vite Dev Server<br/>(npm run dev)"]:::build
        VB["Vite Build<br/>(dist/)"]:::build
        SA["Static Assets (dist/)"]:::build
        VC["Vercel/CDN"]:::build
        SC -->|push code| VDS
        VDS -->|build artifacts| VB
        VB -->|outputs bundles| SA
        SA -->|deploy over HTTPS| VC
    end

    %% Frontend SPA
    subgraph "Frontend SPA (React + TS)" 
        direction TB

        %% Entry & Routing
        subgraph "Routing & Layout" 
            direction TB
            MT["main.tsx"]:::routing
            AP["App.tsx"]:::routing
            AL["AuthLayout"]:::routing
            DL["DashboardLayout"]:::routing
            MT -->|renders Router| AP
            AP -->|uses layout| AL
            AP -->|uses layout| DL
        end

        %% Pages & Features
        subgraph "Page Components & Feature Modules"
            direction TB
            HP["HomePage"]:::feature
            CP["ComplianceActivitiesPage"]:::feature
            CoP["ConstitutionPage"]:::feature
            DP["DisputesPage"]:::feature
            OP["OfficersPage"]:::feature
            SP["SettingsPage"]:::feature

            subgraph "Feature Module UI"
                direction TB
                Cmp["Compliance Module"]:::feature
                Cst["Constitution Module"]:::feature
                Dsp["Disputes Module"]:::feature
                Ofc["Officers Module"]:::feature
                Set["Settings Module"]:::feature
                HP -->|navigates| HP
                CP -->|navigates| Cmp
                CoP -->|navigates| Cst
                DP -->|navigates| Dsp
                OP -->|navigates| Ofc
                SP -->|navigates| Set
            end
        end

        %% UI Primitives
        subgraph "UI Library & Wizard Blocks"
            direction TB
            UI["shadcn/ui + custom primitives"]:::ui
            WB["Wizard Building Blocks"]:::ui
        end

        %% State & Styling
        subgraph "State & Styling"
            direction TB
            ST["State Management<br/>(Context API, useState)"]:::state
            STY["Styling Engine<br/>(Tailwind CSS)"]:::state
        end

        %% Internal flows
        AP -->|renders pages| HP & CP & CoP & DP & OP & SP
        CP & CoP & DP & OP & SP -->|use components| Cmp & Cst & Dsp & Ofc & Set
        Cmp & Cst & Dsp & Ofc & Set -->|use UI primitives| UI & WB
        UI & WB -->|styled by| STY
        Cmp & Cst & Dsp & Ofc & Set -->|share state| ST
    end

    %% Runtime
    VC -->|serves index.html & bundles| Browser["Browser (User)"]:::external
    Browser -->|interacts| MT

    %% Click events
    click MT "https://github.com/eudoca/wisecomply_new/blob/master/src/main.tsx"
    click AP "https://github.com/eudoca/wisecomply_new/blob/master/src/App.tsx"
    click AL "https://github.com/eudoca/wisecomply_new/blob/master/src/layouts/AuthLayout.tsx"
    click DL "https://github.com/eudoca/wisecomply_new/blob/master/src/layouts/DashboardLayout.tsx"
    click HP "https://github.com/eudoca/wisecomply_new/blob/master/src/pages/HomePage.tsx"
    click CP "https://github.com/eudoca/wisecomply_new/blob/master/src/pages/ComplianceActivitiesPage.tsx"
    click CoP "https://github.com/eudoca/wisecomply_new/blob/master/src/pages/ConstitutionPage.tsx"
    click DP "https://github.com/eudoca/wisecomply_new/blob/master/src/pages/DisputesPage.tsx"
    click OP "https://github.com/eudoca/wisecomply_new/blob/master/src/pages/OfficersPage.tsx"
    click SP "https://github.com/eudoca/wisecomply_new/blob/master/src/pages/SettingsPage.tsx"
    click Cmp "https://github.com/eudoca/wisecomply_new/tree/master/src/components/compliance/"
    click Cst "https://github.com/eudoca/wisecomply_new/tree/master/src/components/constitution/"
    click Dsp "https://github.com/eudoca/wisecomply_new/tree/master/src/components/disputes/"
    click Ofc "https://github.com/eudoca/wisecomply_new/tree/master/src/components/officers/"
    click Set "https://github.com/eudoca/wisecomply_new/tree/master/src/components/settings/"
    click UI "https://github.com/eudoca/wisecomply_new/tree/master/src/components/ui/"
    click WB "https://github.com/eudoca/wisecomply_new/tree/master/src/components/wizard/"
    click STY "https://github.com/eudoca/wisecomply_new/blob/master/tailwind.config.js"
    click STY "https://github.com/eudoca/wisecomply_new/blob/master/postcss.config.js"
    click STY "https://github.com/eudoca/wisecomply_new/blob/master/src/index.css"
    click VB "https://github.com/eudoca/wisecomply_new/blob/master/vite.config.ts"
    click VB "https://github.com/eudoca/wisecomply_new/blob/master/tsconfig.json"
    click VB "https://github.com/eudoca/wisecomply_new/blob/master/tsconfig.build.json"
    click VC "https://github.com/eudoca/wisecomply_new/blob/master/vercel.json"

    %% Styles
    classDef build fill:#d3d3d3,stroke:#888;
    classDef routing fill:#bbdefb,stroke:#2196f3;
    classDef feature fill:#c8e6c9,stroke:#388e3c;
    classDef ui fill:#ffe0b2,stroke:#fb8c00;
    classDef state fill:#fff9c4,stroke:#fbc02d;
    classDef external fill:#e1bee7,stroke:#8e24aa;
```
