# sk115511/grassgoal architecture

> Architecture diagram of the GitHub repository sk115511/grassgoal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sk115511/grassgoal
- Repository: https://github.com/sk115511/grassgoal

## Overview

GRASSGOAL is a football tournament-management web app. Users sign in and select a role; organizers create tournaments, managers build teams and register them, and organizers approve entries and generate fixtures. Match events feed score updates, which organizers confirm before results are published and standings update. The README documents this workflow and audit logging; the excerpts show app.js making Supabase calls. Detailed internal implementations and schema contents were not sampled, so several domain links rely on README evidence.

Main entry points: [`app.js`](https://github.com/sk115511/grassgoal/blob/main/app.js) (GRASSGOAL app), [`config.js`](https://github.com/sk115511/grassgoal/blob/main/config.js) (Supabase connection config), [`supabase-schema.sql`](https://github.com/sk115511/grassgoal/blob/main/supabase-schema.sql) (App database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["GRASSGOAL app<br/>[app.js]"]
  node_auth["Authentication<br/>[app.js]"]
  node_roles["Role profiles<br/>[app.js]"]
end

subgraph group_competition["Tournament operations"]
  node_verification["Organizer verification<br/>[app.js]"]
  node_tournament["Tournament setup<br/>[app.js]"]
  node_teams["Teams and squads<br/>[app.js]"]
  node_registration["Team registration<br/>[app.js]"]
  node_fixtures["Fixture generation<br/>[app.js]"]
  node_scoring["Match scoring<br/>[app.js]"]
  node_confirmation["Result confirmation<br/>[app.js]"]
  node_standings["Standings<br/>[app.js]"]
  node_audit["Score audit log<br/>[app.js]"]
end

subgraph group_backend["Supabase backend"]
  node_supabase["Supabase services"]
  node_database[("App database")]
  node_config["Supabase connection config<br/>[config.js]"]
end

node_user(("Football users"))

node_user -->|"uses"| node_app
node_app -->|"handles login"| node_auth
node_auth -->|"authenticates with"| node_supabase
node_app -->|"sets role"| node_roles
node_roles -->|"requests approval"| node_verification
node_verification -->|"enables creation"| node_tournament
node_user -->|"organizer creates"| node_tournament
node_user -->|"manager creates"| node_teams
node_teams -->|"registers for"| node_registration
node_user -->|"organizer approves"| node_registration
node_registration -->|"approved entries seed"| node_fixtures
node_user -->|"records match events"| node_scoring
node_scoring -->|"submits full-time"| node_confirmation
node_user -->|"organizer confirms"| node_confirmation
node_confirmation -->|"updates standings"| node_standings
node_scoring -->|"logs score changes"| node_audit
node_app -->|"uses auth and database"| node_supabase
node_supabase -->|"stores app data"| node_database
node_config -->|"configures connection"| node_supabase

click node_app "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_auth "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_roles "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_verification "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_tournament "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_teams "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_registration "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_fixtures "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_scoring "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_confirmation "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_standings "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_audit "https://github.com/sk115511/grassgoal/blob/main/app.js"
click node_database "https://github.com/sk115511/grassgoal/blob/main/supabase-schema.sql"
click node_config "https://github.com/sk115511/grassgoal/blob/main/config.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth,node_roles,node_user toneBlue
class node_verification,node_tournament,node_teams,node_registration,node_fixtures,node_scoring,node_confirmation,node_standings,node_audit toneAmber
class node_supabase,node_database,node_config toneMint
```

## Components

### Web application

- [GRASSGOAL app](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Authentication](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Role profiles](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`

### Tournament operations

- [Organizer verification](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Tournament setup](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Teams and squads](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Team registration](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Fixture generation](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Match scoring](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Result confirmation](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Standings](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`
- [Score audit log](https://github.com/sk115511/grassgoal/blob/main/app.js): `app.js`

### Supabase backend

- **Supabase services**
- [App database](https://github.com/sk115511/grassgoal/blob/main/supabase-schema.sql): `supabase-schema.sql`
- [Supabase connection config](https://github.com/sk115511/grassgoal/blob/main/config.js): `config.js`

### Other components

- **Football users**

## Connections

- Football users → GRASSGOAL app: uses (evidence: `README.txt`)
- GRASSGOAL app → Authentication: handles login (evidence: `README.txt`)
- Authentication → Supabase services: authenticates with (evidence: `app.js`)
- GRASSGOAL app → Role profiles: sets role (evidence: `README.txt`)
- Role profiles → Organizer verification: requests approval (evidence: `README.txt`)
- Organizer verification → Tournament setup: enables creation (evidence: `README.txt`)
- Football users → Tournament setup: organizer creates (evidence: `README.txt`)
- Football users → Teams and squads: manager creates (evidence: `README.txt`)
- Teams and squads → Team registration: registers for (evidence: `README.txt`)
- Football users → Team registration: organizer approves (evidence: `README.txt`)
- Team registration → Fixture generation: approved entries seed (evidence: `README.txt`)
- Football users → Match scoring: records match events (evidence: `README.txt`)
- Match scoring → Result confirmation: submits full-time (evidence: `README.txt`)
- Football users → Result confirmation: organizer confirms (evidence: `README.txt`)
- Result confirmation → Standings: updates standings (evidence: `README.txt`)
- Match scoring → Score audit log: logs score changes (evidence: `README.txt`)
- GRASSGOAL app → Supabase services: uses auth and database (evidence: `app.js`)
- Supabase services → App database: stores app data (evidence: `README.txt`)
- Supabase connection config → Supabase services: configures connection (evidence: `README.txt`)
