# mahmudur26/emo-cal architecture

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

- Interactive diagram: https://gitdiagram.com/mahmudur26/emo-cal
- Repository: https://github.com/mahmudur26/emo-cal

## Overview

Emo Cal is a small web calculator: a visitor opens the calculator page, enters two integers and an operator, then submits the calculation and receives operation details as JSON. The documented routes and response shape establish the main flow. The frontend JavaScript and calculation implementation were not sampled, so their internal wiring is not expanded here.

Main entry points: [`app/Http/Controllers/Calculator.php`](https://github.com/mahmudur26/emo-cal/blob/development/app/Http/Controllers/Calculator.php) (Calculator controller), [`public/index.php`](https://github.com/mahmudur26/emo-cal/blob/development/public/index.php) (HTTP entry), [`routes/web.php`](https://github.com/mahmudur26/emo-cal/blob/development/routes/web.php) (Web routes), [`resources/views/calculator.blade.php`](https://github.com/mahmudur26/emo-cal/blob/development/resources/views/calculator.blade.php) (Calculator page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP routing"]
  node_entry["HTTP entry<br/>[index.php]"]
  node_kernel["HTTP kernel<br/>[Kernel.php]"]
  node_routeprovider["Route provider"]
  node_webroutes["Web routes<br/>[web.php]"]
end

subgraph group_calc["Calculator"]
  node_calculator["Calculator controller<br/>[Calculator.php]"]
  node_json["Calculation JSON<br/>[Calculator.php]"]
end

subgraph group_ui["User interface"]
  node_page["Calculator page"]
end

node_visitor(("Visitor"))

node_visitor -->|"sends request"| node_entry
node_entry -->|"handles request"| node_kernel
node_routeprovider -->|"loads routes"| node_webroutes
node_webroutes -->|"dispatches route"| node_calculator
node_calculator -->|"renders page"| node_page
node_page -->|"presents form"| node_visitor
node_visitor -->|"submits operands"| node_entry
node_calculator -->|"returns result"| node_json
node_json -->|"delivers result"| node_visitor

click node_entry "https://github.com/mahmudur26/emo-cal/blob/development/public/index.php"
click node_kernel "https://github.com/mahmudur26/emo-cal/blob/development/app/Http/Kernel.php"
click node_routeprovider "https://github.com/mahmudur26/emo-cal/blob/development/app/Providers/RouteServiceProvider.php"
click node_webroutes "https://github.com/mahmudur26/emo-cal/blob/development/routes/web.php"
click node_calculator "https://github.com/mahmudur26/emo-cal/blob/development/app/Http/Controllers/Calculator.php"
click node_page "https://github.com/mahmudur26/emo-cal/blob/development/resources/views/calculator.blade.php"
click node_json "https://github.com/mahmudur26/emo-cal/blob/development/app/Http/Controllers/Calculator.php"

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_entry,node_kernel,node_routeprovider,node_webroutes toneBlue
class node_calculator,node_json toneAmber
class node_page toneMint
class node_visitor toneIndigo
```

## Components

### HTTP routing

- [HTTP entry](https://github.com/mahmudur26/emo-cal/blob/development/public/index.php): `public/index.php`
- [HTTP kernel](https://github.com/mahmudur26/emo-cal/blob/development/app/Http/Kernel.php): `app/Http/Kernel.php`
- [Route provider](https://github.com/mahmudur26/emo-cal/blob/development/app/Providers/RouteServiceProvider.php): `app/Providers/RouteServiceProvider.php`
- [Web routes](https://github.com/mahmudur26/emo-cal/blob/development/routes/web.php): `routes/web.php`

### Calculator

- [Calculator controller](https://github.com/mahmudur26/emo-cal/blob/development/app/Http/Controllers/Calculator.php): `app/Http/Controllers/Calculator.php`
- [Calculation JSON](https://github.com/mahmudur26/emo-cal/blob/development/app/Http/Controllers/Calculator.php): `app/Http/Controllers/Calculator.php`

### User interface

- [Calculator page](https://github.com/mahmudur26/emo-cal/blob/development/resources/views/calculator.blade.php): `resources/views/calculator.blade.php`

### Other components

- **Visitor**

## Connections

- Visitor → HTTP entry: sends request
- HTTP entry → HTTP kernel: handles request
- Route provider → Web routes: loads routes
- Web routes → Calculator controller: dispatches route
- Calculator controller → Calculator page: renders page
- Calculator page → Visitor: presents form
- Visitor → HTTP entry: submits operands
- Calculator controller → Calculation JSON: returns result
- Calculation JSON → Visitor: delivers result
