# thin-equation/matchpoint architecture

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

- Interactive diagram: https://gitdiagram.com/thin-equation/matchpoint
- Repository: https://github.com/thin-equation/matchpoint

## Overview

##### Main Components Identification

a) Frontend Layer (MatchPointFrontend):
- Built with TypeScript/React (evident from .tsx files)
- Uses Vite as build tool
- Implements TailwindCSS for styling
- Contains distinct pages and components

b) Backend Layer (MatchPointBackend):
- Python-based server
- Contains main application logic

c) Infrastructure Layer:
- Docker containerization (DockerFiles present)
- AWS Copilot deployment structure
- Nginx web server configuration

**┌─ Client Layer ─────────────────────┐**
- Browser/User Interface           │
- ┬───────────────────┘
- ↓
**┌─ Frontend Container ───────────────┐**
- ┌─ Nginx ─────────────────────┐   │
- Static File Serving         │   │
- ┘ │
- ┌─ React Application ──────────┐  │
- Home Component            │  │
- Upload Component          │  │
- Contact Component         │  │
- Feedback Component        │  │
- ┘ │
- ┬───────────────────┘
- ↓
**┌─ Backend Container ────────────────┐**
- ┌─ Python Server ───────────────┐ │
- API Endpoints              │ │
- Business Logic            │ │
- ┘ │
- ┘

##### Component Relationships

- HTTP/HTTPS requests between layers
- Internal component communications
- Data flow directions

##### Additional Elements

a) Infrastructure Details:
- Docker container boundaries
- AWS deployment configuration
- Network interfaces

b) Frontend Architecture:
- Component hierarchy
- Route structure
- Static asset handling

c) Backend Architecture:
- API endpoints
- Service layer
- Configuration management

##### Important Notes

- Containerized nature of both frontend and backend
- Nginx reverse proxy configuration
- How the frontend static assets are served
- TypeScript compilation process
- Python dependency management

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Browser/User Interface"]
    end

    subgraph FrontendContainer["Frontend Container"]
        Nginx["Nginx Server"]:::infrastructure
        click Nginx "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/nginx.conf"
        
        subgraph ReactApp["React Application"]
            AppCore["App Core"]:::frontend
            click AppCore "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/App.tsx"
            
            subgraph Components["Components"]
                HomeComp["Home Component"]:::frontend
                UploadComp["Upload Component"]:::frontend
                ContactComp["Contact Component"]:::frontend
                FeedbackComp["Feedback Component"]:::frontend
                click HomeComp "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/components/Home.tsx"
                click UploadComp "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/components/Upload.tsx"
                click ContactComp "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/components/Contact.tsx"
                click FeedbackComp "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/components/Feedback.tsx"
            end

            subgraph Pages["Pages"]
                HomePage["Home Page"]:::frontend
                UploadPage["Upload Page"]:::frontend
                ContactPage["Contact Page"]:::frontend
                FeedbackPage["Feedback Page"]:::frontend
                click HomePage "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/pages/home.tsx"
                click UploadPage "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/pages/upload.tsx"
                click ContactPage "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/pages/contact.tsx"
                click FeedbackPage "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointFrontend/src/pages/feedback.tsx"
            end

            BuildConfig["Build Configuration"]:::config
            click BuildConfig "https://github.com/Thin-Equation/MatchPoint/tree/main/MatchPointFrontend"
        end
    end

    subgraph BackendContainer["Backend Container"]
        PythonServer["Python Server"]:::backend
        click PythonServer "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointBackend/main.py"
        Dependencies["Dependencies"]:::config
        click Dependencies "https://github.com/Thin-Equation/MatchPoint/blob/main/MatchPointBackend/requirements.txt"
    end

    subgraph Infrastructure["Infrastructure"]
        DockerConfig["Docker Configuration"]:::infrastructure
        click DockerConfig "https://github.com/Thin-Equation/MatchPoint/tree/main/MatchPointFrontend/DockerFile"
        
        subgraph AWS["AWS Deployment"]
            FrontendService["Frontend Service"]:::deployment
            BackendService["Backend Service"]:::deployment
            TestEnv["Test Environment"]:::deployment
            click FrontendService "https://github.com/Thin-Equation/MatchPoint/blob/main/copilot/frontend-2/manifest.yml"
            click BackendService "https://github.com/Thin-Equation/MatchPoint/blob/main/copilot/backend-2/manifest.yml"
            click TestEnv "https://github.com/Thin-Equation/MatchPoint/blob/main/copilot/environments/test/manifest.yml"
        end
    end

    %% Relationships
    Browser --> Nginx
    Nginx --> AppCore
    AppCore --> Components
    AppCore --> Pages
    Components --> PythonServer
    Pages --> PythonServer

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#f1c40f,stroke:#f39c12,color:black
    classDef infrastructure fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef config fill:#2ecc71,stroke:#27ae60,color:white
    classDef deployment fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Component"]:::backend
        Infra["Infrastructure"]:::infrastructure
        Config["Configuration"]:::config
        Deploy["Deployment"]:::deployment
    end
```
