# wendellarnald/fiscalcalendar architecture

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

- Interactive diagram: https://gitdiagram.com/wendellarnald/fiscalcalendar
- Repository: https://github.com/wendellarnald/fiscalcalendar

## Overview

##### Project type and purpose
- This is a small full-stack web application called “FiscalCalendar.”
- It serves a static frontend (HTML/CSS/JS) that displays fiscal deadlines, and a Go-based backend that exposes those deadlines via an HTTP API endpoint.

##### File structure
- Top level: README.md plus two main directories:
- frontend/ – static assets (index.html, styles.css, main.js)
- backend/ – Go service (main.go), module files (go.mod, go.sum), data (deadlines.json), and domain model (models/deadline.go)
- The backend likely reads deadlines.json through the Deadline model and exposes them as JSON over HTTP.
- No external database—data is stored in a JSON file under backend/data.

##### README for additional insights
- Client browser → HTTP GET to Go server → raw JSON data → client renders calendar UI.

##### Diagramming recommendations
1. Browser → Fetch static assets
2. JS → GET /deadlines API
3. API → Read deadlines.json
4. API → Response JSON → Browser

##### Essential architectural elements to capture
- Separation of static-asset hosting vs. API logic
- Data-loading path from JSON file through models to HTTP response
- Client-side rendering step

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Nodes
    Browser["User Browser"]:::browser

    subgraph "Frontend Layer"
        HTML["index.html"]:::frontend
        CSS["styles.css"]:::frontend
        JS["main.js"]:::frontend
    end

    subgraph "Backend/API Layer"
        API["Go HTTP Server (main.go)"]:::backend
        Model["Domain Model (deadline.go)"]:::backend
        Mod["go.mod"]:::backend
        Sum["go.sum"]:::backend
    end

    Data[(deadlines.json)]:::datastore

    %% Connections
    Browser -->|"GET /index.html"| HTML
    Browser -->|"GET /css/styles.css"| CSS
    Browser -->|"GET /js/main.js"| JS
    JS -->|"GET /deadlines"| API
    API -->|"reads file"| Data
    Data -->|"JSON data"| API
    API -->|"200 OK JSON"| JS

    %% Click Events
    click HTML "https://github.com/wendellarnald/fiscalcalendar/blob/main/frontend/index.html"
    click CSS "https://github.com/wendellarnald/fiscalcalendar/blob/main/frontend/css/styles.css"
    click JS "https://github.com/wendellarnald/fiscalcalendar/blob/main/frontend/js/main.js"
    click API "https://github.com/wendellarnald/fiscalcalendar/blob/main/backend/main.go"
    click Model "https://github.com/wendellarnald/fiscalcalendar/blob/main/backend/models/deadline.go"
    click Mod "https://github.com/wendellarnald/fiscalcalendar/blob/main/backend/go.mod"
    click Sum "https://github.com/wendellarnald/fiscalcalendar/blob/main/backend/go.sum"
    click Data "https://github.com/wendellarnald/fiscalcalendar/blob/main/backend/data/deadlines.json"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#2E86C1,color:#1B4F72
    classDef backend fill:#D5F5E3,stroke:#27AE60,color:#145A32
    classDef datastore fill:#FDEBD0,stroke:#D35400,color:#922B21
    classDef browser fill:#E8DAEF,stroke:#8E44AD,color:#4A235A
```
