# marcovdss/phishguard-app architecture

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

- Interactive diagram: https://gitdiagram.com/marcovdss/phishguard-app
- Repository: https://github.com/marcovdss/phishguard-app

## Overview

##### Project Type and Purpose
- This is a full-stack application bootstrapped with Next.js (as indicated in the README), but it also incorporates additional backend functionality.
- The project appears to focus on “phishguard” functionality – several source files (such as phishguard.py, api/phishguard.js, and modules within api/checker) indicate that the system performs security checks like whitelist/blacklist validations, SSL verifications, and WHOIS lookups.
- The project is containerized, as seen by the docker-compose.yml and dockerfile, which will be important in representing the deployment architecture.

##### Analyzing the File Structure
- Top-level Directories/Files:
- The Next.js frontend code is located in the “src/app” directory (containing pages, components such as CheckResults.tsx, layout.tsx, and associated assets).
- The “api” directory contains backend code. Within “api”, there is a “checker” subdirectory that hosts security check modules (blacklist.py, check_ssl.py, whois_lookup.py) and a server script (server.py) along with a JavaScript variant (phishguard.js).
- Additional scripts like phishguard.py seem to offer parallel or supporting functionality.
- Configuration and containerization files (docker-compose.yml, dockerfile, eslint.config.mjs, tsconfig.json, package.json, etc.) suggest how the system is built, linted, and deployed.
- Architectural Pointers:
- There is a clear separation between the frontend (Next.js UI) and backend (security-check modules and possibly API logic).
- The “checker” submodule indicates modular design where each module is in charge of a particular security check. This might follow a microservices or modular monolithic approach within the API.
- Docker files mean that deployment can encapsulate all core services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser("Browser / Client"):::external

    subgraph "Frontend Layer"
        NextJS("Next.js Frontend"):::frontend
    end

    Browser -->|"HTTP_requests"| NextJS

    subgraph "Backend Services"
        APIServer("API Server (Python)"):::backend
        Checker("Checker Modules"):::backend
        NodeJS("Phishguard JS (Node.js Utility)"):::backend
        Standalone("Standalone Python Service"):::backend
    end

    NextJS -->|"API_calls"| APIServer
    APIServer -->|"security_check"| Checker
    APIServer -->|"utilizes"| NodeJS
    APIServer -->|"triggers"| Standalone

    subgraph "Deployment Configurations"
        Compose("Docker Compose"):::container
        Dockerfile("Dockerfile"):::container
    end

    Compose -->|"deploys"| NextJS
    Compose -->|"deploys"| APIServer
    Dockerfile -->|"builds"| NextJS
    Dockerfile -->|"builds"| APIServer
    Dockerfile -->|"builds"| Checker
    Dockerfile -->|"builds"| NodeJS
    Dockerfile -->|"builds"| Standalone

    click NextJS "https://github.com/marcovdss/phishguard-app/tree/main/src/app"
    click APIServer "https://github.com/marcovdss/phishguard-app/blob/main/api/server.py"
    click Checker "https://github.com/marcovdss/phishguard-app/tree/main/api/checker"
    click NodeJS "https://github.com/marcovdss/phishguard-app/blob/main/api/phishguard.js"
    click Standalone "https://github.com/marcovdss/phishguard-app/blob/main/phishguard.py"
    click Compose "https://github.com/marcovdss/phishguard-app/blob/main/docker-compose.yml"
    click Dockerfile "https://github.com/marcovdss/phishguard-app/tree/main/dockerfile"

    classDef external fill:#ffe6e6,stroke:#cc0000,stroke-width:2px;
    classDef frontend fill:#e6f7ff,stroke:#005eaa,stroke-width:2px;
    classDef backend fill:#e6ffe6,stroke:#008000,stroke-width:2px;
    classDef container fill:#fff5e6,stroke:#cc6600,stroke-width:2px;
```
