# sanket4511/enterpriseiq-agentic-platform architecture

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

- Interactive diagram: https://gitdiagram.com/sanket4511/enterpriseiq-agentic-platform
- Repository: https://github.com/sanket4511/enterpriseiq-agentic-platform

## Overview

EnterpriseIQ is currently a FastAPI foundation for tenant-scoped identity, user management, and role-based authorization; the README marks RAG, agent orchestration, MCP, and GCP deployment as not yet implemented. The main workflow is login to issue a JWT, then token validation and permission checks for protected user operations. Source excerpts establish these request paths and database use. Other documented AI capabilities are development goals, not runnable subsystems, so they are not represented as components.

Main entry points: [`app/main.py`](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/main.py) (FastAPI app), [`app/api/dependencies.py`](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/dependencies.py) (Token and permission checks), [`app/api/v1/users.py`](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/v1/users.py) (User route), [`app/services/authentication.py`](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/services/authentication.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API entry points"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_auth_routes["Login route<br/>[auth.py]"]
  node_user_routes["User route<br/>[users.py]"]
  node_protected_routes["Protected routes<br/>[protected.py]"]
end

subgraph group_identity["Identity and access"]
  node_auth_service["Authentication<br/>[authentication.py]"]
  node_auth_dependencies["Token and permission checks<br/>[dependencies.py]"]
  node_authorization["Permission evaluation<br/>[authorization.py]"]
  node_security["JWT security<br/>[security.py]"]
  node_password["Password verification<br/>[password.py]"]
end

subgraph group_domain["Tenant and user domain"]
  node_user_management["User management<br/>[user_management.py]"]
  node_schemas["Request and response schemas"]
  node_tenant_model["Tenant records<br/>[tenant.py]"]
  node_user_model["User records<br/>[user.py]"]
  node_role_model["Role records<br/>[role.py]"]
  node_user_role_model["User-role assignments<br/>[user_role.py]"]
end

subgraph group_infra["Runtime infrastructure"]
  node_db_session[("Database sessions<br/>[session.py]")]
  node_redis[("Redis client<br/>[redis.py]")]
  node_config["Runtime settings<br/>[config.py]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_fastapi
node_fastapi -->|"registers route"| node_auth_routes
node_fastapi -->|"registers route"| node_user_routes
node_fastapi -->|"registers route"| node_protected_routes
node_fastapi -->|"checks connection"| node_db_session
node_fastapi -->|"pings client"| node_redis
node_fastapi -->|"reads settings"| node_config
node_auth_routes -->|"authenticates credentials"| node_auth_service
node_auth_routes -->|"gets session"| node_db_session
node_auth_routes -->|"validates and responds"| node_schemas
node_auth_service -->|"queries user"| node_user_model
node_auth_service -->|"checks tenant"| node_tenant_model
node_auth_service -->|"verifies password"| node_password
node_auth_service -->|"creates token"| node_security
node_user_routes -->|"requires permission"| node_auth_dependencies
node_user_routes -->|"creates user"| node_user_management
node_user_routes -->|"gets session"| node_db_session
node_user_routes -->|"validates and responds"| node_schemas
node_auth_dependencies -->|"decodes token"| node_security
node_auth_dependencies -->|"queries identity"| node_db_session
node_auth_dependencies -->|"checks active user"| node_user_model
node_auth_dependencies -->|"checks active tenant"| node_tenant_model
node_auth_dependencies -->|"checks permission"| node_authorization
node_authorization -->|"verifies membership"| node_user_model
node_authorization -->|"checks tenant status"| node_tenant_model
node_authorization -->|"reads permissions"| node_role_model
node_authorization -->|"reads assignments"| node_user_role_model
node_user_management -->|"creates account"| node_user_model
node_user_management -->|"checks organization"| node_tenant_model
node_user_management -->|"hashes password"| node_password
node_db_session -->|"reads database URL"| node_config
node_redis -->|"reads Redis URL"| node_config
node_security -->|"reads JWT settings"| node_config

click node_fastapi "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/main.py"
click node_auth_routes "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/v1/auth.py"
click node_user_routes "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/v1/users.py"
click node_protected_routes "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/v1/protected.py"
click node_auth_service "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/services/authentication.py"
click node_auth_dependencies "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/dependencies.py"
click node_authorization "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/services/authorization.py"
click node_security "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/core/security.py"
click node_password "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/core/password.py"
click node_user_management "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/services/user_management.py"
click node_schemas "https://github.com/sanket4511/enterpriseiq-agentic-platform/tree/master/app/schemas"
click node_tenant_model "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/tenant.py"
click node_user_model "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/user.py"
click node_role_model "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/role.py"
click node_user_role_model "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/user_role.py"
click node_db_session "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/db/session.py"
click node_redis "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/db/redis.py"
click node_config "https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/core/config.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_fastapi,node_auth_routes,node_user_routes,node_protected_routes,node_client toneBlue
class node_auth_service,node_auth_dependencies,node_authorization,node_security,node_password toneAmber
class node_user_management,node_schemas,node_tenant_model,node_user_model,node_role_model,node_user_role_model toneMint
class node_db_session,node_redis,node_config toneRose
```

## Components

### API entry points

- [FastAPI app](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/main.py): `app/main.py`
- [Login route](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/v1/auth.py): `app/api/v1/auth.py`
- [User route](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/v1/users.py): `app/api/v1/users.py`
- [Protected routes](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/v1/protected.py): `app/api/v1/protected.py`

### Identity and access

- [Authentication](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/services/authentication.py): `app/services/authentication.py`
- [Token and permission checks](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/api/dependencies.py): `app/api/dependencies.py`
- [Permission evaluation](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/services/authorization.py): `app/services/authorization.py`
- [JWT security](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/core/security.py): `app/core/security.py`
- [Password verification](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/core/password.py): `app/core/password.py`

### Tenant and user domain

- [User management](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/services/user_management.py): `app/services/user_management.py`
- [Request and response schemas](https://github.com/sanket4511/enterpriseiq-agentic-platform/tree/master/app/schemas): `app/schemas`
- [Tenant records](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/tenant.py): `app/models/tenant.py`
- [User records](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/user.py): `app/models/user.py`
- [Role records](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/role.py): `app/models/role.py`
- [User-role assignments](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/models/user_role.py): `app/models/user_role.py`

### Runtime infrastructure

- [Database sessions](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/db/session.py): `app/db/session.py`
- [Redis client](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/db/redis.py): `app/db/redis.py`
- [Runtime settings](https://github.com/sanket4511/enterpriseiq-agentic-platform/blob/master/app/core/config.py): `app/core/config.py`

### Other components

- **API client**

## Connections

- API client → FastAPI app: sends requests (evidence: `app/main.py`)
- FastAPI app → Login route: registers route (evidence: `app/main.py`)
- FastAPI app → User route: registers route (evidence: `app/main.py`)
- FastAPI app → Protected routes: registers route (evidence: `app/main.py`)
- FastAPI app → Database sessions: checks connection (evidence: `app/main.py`)
- FastAPI app → Redis client: pings client (evidence: `app/main.py`)
- FastAPI app → Runtime settings: reads settings (evidence: `app/main.py`)
- Login route → Authentication: authenticates credentials (evidence: `app/api/v1/auth.py`)
- Login route → Database sessions: gets session (evidence: `app/api/v1/auth.py`)
- Login route → Request and response schemas: validates and responds (evidence: `app/api/v1/auth.py`)
- Authentication → User records: queries user (evidence: `app/services/authentication.py`)
- Authentication → Tenant records: checks tenant (evidence: `app/services/authentication.py`)
- Authentication → Password verification: verifies password (evidence: `app/services/authentication.py`)
- Authentication → JWT security: creates token (evidence: `app/services/authentication.py`)
- User route → Token and permission checks: requires permission (evidence: `app/api/v1/users.py`)
- User route → User management: creates user (evidence: `app/api/v1/users.py`)
- User route → Database sessions: gets session (evidence: `app/api/v1/users.py`)
- User route → Request and response schemas: validates and responds (evidence: `app/api/v1/users.py`)
- Token and permission checks → JWT security: decodes token (evidence: `app/api/dependencies.py`)
- Token and permission checks → Database sessions: queries identity (evidence: `app/api/dependencies.py`)
- Token and permission checks → User records: checks active user (evidence: `app/api/dependencies.py`)
- Token and permission checks → Tenant records: checks active tenant (evidence: `app/api/dependencies.py`)
- Token and permission checks → Permission evaluation: checks permission (evidence: `app/api/dependencies.py`)
- Permission evaluation → User records: verifies membership (evidence: `app/services/authorization.py`)
- Permission evaluation → Tenant records: checks tenant status (evidence: `app/services/authorization.py`)
- Permission evaluation → Role records: reads permissions (evidence: `app/services/authorization.py`)
- Permission evaluation → User-role assignments: reads assignments (evidence: `app/services/authorization.py`)
- User management → User records: creates account (evidence: `app/services/user_management.py`)
- User management → Tenant records: checks organization (evidence: `app/services/user_management.py`)
- User management → Password verification: hashes password (evidence: `app/services/user_management.py`)
- Database sessions → Runtime settings: reads database URL (evidence: `app/db/session.py`)
- Redis client → Runtime settings: reads Redis URL (evidence: `app/db/redis.py`)
- JWT security → Runtime settings: reads JWT settings (evidence: `app/core/security.py`)
