# sarguna01/go-web-app--project1 architecture

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

- Interactive diagram: https://gitdiagram.com/sarguna01/go-web-app--project1
- Repository: https://github.com/sarguna01/go-web-app--project1

## Overview

A small Go website serves four static pages. A browser requests a route, the HTTP server dispatches to its handler, and that handler serves the corresponding HTML file. The source excerpt shows route registration and file serving; the README documents the server address and how to access the courses page.

Main entry points: [`main.go`](https://github.com/sarguna01/go-web-app--project1/blob/main/main.go) (HTTP server), [`static/home.html`](https://github.com/sarguna01/go-web-app--project1/blob/main/static/home.html) (Home page), [`static/courses.html`](https://github.com/sarguna01/go-web-app--project1/blob/main/static/courses.html) (Courses page), [`static/about.html`](https://github.com/sarguna01/go-web-app--project1/blob/main/static/about.html) (About page)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_visitor(("Browser visitor"))
node_server["HTTP server<br/>[main.go]"]
node_home_handler["Home handler<br/>[main.go]"]
node_courses_handler["Courses handler<br/>[main.go]"]
node_about_handler["About handler<br/>[main.go]"]
node_contact_handler["Contact handler<br/>[main.go]"]
node_home_page["Home page<br/>[home.html]"]
node_courses_page["Courses page<br/>[courses.html]"]
node_about_page["About page<br/>[about.html]"]
node_contact_page["Contact page<br/>[contact.html]"]

node_visitor -->|"requests pages"| node_server
node_server -->|"routes /home"| node_home_handler
node_server -->|"routes /courses"| node_courses_handler
node_server -->|"routes /about"| node_about_handler
node_server -->|"routes /contact"| node_contact_handler
node_home_handler -->|"serves file"| node_home_page
node_courses_handler -->|"serves file"| node_courses_page
node_about_handler -->|"serves file"| node_about_page
node_contact_handler -->|"serves file"| node_contact_page

click node_server "https://github.com/sarguna01/go-web-app--project1/blob/main/main.go"
click node_home_handler "https://github.com/sarguna01/go-web-app--project1/blob/main/main.go"
click node_courses_handler "https://github.com/sarguna01/go-web-app--project1/blob/main/main.go"
click node_about_handler "https://github.com/sarguna01/go-web-app--project1/blob/main/main.go"
click node_contact_handler "https://github.com/sarguna01/go-web-app--project1/blob/main/main.go"
click node_home_page "https://github.com/sarguna01/go-web-app--project1/blob/main/static/home.html"
click node_courses_page "https://github.com/sarguna01/go-web-app--project1/blob/main/static/courses.html"
click node_about_page "https://github.com/sarguna01/go-web-app--project1/blob/main/static/about.html"
click node_contact_page "https://github.com/sarguna01/go-web-app--project1/blob/main/static/contact.html"

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_visitor toneBlue
class node_server,node_home_handler,node_courses_handler,node_about_handler,node_contact_handler toneMint
class node_home_page,node_courses_page,node_about_page,node_contact_page toneTeal
```

## Components

### Other components

- **Browser visitor**
- [HTTP server](https://github.com/sarguna01/go-web-app--project1/blob/main/main.go): `main.go`
- [Home handler](https://github.com/sarguna01/go-web-app--project1/blob/main/main.go): `main.go`
- [Courses handler](https://github.com/sarguna01/go-web-app--project1/blob/main/main.go): `main.go`
- [About handler](https://github.com/sarguna01/go-web-app--project1/blob/main/main.go): `main.go`
- [Contact handler](https://github.com/sarguna01/go-web-app--project1/blob/main/main.go): `main.go`
- [Home page](https://github.com/sarguna01/go-web-app--project1/blob/main/static/home.html): `static/home.html`
- [Courses page](https://github.com/sarguna01/go-web-app--project1/blob/main/static/courses.html): `static/courses.html`
- [About page](https://github.com/sarguna01/go-web-app--project1/blob/main/static/about.html): `static/about.html`
- [Contact page](https://github.com/sarguna01/go-web-app--project1/blob/main/static/contact.html): `static/contact.html`

## Connections

- Browser visitor → HTTP server: requests pages (evidence: `README.md`)
- HTTP server → Home handler: routes /home (evidence: `main.go`)
- HTTP server → Courses handler: routes /courses (evidence: `main.go`)
- HTTP server → About handler: routes /about (evidence: `main.go`)
- HTTP server → Contact handler: routes /contact (evidence: `main.go`)
- Home handler → Home page: serves file (evidence: `main.go`)
- Courses handler → Courses page: serves file (evidence: `main.go`)
- About handler → About page: serves file (evidence: `main.go`)
- Contact handler → Contact page: serves file (evidence: `main.go`)
