# vimalkishor83/irr-log-analyser architecture

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

- Interactive diagram: https://gitdiagram.com/vimalkishor83/irr-log-analyser
- Repository: https://github.com/vimalkishor83/irr-log-analyser

## Overview

IRR + Log Analyzer is a Flask application for analysts and administrators to parse uploaded logs and find likely causes and resolutions from historical incidents and knowledge articles. The main workflow is log upload, in-memory analysis, persisted results, and dashboard review; a separate recommendation workflow searches a TF-IDF index. Admin-triggered or scheduled sync imports ServiceNow data, while users can maintain a manual knowledge repository. The graph also shows authentication, audit, and persistence. Some service internals are unsampled, so uncertain links are omitted rather than inferred.

Main entry points: [`app.py`](https://github.com/vimalkishor83/irr-log-analyser/blob/main/app.py) (Flask App), [`core/database.py`](https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/database.py) (SQLAlchemy Database), [`routes/recommendation_routes.py`](https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/recommendation_routes.py) (Recommendation Routes), [`routes/dashboard_routes.py`](https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/dashboard_routes.py) (Dashboard Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Application"]
  node_app["Flask App<br/>[app.py]"]
  node_auth_routes["Login Routes<br/>[auth_routes.py]"]
  node_dashboard_routes["Dashboard Routes"]
  node_rec_routes["Recommendation Routes"]
  node_knowledge_routes["Knowledge Routes"]
end

subgraph group_access["Access And Administration"]
  node_admin_routes["Admin Routes<br/>[admin_routes.py]"]
  node_auth["Session Access Control<br/>[auth.py]"]
  node_audit["Audit Logging<br/>[audit.py]"]
end

subgraph group_logs["Log Analysis"]
  node_log_analyzer["Log Analyzer<br/>[log_analyzer.py]"]
  node_log_results["Parsed Logs And Signatures<br/>[models.py]"]
end

subgraph group_knowledge["Recommendations And Knowledge"]
  node_recommendation["Recommendation Engine<br/>[recommendation.py]"]
  node_tfidf["TF-IDF Index<br/>[tfidf_engine.py]"]
  node_knowledge_service["Manual Knowledge Service"]
end

subgraph group_data["Persistence And Integration"]
  node_sync_service["ServiceNow Sync<br/>[sync_service.py]"]
  node_snow_client["ServiceNow Client<br/>[snow_client.py]"]
  node_models["Domain Records<br/>[models.py]"]
  node_database[("SQLAlchemy Database<br/>[database.py]")]
end

node_user(("Analyst / Admin"))
node_servicenow{{"ServiceNow"}}

node_user -->|"signs in"| node_auth_routes
node_user -->|"uploads logs"| node_dashboard_routes
node_app -->|"registers routes"| node_auth_routes
node_app -->|"registers routes"| node_dashboard_routes
node_app -->|"registers routes"| node_rec_routes
node_app -->|"registers routes"| node_admin_routes
node_app -->|"registers routes"| node_knowledge_routes
node_app -->|"initializes"| node_database
node_app -->|"creates admin"| node_auth
node_app -->|"schedules sync"| node_sync_service
node_app -->|"schedules cleanup"| node_log_analyzer
node_auth_routes -->|"authenticates"| node_auth
node_dashboard_routes -->|"analyzes uploads"| node_log_analyzer
node_dashboard_routes -->|"queries results"| node_log_results
node_log_analyzer -.->|"stores parsed data"| node_log_results
node_rec_routes -->|"searches"| node_recommendation
node_rec_routes -->|"fetches live incident"| node_snow_client
node_rec_routes -->|"stores feedback"| node_database
node_recommendation -->|"searches index"| node_tfidf
node_knowledge_routes -->|"manages entries"| node_knowledge_service
node_knowledge_service -.->|"persists entries"| node_database
node_admin_routes -->|"runs manual sync"| node_sync_service
node_admin_routes -->|"rebuilds index"| node_tfidf
node_sync_service -.->|"pulls records"| node_snow_client
node_snow_client -->|"requests data"| node_servicenow
node_models -->|"uses ORM"| node_database
node_auth -->|"reads and writes users"| node_database
node_auth -->|"queries users"| node_models
node_audit -->|"writes audit entries"| node_database
node_audit -->|"creates audit records"| node_models

click node_app "https://github.com/vimalkishor83/irr-log-analyser/blob/main/app.py"
click node_auth_routes "https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/auth_routes.py"
click node_dashboard_routes "https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/dashboard_routes.py"
click node_rec_routes "https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/recommendation_routes.py"
click node_knowledge_routes "https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/knowledge_routes.py"
click node_admin_routes "https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/admin_routes.py"
click node_auth "https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/auth.py"
click node_audit "https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/audit.py"
click node_log_analyzer "https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/log_analyzer.py"
click node_log_results "https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/models.py"
click node_recommendation "https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/recommendation.py"
click node_tfidf "https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/tfidf_engine.py"
click node_knowledge_service "https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/knowledge_service.py"
click node_sync_service "https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/sync_service.py"
click node_snow_client "https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/snow_client.py"
click node_models "https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/models.py"
click node_database "https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/database.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_app,node_auth_routes,node_dashboard_routes,node_rec_routes,node_knowledge_routes toneBlue
class node_admin_routes,node_auth,node_audit toneAmber
class node_log_analyzer,node_log_results toneMint
class node_recommendation,node_tfidf,node_knowledge_service toneRose
class node_sync_service,node_snow_client,node_models,node_database,node_user,node_servicenow toneIndigo
```

## Components

### Web Application

- [Flask App](https://github.com/vimalkishor83/irr-log-analyser/blob/main/app.py): `app.py`
- [Login Routes](https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/auth_routes.py): `routes/auth_routes.py`
- [Dashboard Routes](https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/dashboard_routes.py): `routes/dashboard_routes.py`
- [Recommendation Routes](https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/recommendation_routes.py): `routes/recommendation_routes.py`
- [Knowledge Routes](https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/knowledge_routes.py): `routes/knowledge_routes.py`

### Access And Administration

- [Admin Routes](https://github.com/vimalkishor83/irr-log-analyser/blob/main/routes/admin_routes.py): `routes/admin_routes.py`
- [Session Access Control](https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/auth.py): `core/auth.py`
- [Audit Logging](https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/audit.py): `core/audit.py`

### Log Analysis

- [Log Analyzer](https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/log_analyzer.py): `services/log_analyzer.py`
- [Parsed Logs And Signatures](https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/models.py): `core/models.py`

### Recommendations And Knowledge

- [Recommendation Engine](https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/recommendation.py): `services/recommendation.py`
- [TF-IDF Index](https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/tfidf_engine.py): `services/tfidf_engine.py`
- [Manual Knowledge Service](https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/knowledge_service.py): `services/knowledge_service.py`

### Persistence And Integration

- [ServiceNow Sync](https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/sync_service.py): `services/sync_service.py`
- [ServiceNow Client](https://github.com/vimalkishor83/irr-log-analyser/blob/main/services/snow_client.py): `services/snow_client.py`
- [Domain Records](https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/models.py): `core/models.py`
- [SQLAlchemy Database](https://github.com/vimalkishor83/irr-log-analyser/blob/main/core/database.py): `core/database.py`

### Other components

- **Analyst / Admin**
- **ServiceNow**

## Connections

- Analyst / Admin → Login Routes: signs in
- Analyst / Admin → Dashboard Routes: uploads logs
- Flask App → Login Routes: registers routes (evidence: `app.py`)
- Flask App → Dashboard Routes: registers routes (evidence: `app.py`)
- Flask App → Recommendation Routes: registers routes (evidence: `app.py`)
- Flask App → Admin Routes: registers routes (evidence: `app.py`)
- Flask App → Knowledge Routes: registers routes (evidence: `app.py`)
- Flask App → SQLAlchemy Database: initializes (evidence: `app.py`)
- Flask App → Session Access Control: creates admin (evidence: `app.py`)
- Flask App → ServiceNow Sync: schedules sync (evidence: `app.py`)
- Flask App → Log Analyzer: schedules cleanup (evidence: `app.py`)
- Login Routes → Session Access Control: authenticates (evidence: `routes/auth_routes.py`)
- Dashboard Routes → Log Analyzer: analyzes uploads (evidence: `routes/dashboard_routes.py`)
- Dashboard Routes → Parsed Logs And Signatures: queries results (evidence: `routes/dashboard_routes.py`)
- Log Analyzer → Parsed Logs And Signatures: stores parsed data (evidence: `services/log_analyzer.py`)
- Recommendation Routes → Recommendation Engine: searches (evidence: `routes/recommendation_routes.py`)
- Recommendation Routes → ServiceNow Client: fetches live incident (evidence: `routes/recommendation_routes.py`)
- Recommendation Routes → SQLAlchemy Database: stores feedback (evidence: `routes/recommendation_routes.py`)
- Recommendation Engine → TF-IDF Index: searches index (evidence: `services/recommendation.py`)
- Knowledge Routes → Manual Knowledge Service: manages entries (evidence: `routes/knowledge_routes.py`)
- Manual Knowledge Service → SQLAlchemy Database: persists entries (evidence: `services/knowledge_service.py`)
- Admin Routes → ServiceNow Sync: runs manual sync (evidence: `routes/admin_routes.py`)
- Admin Routes → TF-IDF Index: rebuilds index (evidence: `routes/admin_routes.py`)
- ServiceNow Sync → ServiceNow Client: pulls records (evidence: `services/sync_service.py`)
- ServiceNow Client → ServiceNow: requests data (evidence: `services/snow_client.py`)
- Domain Records → SQLAlchemy Database: uses ORM (evidence: `core/models.py`)
- Session Access Control → SQLAlchemy Database: reads and writes users (evidence: `core/auth.py`)
- Session Access Control → Domain Records: queries users (evidence: `core/auth.py`)
- Audit Logging → SQLAlchemy Database: writes audit entries (evidence: `core/audit.py`)
- Audit Logging → Domain Records: creates audit records (evidence: `core/audit.py`)
