# wkgit0/asaanqanoon architecture

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

- Interactive diagram: https://gitdiagram.com/wkgit0/asaanqanoon
- Repository: https://github.com/wkgit0/asaanqanoon

## Overview

##### Project type and purpose
- From the README and the naming of the zip files (“Phase-1,” “final‐work,” “main”), AsaanQanoon is clearly a full-stack web application—a legal resource platform that delivers simplified law content in Urdu and English to end users.
- Its main use case is serving static and dynamic legal documents, allowing users to browse, search, and read laws in human-friendly language.

##### File structure
- At the top level you see only ZIP archives, a LICENSE, and a README. In practice each ZIP will expand into:
- A frontend application (probably under a directory like “frontend/” or “client/”)
- A backend API (in “backend/” or “server/”)
- Asset or content folders (“static/” or “docs/”)
- Configuration files (Dockerfile, CI scripts, .env templates)
- Tests (unit/ and integration/)

##### README for additional insights
- The README describes core features (simplified legal content, dual-language support, updates).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    subgraph "User Devices" 
        direction TB
        Browser["Web Browser / Mobile App"]:::frontend
    end

    %% Documentation Layer
    subgraph "Project Artifacts"
        direction TB
        README["README.md"]:::docs
        LICENSE["LICENSE"]:::docs
        Phase1["Phase-1 Snapshot"]:::docs
        FinalWork["Final Work Snapshot"]:::docs
        MainBranch["Main Branch Snapshot"]:::docs
    end

    %% CDN and Load Balancer
    Browser -->|"HTTPS"| CDN["CDN / Static Asset Host"]:::cdn
    CDN -->|"Cache Miss"| LB["Load Balancer / API Gateway"]:::gateway

    %% Backend Services
    subgraph "Backend Services" 
        direction TB
        ContentSvc["Content Service"]:::backend
        SearchSvc["Search Service"]:::backend
        NotifySvc["Notification Service"]:::backend
    end

    LB -->|"Route Request"| ContentSvc
    LB -->|"Route Request"| SearchSvc
    LB -->|"Route Request"| NotifySvc

    %% Data Stores
    subgraph "Data Stores"
        direction TB
        PrimaryDB[(Primary DB)]:::database
        SearchIndex[(Search Index)]:::database
        Cache[(Redis Cache)]:::database
    end

    ContentSvc -->|"SQL/JSON"| PrimaryDB
    ContentSvc -->|"Cache Get/Set"| Cache
    SearchSvc -->|"Query"| SearchIndex
    NotifySvc -->|"Update DB"| PrimaryDB
    NotifySvc -->|"Cache Invalidate"| Cache

    %% External Integrations
    subgraph "External Systems"
        direction TB
        Feeds["Legal Update Feeds"]:::external
        AuthProvider["OAuth2 / JWT Provider"]:::external
    end

    NotifySvc -->|"Poll/RSS"| Feeds
    LB -->|"Auth Token Validation"| AuthProvider

    %% Client API Calls
    Browser -->|"REST/GraphQL"| LB

    %% Click Events
    click README "https://github.com/wkgit0/asaanqanoon/blob/main/README.md"
    click LICENSE "https://github.com/wkgit0/asaanqanoon/tree/main/LICENSE"
    click Phase1 "https://github.com/wkgit0/asaanqanoon/blob/main/FYP-Asaan-Qanoon-FYP-Phase-1.zip"
    click FinalWork "https://github.com/wkgit0/asaanqanoon/blob/main/FYP-Asaan-Qanoon-final-work.zip"
    click MainBranch "https://github.com/wkgit0/asaanqanoon/blob/main/FYP-Asaan-Qanoon-main.zip"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#3399ff,color:#003366;
    classDef docs fill:#e6f7ff,stroke:#66b2ff,color:#004d99;
    classDef cdn fill:#fff0b3,stroke:#ffcc00,color:#806600;
    classDef gateway fill:#e6ffe6,stroke:#33cc33,color:#004d1a;
    classDef backend fill:#e6ffe6,stroke:#33cc33,color:#004d1a;
    classDef database fill:#ffe6e6,stroke:#ff6666,color:#800000,shape:cylinder;
    classDef external fill:#f2f2f2,stroke:#b3b3b3,color:#666666,shape:cloud;
```
