# faezlatiff/accredify architecture

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

- Interactive diagram: https://gitdiagram.com/faezlatiff/accredify
- Repository: https://github.com/faezlatiff/accredify

## Overview

Accredify is a Laravel REST API that accepts credential JSON from an authenticated user and returns a JSON verification result. The main flow checks recipient and issuer details, looks up the issuer key in DNS TXT records, recomputes and compares the credential hash, then records the outcome and responds. The README documents authenticated access; route and middleware wiring is not shown in the sampled source, so that relationship is represented at the API boundary. Other route capabilities cannot be established from the available excerpts.

Main entry points: [`app/Http/Controllers/VerifyController.php`](https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php) (Verify request), [`public/index.php`](https://github.com/faezlatiff/accredify/blob/main/public/index.php) (HTTP entry), [`routes/api.php`](https://github.com/faezlatiff/accredify/blob/main/routes/api.php) (API routes), [`app/Http/Kernel.php`](https://github.com/faezlatiff/accredify/blob/main/app/Http/Kernel.php) (HTTP kernel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP access"]
  node_entry["HTTP entry<br/>[index.php]"]
  node_bootstrap["App bootstrap<br/>[app.php]"]
  node_kernel["HTTP kernel<br/>[Kernel.php]"]
  node_routes["API routes<br/>[api.php]"]
  node_auth["Authentication<br/>[Authenticate.php]"]
end

subgraph group_verify["Credential verification"]
  node_verify["Verify request"]
  node_dns[("DNS TXT records")]
  node_hash["Hash comparison"]
  node_result["JSON result"]
end

subgraph group_state["Identity and records"]
  node_history["Verification history"]
  node_mysql[("MySQL database")]
  node_user["User identity<br/>[User.php]"]
  node_verification["Verification record<br/>[Verification.php]"]
end

node_client(("API client"))

node_client -->|"sends JSON"| node_entry
node_entry -->|"loads app"| node_bootstrap
node_entry -->|"handles request"| node_kernel
node_kernel -->|"loads routes"| node_routes
node_routes -.->|"requires auth"| node_auth
node_routes -.->|"dispatches request"| node_verify
node_verify -->|"looks up TXT"| node_dns
node_verify -->|"recomputes hash"| node_hash
node_verify -->|"records outcome"| node_history
node_history -->|"inserts row"| node_mysql
node_verify -->|"builds response"| node_result
node_result -->|"returns JSON"| node_client

click node_entry "https://github.com/faezlatiff/accredify/blob/main/public/index.php"
click node_bootstrap "https://github.com/faezlatiff/accredify/blob/main/bootstrap/app.php"
click node_kernel "https://github.com/faezlatiff/accredify/blob/main/app/Http/Kernel.php"
click node_routes "https://github.com/faezlatiff/accredify/blob/main/routes/api.php"
click node_auth "https://github.com/faezlatiff/accredify/blob/main/app/Http/Middleware/Authenticate.php"
click node_verify "https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php"
click node_hash "https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php"
click node_result "https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php"
click node_history "https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php"
click node_user "https://github.com/faezlatiff/accredify/blob/main/app/Models/User.php"
click node_verification "https://github.com/faezlatiff/accredify/blob/main/app/Models/Verification.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_bootstrap,node_kernel,node_routes,node_auth,node_client toneBlue
class node_verify,node_dns,node_hash,node_result toneAmber
class node_history,node_mysql,node_user,node_verification toneMint
```

## Components

### HTTP access

- [HTTP entry](https://github.com/faezlatiff/accredify/blob/main/public/index.php): `public/index.php`
- [App bootstrap](https://github.com/faezlatiff/accredify/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [HTTP kernel](https://github.com/faezlatiff/accredify/blob/main/app/Http/Kernel.php): `app/Http/Kernel.php`
- [API routes](https://github.com/faezlatiff/accredify/blob/main/routes/api.php): `routes/api.php`
- [Authentication](https://github.com/faezlatiff/accredify/blob/main/app/Http/Middleware/Authenticate.php): `app/Http/Middleware/Authenticate.php`

### Credential verification

- [Verify request](https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php): `app/Http/Controllers/VerifyController.php`
- **DNS TXT records**
- [Hash comparison](https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php): `app/Http/Controllers/VerifyController.php`
- [JSON result](https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php): `app/Http/Controllers/VerifyController.php`

### Identity and records

- [Verification history](https://github.com/faezlatiff/accredify/blob/main/app/Http/Controllers/VerifyController.php): `app/Http/Controllers/VerifyController.php`
- **MySQL database**
- [User identity](https://github.com/faezlatiff/accredify/blob/main/app/Models/User.php): `app/Models/User.php`
- [Verification record](https://github.com/faezlatiff/accredify/blob/main/app/Models/Verification.php): `app/Models/Verification.php`

### Other components

- **API client**

## Connections

- API client → HTTP entry: sends JSON
- HTTP entry → App bootstrap: loads app
- HTTP entry → HTTP kernel: handles request
- HTTP kernel → API routes: loads routes
- API routes → Authentication: requires auth
- API routes → Verify request: dispatches request
- Verify request → DNS TXT records: looks up TXT
- Verify request → Hash comparison: recomputes hash
- Verify request → Verification history: records outcome
- Verification history → MySQL database: inserts row
- Verify request → JSON result: builds response
- JSON result → API client: returns JSON
