# maazlab/essayevalpro architecture

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

- Interactive diagram: https://gitdiagram.com/maazlab/essayevalpro
- Repository: https://github.com/maazlab/essayevalpro

## Overview

##### Project type and purpose
- EssayEvalPro is a Python-based backend service (a command-line or micro-service application) that ingests student essays, runs NLP pipelines for plagiarism detection, relevancy analysis, and grammar checking, then returns a composite score. There is no separate “frontend” directory, so it’s purely backend, callable via `python app.py`.

##### File structure
- Top-level files:
- app.py – the entry point that orchestrates the workflow
- utils.py – helper functions for text processing, DB I/O, or metric calculations
- requirements.txt – lists Python NLP and DB libraries
- Data files:
- training_set.tsv – corpus for plagiarism baseline or relevancy models
- sample.txt, test.txt, *.txt/.pdf/.docx – example essays or tests
- Postman collections:
- Contract Testing.postman_collection.json, Integration Testing.postman_collection.json, etc. – indicate there may be REST endpoints under test (even if not reflected in a “routes/” folder, the author intends to expose an HTTP API).

##### README for additional insights
- The system performs four sequential tasks:
1. Plagiarism Detection (compare input vs. essay DB)
2. Relevancy Calculation (title vs. content alignment)
3. Grammar Mistake Analysis (NLP grammar checks)
4. Score Generation (aggregates metrics)
- Dependencies on an existing essay database or configurable new database.

##### Elements
- Clear component labels (e.g., “Plagiarism Detector”)
- Rectangles for services/modules
- Parallelograms for external clients

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client[/"Client (Teacher UI or CLI)"/]:::client
    API["API Layer / Controller\n(Flask App)"]:::api
    Utils["Utility Functions\n(utils.py)"]:::util
    subgraph "NLP Pipeline"
        direction TB
        PD["Plagiarism Detector"]:::nlp
        RA["Relevancy Analyzer"]:::nlp
        GC["Grammar Checker"]:::nlp
    end
    SA["Score Aggregator"]:::api
    subgraph "Data Stores"
        direction TB
        DB[(Essay Database)]:::db
        Config[(Configuration Store)]:::db
    end
    subgraph "Data Files"
        direction TB
        TS["training_set.tsv"]:::data
        subgraph "Sample Essays / Tests"
            direction TB
            S1["sample.txt"]:::data
            S2["test.txt"]:::data
            S3["test2.txt"]:::data
            S4["test3.txt"]:::data
            S5["test4.txt"]:::data
            S6["animals.txt"]:::data
            S7["cricket.txt"]:::data
            S8["football.txt"]:::data
        end
        subgraph "Grammar Reference Files"
            direction TB
            G1["Grammar and spelling mistakes.txt"]:::data
            G2["Grammar mistakes.txt"]:::data
        end
    end
    subgraph "Test Harness"
        direction TB
        CT["Contract Testing.postman_collection.json"]:::test
        IT["Integration Testing.postman_collection.json"]:::test
        IWT["Intro to Writing Tests.postman_collection.json"]:::test
        MDG["Mock Data Generation.postman_collection.json"]:::test
    end
    Doc["Project Documentation\n(README.md)"]:::doc

    Client --> API
    API --> Utils
    API --> PD
    API --> RA
    API --> GC
    PD -->|reads baseline| DB
    RA -->|may read baseline| DB
    GC -->|loads rules| Utils
    PD --> TS
    RA --> TS
    GC --> G1
    GC --> G2
    S1 --> PD
    S2 --> RA
    S3 --> GC
    SA --> Client
    PD --> SA
    RA --> SA
    GC --> SA
    API --> CT
    API --> IT
    API --> IWT
    API --> MDG
    API --> Doc

    click API "https://github.com/maazlab/essayevalpro/blob/main/app.py"
    click Utils "https://github.com/maazlab/essayevalpro/blob/main/utils.py"
    click TS "https://github.com/maazlab/essayevalpro/blob/main/training_set.tsv"
    click S1 "https://github.com/maazlab/essayevalpro/blob/main/sample.txt"
    click S2 "https://github.com/maazlab/essayevalpro/blob/main/test.txt"
    click S3 "https://github.com/maazlab/essayevalpro/blob/main/test2.txt"
    click S4 "https://github.com/maazlab/essayevalpro/blob/main/test3.txt"
    click S5 "https://github.com/maazlab/essayevalpro/blob/main/test4.txt"
    click S6 "https://github.com/maazlab/essayevalpro/blob/main/animals.txt"
    click S7 "https://github.com/maazlab/essayevalpro/blob/main/cricket.txt"
    click S8 "https://github.com/maazlab/essayevalpro/blob/main/football.txt"
    click G1 "https://github.com/maazlab/essayevalpro/blob/main/Grammar and spelling mistakes.txt"
    click G2 "https://github.com/maazlab/essayevalpro/blob/main/Grammar mistakes.txt"
    click Doc "https://github.com/maazlab/essayevalpro/blob/main/README.md"
    click CT "https://github.com/maazlab/essayevalpro/blob/main/Contract Testing.postman_collection.json"
    click IT "https://github.com/maazlab/essayevalpro/blob/main/Integration Testing.postman_collection.json"
    click IWT "https://github.com/maazlab/essayevalpro/blob/main/Intro to Writing Tests.postman_collection.json"
    click MDG "https://github.com/maazlab/essayevalpro/blob/main/Mock Data Generation.postman_collection.json"
    click requirements "https://github.com/maazlab/essayevalpro/blob/main/requirements.txt"

    classDef client fill:#f9f,stroke:#333,stroke-width:1px
    classDef api fill:#bbf,stroke:#333,stroke-width:1px
    classDef util fill:#bfb,stroke:#333,stroke-width:1px
    classDef nlp fill:#ffb,stroke:#333,stroke-width:1px
    classDef db fill:#fbf,stroke:#333,stroke-width:1px
    classDef data fill:#efe,stroke:#333,stroke-width:1px
    classDef test fill:#fdd,stroke:#333,stroke-width:1px
    classDef doc fill:#ffd,stroke:#333,stroke-width:1px
```
