# cse442-software-engineering-ub/f26-semester-project-shadowpika architecture

> Architecture diagram of the GitHub repository cse442-software-engineering-ub/f26-semester-project-shadowpika, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cse442-software-engineering-ub/f26-semester-project-shadowpika
- Repository: https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika

## Overview

Karavan Login is a React login and registration interface with two authentication paths: localhost preview uses browser local storage, while non-local use posts credentials to PHP endpoints backed by MySQL. Registration stores bcrypt hashes; login looks up the account and verifies its password. The source excerpts show the client dispatch and PHP database operations. The README contains no capability details, and other frontend styling and deployment behavior are not mapped.

Main entry points: [`karavan-login/src/App.jsx`](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/App.jsx) (Login and register form), [`login.php`](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/login.php) (Credential verification), [`register.php`](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/register.php) (Account registration), [`karavan-login/src/main.jsx`](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Login client"]
  node_entry["React entry<br/>[main.jsx]"]
  node_form["Login and register form<br/>[App.jsx]"]
end

subgraph group_server["PHP authentication"]
  node_login["Credential verification<br/>[login.php]"]
  node_register["Account registration<br/>[register.php]"]
end

subgraph group_storage["Account storage"]
  node_localstore[("Preview user table<br/>[App.jsx]")]
  node_mysql[("MySQL users table")]
end

node_user(("User"))

node_user -->|"submits credentials"| node_form
node_entry -->|"renders"| node_form
node_form -->|"reads and writes"| node_localstore
node_form -->|"posts login"| node_login
node_form -->|"posts registration"| node_register
node_login -->|"looks up account"| node_mysql
node_register -->|"inserts account"| node_mysql

click node_entry "https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/main.jsx"
click node_form "https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/App.jsx"
click node_localstore "https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/App.jsx"
click node_login "https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/login.php"
click node_register "https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/register.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_form,node_user toneBlue
class node_login,node_register toneAmber
class node_localstore,node_mysql toneMint
```

## Components

### Login client

- [React entry](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/main.jsx): `karavan-login/src/main.jsx`
- [Login and register form](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/App.jsx): `karavan-login/src/App.jsx`

### PHP authentication

- [Credential verification](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/login.php): `login.php`
- [Account registration](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/register.php): `register.php`

### Account storage

- [Preview user table](https://github.com/cse442-software-engineering-ub/f26-semester-project-shadowpika/blob/main/karavan-login/src/App.jsx): `karavan-login/src/App.jsx`
- **MySQL users table**

### Other components

- **User**

## Connections

- User → Login and register form: submits credentials (evidence: `karavan-login/src/App.jsx`)
- React entry → Login and register form: renders (evidence: `karavan-login/src/main.jsx`)
- Login and register form → Preview user table: reads and writes (evidence: `karavan-login/src/App.jsx`)
- Login and register form → Credential verification: posts login (evidence: `karavan-login/src/App.jsx`)
- Login and register form → Account registration: posts registration (evidence: `karavan-login/src/App.jsx`)
- Credential verification → MySQL users table: looks up account (evidence: `login.php`)
- Account registration → MySQL users table: inserts account (evidence: `register.php`)
