# tani0211/sem2-project architecture

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

- Interactive diagram: https://gitdiagram.com/tani0211/sem2-project
- Repository: https://github.com/tani0211/sem2-project

## Overview

##### Main Components
- Frontend/UI: Represented by index.html, project.css, and project.js. This is the client-facing part where users interact with the application, input Sudoku puzzles manually, or upload images.
- Backend/Server: Represented by app.py. This component includes the core logic like the backtracking algorithm for solving puzzles, hint generation, and image processing (leveraging Tesseract OCR).
- External Services/Libraries: While not a separate service per se, indicate integration with Tesseract OCR and any additional image processing libraries as noted in the README. Similarly, the requirements.txt lists dependency management for the Python environment.

##### Architectural Patterns/Design Principles
- Separation between presentation (frontend) and business logic (backend) which is common in full-stack design.
- Flow where the frontend makes RESTful (or similar) calls to the backend.
- The application’s integration with external OCR functionality can be highlighted as a modular component within the backend.

##### Relevant Technologies and Frameworks
- Python is the main programming language (app.py), with its dependencies managed by requirements.txt.
- Client-side technologies include HTML (index.html), CSS (project.css), and JavaScript (project.js).
- Tesseract OCR is a key technology for image-based puzzle extraction.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Node
    U["User/Browser"]:::user

    %% Frontend Subgraph
    subgraph "Frontend (Client-side)"
        F1["index.html"]:::frontend
        F2["project.css"]:::frontend
        F3["project.js"]:::frontend
    end

    %% Backend Subgraph
    subgraph "Backend (Server-side)"
        B1["app.py"]:::backend
        B2["__pycache__"]:::cache
    end

    %% OCR & Image Processing Subgraph
    subgraph "OCR & Image Processing"
        O1["Tesseract OCR & Image Processing Module"]:::external
        O2["requirements.txt"]:::external
    end

    %% Connections
    U -->|"interacts"| F1
    F1 -->|"HTTPRequest"| B1
    B1 -->|"ProcessImage"| O1
    B1 -->|"ReturnData"| F1

    %% Internal connection for caching details (implementation detail)
    B1 ---|"compilesTo"| B2

    %% Click Events
    click F1 "https://github.com/tani0211/sem2-project/blob/main/index.html"
    click F2 "https://github.com/tani0211/sem2-project/blob/main/project.css"
    click F3 "https://github.com/tani0211/sem2-project/blob/main/project.js"
    click B1 "https://github.com/tani0211/sem2-project/blob/main/app.py"
    click O2 "https://github.com/tani0211/sem2-project/blob/main/requirements.txt"
    click B2 "https://github.com/tani0211/sem2-project/tree/main/__pycache__"

    %% Styles
    classDef user fill:#ffe680,stroke:#b38f00,stroke-width:2px;
    classDef frontend fill:#ccf2ff,stroke:#0073e6,stroke-width:2px;
    classDef backend fill:#d0f0c0,stroke:#228B22,stroke-width:2px;
    classDef external fill:#ffddcc,stroke:#ff6600,stroke-width:2px;
    classDef cache fill:#e6e6e6,stroke:#808080,stroke-width:2px;
```
