# npqace/vietjusticia architecture

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

- Interactive diagram: https://gitdiagram.com/npqace/vietjusticia
- Repository: https://github.com/npqace/vietjusticia

## Overview

##### Project Type and Purpose
- From the name “LawSphere – FYP” we infer this is a Final Year Project in the legal/tech domain.
- Confirm whether it’s a web application (full-stack), a CLI tool, a library for legal document processing, a mobile app, or a microservices platform.
- Read the README.md for a project overview (features, target users, use cases). If the README is sparse, look for a design doc or ask the team.

##### File Structure
- Out top-level folders (e.g. “frontend/”, “backend/”, “services/”, “models/”, “scripts/”, “tests/”).
- Config or orchestration files (Dockerfile, docker-compose.yml, k8s manifests, CI pipelines).
- Language runtimes (Python, Node.js, Java), frameworks (React, Angular, Express, Django), and data-layer code (ORMs, raw SQL, migrations).

##### README and Coding Standards
- Look for “Architecture” or “Getting Started” sections.
- References to external systems (payment gateways, NLP APIs, authentication providers).
- Third-party libraries or services (Elasticsearch, PostgreSQL, Redis, AWS Lambda).

a. Main Components
– Client/UI (e.g. React web app, mobile app, CLI)
– Application Server(s) (REST or GraphQL API)
– Data Layer (Relational DB, NoSQL store, search index)
– Background Workers / Batch Jobs (if any)
– External Integrations (legal-tech APIs, OAuth providers)
b. Relationships & Data Flow
c. Architectural Patterns
– MVC or MVVM on the frontend
– Layered / hexagonal / onion architecture on the backend
– CQRS/Event Sourcing if present
– Microservices vs. monolith delineation
d. Key Technologies
– Show build tools (Webpack, Babel), containerization (Docker), and cloud infra (AWS, GCP).

##### Final Review and Detail
- Every major module or folder from your actual file tree is represented.
- Deployment boundaries (on-prem vs. cloud, Kubernetes namespaces).
- Note blocks for any asynchronous retry policies, security layers (OAuth, JWT), and monitoring/observability tools.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Documentation
    Documentation["Project Overview / Documentation"]:::external

    %% Frontend Layer
    subgraph "Frontend Layer"
        WebClient["React + Redux Web App"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        APIServer["Node.js + Express API"]:::services
        AuthService["OAuth / JWT Authentication"]:::services
        Worker["Background Worker (BullMQ)"]:::services
    end

    %% Data Layer
    subgraph "Data Layer"
        Postgres["PostgreSQL Database"]:::database
        Elasticsearch["Elasticsearch Search Index"]:::database
        Redis["Redis Cache / Queue"]:::database
    end

    %% External Integrations
    subgraph "External Services"
        LegalAPI["External Legal-Tech APIs"]:::external
        OAuthProvider["OAuth Provider (Google, Microsoft)"]:::external
    end

    %% Relationships
    Documentation --> WebClient
    WebClient -->|"HTTP REST / GraphQL"| APIServer
    WebClient -->|"Auth Redirect"| OAuthProvider
    OAuthProvider -->|"Auth Token"| AuthService
    APIServer -->|"SQL Queries"| Postgres
    APIServer -->|"Search Queries"| Elasticsearch
    APIServer -->|"Cache Read/Write"| Redis
    APIServer -->|"Enqueue Jobs"| Redis
    Worker -->|"Process Jobs"| Redis
    Worker -->|"Update DB"| Postgres
    APIServer -->|"Invoke External"| LegalAPI

    %% Click Events
    click Documentation "https://github.com/npqace/vietjusticia/blob/main/README.md"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef services fill:#d4edda,stroke:#333,stroke-width:1px
    classDef database fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef external fill:#f8d7da,stroke:#333,stroke-width:1px
```
