# vedevpatel/logicortex architecture

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

- Interactive diagram: https://gitdiagram.com/vedevpatel/logicortex
- Repository: https://github.com/vedevpatel/logicortex

## Overview

Logicortex is an application-security platform with a Next.js user interface and a FastAPI backend. The visible account workflow supports email registration/login and GitHub/Google OAuth, with users and organizations persisted in the database; GitHub App integration lets an organization connect and list repositories. The dashboard and scan-detail pages represent the product’s scan workflow, while remediation and symbolic analysis are separate backend capabilities. The README describes AI-assisted finding, fixing, and prediction, but the available files do not show a scan orchestration pipeline. The graph therefore avoids asserting unshown frontend API calls or scan-processing links.

Main entry points: [`backend/app/api/endpoints/oauth.py`](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/oauth.py) (OAuth routes), [`backend/app/main.py`](https://github.com/vedevpatel/logicortex/blob/main/backend/app/main.py) (API application), [`backend/app/api/endpoints/auth.py`](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/auth.py) (Account routes), [`backend/app/api/endpoints/github.py`](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/github.py) (GitHub integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_web_auth["Login and signup<br/>[page.tsx]"]
  node_web_callback["OAuth callback<br/>[page.tsx]"]
  node_auth_state["Auth context<br/>[AuthContext.tsx]"]
  node_dashboard["Scan dashboard<br/>[page.tsx]"]
  node_scan_detail["Scan detail<br/>[page.tsx]"]
  node_team_page["Team page<br/>[page.tsx]"]
end

subgraph group_api["Backend API"]
  node_api_app["API application<br/>[main.py]"]
  node_org_routes["Organization routes<br/>[organizations.py]"]
  node_user_routes["User routes<br/>[users.py]"]
  node_settings["Application settings<br/>[config.py]"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Account routes<br/>[auth.py]"]
  node_oauth_routes["OAuth routes<br/>[oauth.py]"]
  node_access_deps["Access dependencies<br/>[deps.py]"]
  node_security["Token security<br/>[security.py]"]
end

subgraph group_integrations["Security capabilities"]
  node_github_routes["GitHub integration<br/>[github.py]"]
  node_remediation["Remediation<br/>[remediation.py]"]
  node_symbolic["Symbolic engine<br/>[symbolic_engine.py]"]
end

subgraph group_data["Persistence"]
  node_db_session["Database sessions<br/>[session.py]"]
  node_user_model[("User records<br/>[user.py]")]
  node_organization_model[("Organization records<br/>[organization.py]")]
end

node_user(("User"))
node_github(("GitHub"))
node_google(("Google"))
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_web_auth
node_user -->|"views"| node_dashboard
node_api_app -->|"registers"| node_auth_routes
node_api_app -->|"registers"| node_oauth_routes
node_api_app -->|"registers"| node_org_routes
node_api_app -->|"registers"| node_github_routes
node_api_app -->|"registers"| node_user_routes
node_auth_routes -->|"hashes and signs"| node_security
node_oauth_routes -->|"signs token"| node_security
node_oauth_routes -->|"redirects token"| node_web_callback
node_oauth_routes -->|"exchanges credentials"| node_github
node_oauth_routes -->|"exchanges credentials"| node_google
node_github_routes -->|"fetches repositories"| node_github
node_github_routes -->|"requires user"| node_access_deps
node_auth_routes -->|"uses database dependency"| node_access_deps
node_access_deps -->|"opens session"| node_db_session
node_access_deps -->|"decodes token"| node_security
node_db_session -->|"reads database URL"| node_settings
node_auth_routes -->|"creates and queries"| node_user_model
node_auth_routes -->|"creates organization"| node_organization_model
node_oauth_routes -->|"queries or creates"| node_user_model
node_oauth_routes -->|"creates organization"| node_organization_model
node_github_routes -->|"updates installation"| node_organization_model
node_org_routes -->|"uses member records"| node_user_model
node_org_routes -->|"manages organizations"| node_organization_model
node_user_routes -->|"reads user"| node_user_model
node_db_session -.->|"connects"| node_postgres
node_dashboard -.->|"opens scan"| node_scan_detail

click node_web_auth "https://github.com/vedevpatel/logicortex/blob/main/frontend/app/login/page.tsx"
click node_web_callback "https://github.com/vedevpatel/logicortex/blob/main/frontend/app/auth/callback/page.tsx"
click node_auth_state "https://github.com/vedevpatel/logicortex/blob/main/frontend/context/AuthContext.tsx"
click node_dashboard "https://github.com/vedevpatel/logicortex/blob/main/frontend/app/dashboard/page.tsx"
click node_scan_detail "https://github.com/vedevpatel/logicortex/blob/main/frontend/app/dashboard/scans/%5BscanId%5D/page.tsx"
click node_team_page "https://github.com/vedevpatel/logicortex/blob/main/frontend/app/dashboard/team/page.tsx"
click node_api_app "https://github.com/vedevpatel/logicortex/blob/main/backend/app/main.py"
click node_auth_routes "https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/auth.py"
click node_oauth_routes "https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/oauth.py"
click node_access_deps "https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/deps.py"
click node_security "https://github.com/vedevpatel/logicortex/blob/main/backend/app/core/security.py"
click node_github_routes "https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/github.py"
click node_org_routes "https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/organizations.py"
click node_user_routes "https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/users.py"
click node_remediation "https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/remediation.py"
click node_symbolic "https://github.com/vedevpatel/logicortex/blob/main/backend/app/symbolic_engine.py"
click node_settings "https://github.com/vedevpatel/logicortex/blob/main/backend/app/core/config.py"
click node_db_session "https://github.com/vedevpatel/logicortex/blob/main/backend/app/db/session.py"
click node_user_model "https://github.com/vedevpatel/logicortex/blob/main/backend/app/db/models/user.py"
click node_organization_model "https://github.com/vedevpatel/logicortex/blob/main/backend/app/db/models/organization.py"

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_web_auth,node_web_callback,node_auth_state,node_dashboard,node_scan_detail,node_team_page,node_user toneBlue
class node_api_app,node_org_routes,node_user_routes,node_settings,node_postgres toneAmber
class node_auth_routes,node_oauth_routes,node_access_deps,node_security toneMint
class node_github_routes,node_remediation,node_symbolic toneRose
class node_db_session,node_user_model,node_organization_model,node_github,node_google toneIndigo
```

## Components

### Web application

- [Login and signup](https://github.com/vedevpatel/logicortex/blob/main/frontend/app/login/page.tsx): `frontend/app/login/page.tsx`
- [OAuth callback](https://github.com/vedevpatel/logicortex/blob/main/frontend/app/auth/callback/page.tsx): `frontend/app/auth/callback/page.tsx`
- [Auth context](https://github.com/vedevpatel/logicortex/blob/main/frontend/context/AuthContext.tsx): `frontend/context/AuthContext.tsx`
- [Scan dashboard](https://github.com/vedevpatel/logicortex/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [Scan detail](https://github.com/vedevpatel/logicortex/blob/main/frontend/app/dashboard/scans/%5BscanId%5D/page.tsx): `frontend/app/dashboard/scans/[scanId]/page.tsx`
- [Team page](https://github.com/vedevpatel/logicortex/blob/main/frontend/app/dashboard/team/page.tsx): `frontend/app/dashboard/team/page.tsx`

### Backend API

- [API application](https://github.com/vedevpatel/logicortex/blob/main/backend/app/main.py): `backend/app/main.py`
- [Organization routes](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/organizations.py): `backend/app/api/endpoints/organizations.py`
- [User routes](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/users.py): `backend/app/api/endpoints/users.py`
- [Application settings](https://github.com/vedevpatel/logicortex/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Identity and access

- [Account routes](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/auth.py): `backend/app/api/endpoints/auth.py`
- [OAuth routes](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/oauth.py): `backend/app/api/endpoints/oauth.py`
- [Access dependencies](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/deps.py): `backend/app/api/deps.py`
- [Token security](https://github.com/vedevpatel/logicortex/blob/main/backend/app/core/security.py): `backend/app/core/security.py`

### Security capabilities

- [GitHub integration](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/github.py): `backend/app/api/endpoints/github.py`
- [Remediation](https://github.com/vedevpatel/logicortex/blob/main/backend/app/api/endpoints/remediation.py): `backend/app/api/endpoints/remediation.py`
- [Symbolic engine](https://github.com/vedevpatel/logicortex/blob/main/backend/app/symbolic_engine.py): `backend/app/symbolic_engine.py`

### Persistence

- [Database sessions](https://github.com/vedevpatel/logicortex/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [User records](https://github.com/vedevpatel/logicortex/blob/main/backend/app/db/models/user.py): `backend/app/db/models/user.py`
- [Organization records](https://github.com/vedevpatel/logicortex/blob/main/backend/app/db/models/organization.py): `backend/app/db/models/organization.py`

### Other components

- **User**
- **GitHub**
- **Google**
- **PostgreSQL**

## Connections

- User → Login and signup: uses (evidence: `frontend/app/login/page.tsx`)
- User → Scan dashboard: views (evidence: `frontend/app/dashboard/page.tsx`)
- API application → Account routes: registers (evidence: `backend/app/main.py`)
- API application → OAuth routes: registers (evidence: `backend/app/main.py`)
- API application → Organization routes: registers (evidence: `backend/app/main.py`)
- API application → GitHub integration: registers (evidence: `backend/app/main.py`)
- API application → User routes: registers (evidence: `backend/app/main.py`)
- Account routes → Token security: hashes and signs (evidence: `backend/app/api/endpoints/auth.py`)
- OAuth routes → Token security: signs token (evidence: `backend/app/api/endpoints/oauth.py`)
- OAuth routes → OAuth callback: redirects token (evidence: `backend/app/api/endpoints/oauth.py`)
- OAuth routes → GitHub: exchanges credentials (evidence: `backend/app/api/endpoints/oauth.py`)
- OAuth routes → Google: exchanges credentials (evidence: `backend/app/api/endpoints/oauth.py`)
- GitHub integration → GitHub: fetches repositories (evidence: `backend/app/api/endpoints/github.py`)
- GitHub integration → Access dependencies: requires user (evidence: `backend/app/api/endpoints/github.py`)
- Account routes → Access dependencies: uses database dependency (evidence: `backend/app/api/endpoints/auth.py`)
- Access dependencies → Database sessions: opens session (evidence: `backend/app/api/deps.py`)
- Access dependencies → Token security: decodes token (evidence: `backend/app/api/deps.py`)
- Database sessions → Application settings: reads database URL (evidence: `backend/app/db/session.py`)
- Account routes → User records: creates and queries (evidence: `backend/app/api/endpoints/auth.py`)
- Account routes → Organization records: creates organization (evidence: `backend/app/api/endpoints/auth.py`)
- OAuth routes → User records: queries or creates (evidence: `backend/app/api/endpoints/oauth.py`)
- OAuth routes → Organization records: creates organization (evidence: `backend/app/api/endpoints/oauth.py`)
- GitHub integration → Organization records: updates installation (evidence: `backend/app/api/endpoints/github.py`)
- Organization routes → User records: uses member records (evidence: `backend/app/api/endpoints/organizations.py`)
- Organization routes → Organization records: manages organizations (evidence: `backend/app/api/endpoints/organizations.py`)
- User routes → User records: reads user (evidence: `backend/app/api/endpoints/users.py`)
- Database sessions → PostgreSQL: connects
- Scan dashboard → Scan detail: opens scan
