# amansingh-13/application-monitoring architecture

> Architecture diagram of the GitHub repository amansingh-13/application-monitoring, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amansingh-13/application-monitoring
- Repository: https://github.com/amansingh-13/application-monitoring

## Overview

##### Project Type and Purpose
- The project is a full-stack application, likely developed as a final course project (CS387) focused on monitoring applications or machines.
- The backend is built using Django (note the typical Django directories, apps, migrations, and settings files), which suggests a RESTful API structure, possibly handling data collection (“basic_input”) and data dissemination (“send_data”).
- The frontend is implemented with an Angular application (files such as angular.json, tsconfig files, TypeScript components for add-machine and show-stats) that provides a user interface for interacting with the monitoring system.
- Additional directories like “logger” indicate the presence of auxiliary services for logging requests and possibly tracking user actions. The “basedjango” and “testing” directories seem to offer alternative or testing versions of the Django backend, including Dockerfiles and setup scripts for integration testing with services like PostgreSQL.

##### Main Components of the System
a. Frontend:
– Located under the “frontend/application-monitor” directory.
– Implements Angular components and services for adding machines (add-machine) and displaying statistics (show-stats).
b. Backend:
– The core Django project is found in “backend/my_backend”. It contains two primary Django apps:
- basic_input – Likely responsible for processing or receiving basic machine/application input (models, serializers, views, and urls for data ingestion).
- send_data – Possibly handles data output or further processing/dissemination of monitoring data.
– The Django project includes standard configuration files (settings.py, urls.py, wsgi.py/asgi.py) ensuring a well-organized, scalable MVC/MVT pattern.
c. Logger:
– The “logger” directory holds logging utilities (logger.py, request_log.py, and a shell script). This might work as an independent logging module or be integrated with the Django middleware for request tracking.
d. Testing/Deployment Environment:
– The “testing” directory contains an additional “basedjango” backend version alongside Dockerfiles for Django and PostgreSQL. Setup scripts indicate an environment for testing, container orchestration, or local deployment.

##### Architectural Patterns and Design Principles
- The project adheres to the separation of concerns:
- Frontend and backend are clearly separated, with Angular handling the client-side and Django powering the REST API.
- Within the backend, Django’s MVT architecture is used to separate models, views, and templates.
- The use of Dockerfiles and setup scripts in the “testing” directory illustrates containerization best practices for deployment and integration testing.
- The logger service indicates cross-cutting concerns handled in a modular fashion.

##### Technology Stack
- Frontend: Angular framework, TypeScript, HTML, CSS.
- Backend: Django (Python) along with its associated ecosystem (Django apps, migrations, serializers, and views).
- Additional: Likely PostgreSQL (inferred from postgres.Dockerfile) for persistent storage, and Docker for deployment/testing.
- Supporting components: Logging utilities provided in their own module to track API requests.

## Diagram (Mermaid)

```mermaid
flowchart TD
    FE["Angular Frontend (Add Machine, Show Stats)"]:::frontend
    BECore["Django Backend (Core)"]:::backend
    BI["Django App: basic_input"]:::backend
    SD["Django App: send_data"]:::backend
    LOG["Logger Service"]:::logger
    DB["PostgreSQL Database"]:::database

    subgraph "Testing & Deployment"
        TDS["Docker & Setup Scripts"]:::testing
        BD["Basedjango Environment"]:::testing
    end

    FE -->|"HTTPcalls"| BECore
    BECore -->|"calls"| BI
    BECore -->|"calls"| SD
    BI -->|"writesTo"| DB
    SD -->|"writesTo"| DB
    BECore -->|"logs"| LOG
    TDS -->|"deploys"| BECore
    BD -->|"alternativeEnv"| BECore

    click FE "https://github.com/amansingh-13/application-monitoring/tree/main/frontend/application-monitor"
    click BECore "https://github.com/amansingh-13/application-monitoring/tree/main/backend/my_backend/my_backend"
    click BI "https://github.com/amansingh-13/application-monitoring/tree/main/backend/my_backend/basic_input"
    click SD "https://github.com/amansingh-13/application-monitoring/tree/main/backend/my_backend/send_data"
    click LOG "https://github.com/amansingh-13/application-monitoring/tree/main/logger"
    click TDS "https://github.com/amansingh-13/application-monitoring/tree/main/testing"
    click BD "https://github.com/amansingh-13/application-monitoring/tree/main/basedjango"

    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef logger fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef database fill:#FFA07A,stroke:#000,stroke-width:2px;
    classDef testing fill:#DDA0DD,stroke:#000,stroke-width:2px;
```
