# kanishka373/schemalens architecture

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

- Interactive diagram: https://gitdiagram.com/kanishka373/schemalens
- Repository: https://github.com/kanishka373/schemalens

## Overview

SchemaLens connects to a MySQL database, reads schema metadata, and presents it through an interactive browser-based explorer. The graph preserves the documented overview, diagram, table and relationship views, settings, and PDF export. Backend wiring is shown from the excerpts; some frontend feature internals were not sampled, so documented UI relationships cite the README.

Main entry points: [`frontend/src/app.jsx`](https://github.com/kanishka373/schemalens/blob/main/frontend/src/app.jsx) (App state and navigation), [`frontend/src/services/api.js`](https://github.com/kanishka373/schemalens/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/components/SchemaGraph.jsx`](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/SchemaGraph.jsx) (Schema graph), [`frontend/src/components/ConnectForm.jsx`](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/ConnectForm.jsx) (Connect form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Schema browser"]
  node_connect["Connect form<br/>[ConnectForm.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_app["App state and navigation<br/>[app.jsx]"]
  node_loading["Connection screen<br/>[LoadingScreen.jsx]"]
  node_navigation["Navigation<br/>[Sidebar.jsx]"]
  node_overview["Overview metrics<br/>[Dashboard.jsx]"]
  node_insights["Schema insights<br/>[Insights.jsx]"]
  node_search["Table search<br/>[SearchBar.jsx]"]
  node_graph["Schema graph<br/>[SchemaGraph.jsx]"]
  node_tablecard["Graph table cards<br/>[TableNode.jsx]"]
  node_tablepanel["Selected table details<br/>[TablePanel.jsx]"]
  node_explorer["Table explorer<br/>[TablesView.jsx]"]
  node_relationships["Relationships view<br/>[app.jsx]"]
  node_settings["Connection settings<br/>[Settings.jsx]"]
  node_export["PDF export<br/>[SchemaGraph.jsx]"]
  node_notifications["Toast notifications<br/>[toast.jsx]"]
end

subgraph group_backend["Schema API"]
  node_server["Express server<br/>[index.js]"]
  node_routes["Schema routes<br/>[schema.js]"]
  node_controller["Request handlers"]
  node_scanner["Metadata scanner<br/>[schemaScanner.js]"]
end

subgraph group_mysql["Metadata source"]
  node_database[("MySQL information_schema")]
end

node_user(("Database user"))

node_user -->|"enters credentials"| node_connect
node_connect -->|"submits connection"| node_api
node_api -->|"sends API requests"| node_server
node_server -->|"mounts routes"| node_routes
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"calls scans"| node_scanner
node_scanner -->|"reads metadata"| node_database
node_api -->|"returns schema data"| node_app
node_app -->|"shows connection state"| node_loading
node_app -->|"renders navigation"| node_navigation
node_app -->|"renders overview"| node_overview
node_app -->|"renders insights"| node_insights
node_app -->|"renders table search"| node_search
node_app -->|"renders diagram"| node_graph
node_graph -->|"renders table cards"| node_tablecard
node_app -->|"shows selection details"| node_tablepanel
node_app -->|"renders explorer"| node_explorer
node_app -->|"renders relationships"| node_relationships
node_app -->|"renders settings"| node_settings
node_graph -.->|"exports diagram"| node_export
node_app -->|"shows connection notices"| node_notifications

click node_connect "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/ConnectForm.jsx"
click node_api "https://github.com/kanishka373/schemalens/blob/main/frontend/src/services/api.js"
click node_app "https://github.com/kanishka373/schemalens/blob/main/frontend/src/app.jsx"
click node_loading "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/LoadingScreen.jsx"
click node_navigation "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Sidebar.jsx"
click node_overview "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Dashboard.jsx"
click node_insights "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Insights.jsx"
click node_search "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/SearchBar.jsx"
click node_graph "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/SchemaGraph.jsx"
click node_tablecard "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/TableNode.jsx"
click node_tablepanel "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/TablePanel.jsx"
click node_explorer "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/TablesView.jsx"
click node_relationships "https://github.com/kanishka373/schemalens/blob/main/frontend/src/app.jsx"
click node_settings "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Settings.jsx"
click node_export "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/SchemaGraph.jsx"
click node_notifications "https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/toast.jsx"
click node_server "https://github.com/kanishka373/schemalens/blob/main/backend/index.js"
click node_routes "https://github.com/kanishka373/schemalens/blob/main/backend/routes/schema.js"
click node_controller "https://github.com/kanishka373/schemalens/blob/main/backend/controllers/schemaController.js"
click node_scanner "https://github.com/kanishka373/schemalens/blob/main/backend/services/schemaScanner.js"

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_connect,node_api,node_app,node_loading,node_navigation,node_overview,node_insights,node_search,node_graph,node_tablecard,node_tablepanel,node_explorer,node_relationships,node_settings,node_export,node_notifications toneBlue
class node_server,node_routes,node_controller,node_scanner,node_user toneAmber
class node_database toneMint
```

## Components

### Schema browser

- [Connect form](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/ConnectForm.jsx): `frontend/src/components/ConnectForm.jsx`
- [API client](https://github.com/kanishka373/schemalens/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [App state and navigation](https://github.com/kanishka373/schemalens/blob/main/frontend/src/app.jsx): `frontend/src/app.jsx`
- [Connection screen](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/LoadingScreen.jsx): `frontend/src/components/LoadingScreen.jsx`
- [Navigation](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Overview metrics](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Schema insights](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Insights.jsx): `frontend/src/components/Insights.jsx`
- [Table search](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/SearchBar.jsx): `frontend/src/components/SearchBar.jsx`
- [Schema graph](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/SchemaGraph.jsx): `frontend/src/components/SchemaGraph.jsx`
- [Graph table cards](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/TableNode.jsx): `frontend/src/components/TableNode.jsx`
- [Selected table details](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/TablePanel.jsx): `frontend/src/components/TablePanel.jsx`
- [Table explorer](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/TablesView.jsx): `frontend/src/components/TablesView.jsx`
- [Relationships view](https://github.com/kanishka373/schemalens/blob/main/frontend/src/app.jsx): `frontend/src/app.jsx`
- [Connection settings](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/Settings.jsx): `frontend/src/components/Settings.jsx`
- [PDF export](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/SchemaGraph.jsx): `frontend/src/components/SchemaGraph.jsx`
- [Toast notifications](https://github.com/kanishka373/schemalens/blob/main/frontend/src/components/toast.jsx): `frontend/src/components/toast.jsx`

### Schema API

- [Express server](https://github.com/kanishka373/schemalens/blob/main/backend/index.js): `backend/index.js`
- [Schema routes](https://github.com/kanishka373/schemalens/blob/main/backend/routes/schema.js): `backend/routes/schema.js`
- [Request handlers](https://github.com/kanishka373/schemalens/blob/main/backend/controllers/schemaController.js): `backend/controllers/schemaController.js`
- [Metadata scanner](https://github.com/kanishka373/schemalens/blob/main/backend/services/schemaScanner.js): `backend/services/schemaScanner.js`

### Metadata source

- **MySQL information_schema**

### Other components

- **Database user**

## Connections

- Database user → Connect form: enters credentials (evidence: `Readme.md`)
- Connect form → API client: submits connection (evidence: `frontend/src/components/ConnectForm.jsx`)
- API client → Express server: sends API requests (evidence: `Readme.md`)
- Express server → Schema routes: mounts routes (evidence: `backend/index.js`)
- Schema routes → Request handlers: dispatches requests (evidence: `backend/routes/schema.js`)
- Request handlers → Metadata scanner: calls scans (evidence: `backend/controllers/schemaController.js`)
- Metadata scanner → MySQL information_schema: reads metadata (evidence: `backend/services/schemaScanner.js`)
- API client → App state and navigation: returns schema data (evidence: `frontend/src/services/api.js`)
- App state and navigation → Connection screen: shows connection state (evidence: `frontend/src/app.jsx`)
- App state and navigation → Navigation: renders navigation (evidence: `frontend/src/app.jsx`)
- App state and navigation → Overview metrics: renders overview (evidence: `frontend/src/app.jsx`)
- App state and navigation → Schema insights: renders insights (evidence: `frontend/src/app.jsx`)
- App state and navigation → Table search: renders table search (evidence: `frontend/src/app.jsx`)
- App state and navigation → Schema graph: renders diagram (evidence: `frontend/src/app.jsx`)
- Schema graph → Graph table cards: renders table cards (evidence: `frontend/src/components/SchemaGraph.jsx`)
- App state and navigation → Selected table details: shows selection details (evidence: `frontend/src/app.jsx`)
- App state and navigation → Table explorer: renders explorer (evidence: `frontend/src/app.jsx`)
- App state and navigation → Relationships view: renders relationships (evidence: `frontend/src/app.jsx`)
- App state and navigation → Connection settings: renders settings (evidence: `frontend/src/app.jsx`)
- Schema graph → PDF export: exports diagram (evidence: `Readme.md`)
- App state and navigation → Toast notifications: shows connection notices (evidence: `frontend/src/app.jsx`)
