How megakranuk/cybersecurity_incidents_tracker works
Cybersecurity Incident Tracker is a web application for registering, managing, and analyzing cybersecurity incidents. A user works through the browser UI, whose state layer loads and filters incident lists, submits changes, and requests statistics through the API client; the backend authenticates and routes requests through controllers and services to SQLite-backed repositories. Separate flows support account registration and login. The README documents the frontend/backend layers and REST/SQLite design; sampled source confirms key wiring and analytics, while some frontend features and database initialization details are represented only where documented or indexed.
Main entry points: app.ts Express application · main.ts UI state · incidents.routes.ts Incident routes · incidents.service.ts Incident service
Components 23
Browser application
- UI state
frontend/src/main.ts - Interface rendering
frontend/src/ui.ts - API client
frontend/src/apiClient.ts - List cache
frontend/src/cache.ts - Client DTOs
frontend/src/dtos.ts
REST backend
- Express application
backend/src/app.ts - Auth routes
backend/src/routes/auth.routes.ts - Incident routes
backend/src/routes/incidents.routes.ts - JWT authentication
backend/src/middleware/jwt-auth.middleware.ts - Request middleware
backend/src/middleware/logging.middleware.ts - Error handling
backend/src/middleware/error-handler.middleware.ts - Auth controller
backend/src/controllers/auth.controller.ts - Incident controller
backend/src/controllers/incidents.controller.ts - Runtime configuration
backend/src/config.ts
Incident domain
- Auth service
backend/src/services/auth.service.ts - Incident service
backend/src/services/incidents.service.ts - Incident DTOs
backend/src/dtos/incidents.dto.ts
Persistence
- Incident repository
backend/src/repositories/incidents.repository.ts - SQLite query client
backend/src/db/dbClient.ts - SQLite database
backend/data/app.db - Database setup
backend/src/db/migrate.ts
Other components
- User
- Incident API
Connections 29
- User → UI state: uses
README.md - UI state → API client: requests data
frontend/src/main.ts - UI state → Interface rendering: renders results
frontend/src/main.ts - UI state → List cache: caches lists
frontend/src/main.ts - UI state → Client DTOs: maps data
frontend/src/main.ts - Interface rendering → Client DTOs: uses view models
frontend/src/ui.ts - API client → Client DTOs: types responses
frontend/src/apiClient.ts - API client → Incident API: calls endpoints
frontend/src/apiClient.ts - Incident API → Express application: serves REST
README.md - Express application → Auth routes: mounts routes
backend/src/app.ts - Express application → Incident routes: mounts routes
backend/src/app.ts - Express application → JWT authentication: protects incidents
backend/src/app.ts - Express application → Request middleware: registers middleware
backend/src/app.ts - Express application → Error handling: registers handler
backend/src/app.ts - Express application → Database setup: runs migrations
backend/src/app.ts - Auth routes → Auth controller: dispatches handlers
backend/src/routes/auth.routes.ts - Auth routes → JWT authentication: guards users
backend/src/routes/auth.routes.ts - Incident routes → Incident controller: dispatches handlers
backend/src/routes/incidents.routes.ts - Incident routes → Incident service: constructs service
backend/src/routes/incidents.routes.ts - Incident routes → Incident repository: constructs repository
backend/src/routes/incidents.routes.ts - Auth controller → Auth service: delegates auth
backend/src/controllers/auth.controller.ts - Incident controller → Incident service: delegates operations
backend/src/controllers/incidents.controller.ts - Incident service → Incident repository: queries incidents
backend/src/services/incidents.service.ts - Incident service → Incident DTOs: validates data
backend/src/services/incidents.service.ts - Incident repository → SQLite query client: executes queries
backend/src/repositories/incidents.repository.ts - Auth service → SQLite query client: reads and writes users
backend/src/services/auth.service.ts - SQLite query client → SQLite database: accesses SQLite
- Database setup → SQLite query client: runs database queries
backend/src/db/migrate.ts - Database setup → Runtime configuration: uses settings