# ds-1090/ezyaid architecture

> Architecture diagram of the GitHub repository ds-1090/ezyaid, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ds-1090/ezyaid
- Repository: https://github.com/ds-1090/ezyaid

## Overview

##### Project type and purpose
- This is a full-stack mobile application with:
- A Flutter-based frontend targeting Android and iOS
- A Django REST API backend (“eamiddleware”)
- A Kafka consumer service in Python
- A Spark data-processing component
- A Redis configuration (redis.conf) and a Docker Compose setup for orchestration
- Judging by file names (schemes, favorites, registration, notifications), the app appears to list and manage public schemes or resources.

##### File structure
- Top-level:
- docker-compose.yaml: multi-container orchestration
- requirements.txt: shared Python dependencies
- redis.conf: custom Redis settings
- spark_processing/: one-off or scheduled Spark batch job
- backend/:
- eamiddleware/: Django project
– settings.py, wsgi.py, asgi.py
– models.py, serializers.py, views.py, urls.py
– db.sqlite3: development database
– Dockerfile, requirements.txt
- kafkaconsumer/: lightweight Python service consuming Kafka topics
– kafkaconsumer.py, Dockerfile
- frontend/:
- Flutter project with lib/ (Dart UI pages, state providers)
- android/ and ios/ native wrappers
- pubspec.yaml, test/ widget_test.dart

##### README for additional insights
- README.md is empty, but file names imply:
- The Django API exposes endpoints for schemes, profiles, favorites, notifications
- Kafka consumer reacts to events (e.g., new registrations)
- Spark job processes an Excel file into a target store (possibly initial data ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mobile Tier
    subgraph "Mobile Tier"
        FlutterApp["Flutter App"]:::frontend
    end

    %% Backend Synchronous Tier
    subgraph "Backend Services"
        DjangoAPI["Django REST API"]:::service
    end

    %% Messaging Tier
    subgraph "Messaging"
        KafkaCluster["Kafka Cluster"]:::broker
        KafkaConsumer["Kafka Consumer Service"]:::service
    end

    %% Batch Processing Tier
    subgraph "Batch Processing"
        SparkJob["Spark ETL Job"]:::batch
    end

    %% Data Stores
    subgraph "Data Stores"
        DB["SQLite Database"]:::db
        Redis["Redis Cache"]:::db
    end

    %% Orchestration
    subgraph "Orchestration"
        Compose["Docker Compose"]:::orchestration
        SharedReq["Shared Python Requirements"]:::orchestration
        RedisConf["redis.conf"]:::orchestration
    end

    %% Connections
    FlutterApp -->|"HTTP(S) JSON"| DjangoAPI
    DjangoAPI -->|"JDBC/ORM"| DB
    DjangoAPI -->|"Publish events (Avro)"| KafkaCluster
    KafkaCluster -->|"Subscribe"| KafkaConsumer
    KafkaConsumer -->|"Write/Read"| DB
    KafkaConsumer -->|"Cache updates"| Redis
    SparkJob -.->|"Batch ETL (JDBC)"| DB
    DjangoAPI -->|"Cache"| Redis

    Compose -->|orchestrates| DjangoAPI
    Compose -->|orchestrates| KafkaConsumer
    Compose -->|orchestrates| Redis
    Compose -->|orchestrates| SparkJob

    SharedReq -->|used by| DjangoAPI
    SharedReq -->|used by| KafkaConsumer

    RedisConf -->|configures| Redis

    %% Click Events
    click FlutterApp "https://github.com/ds-1090/ezyaid/tree/main/frontend/"
    click DjangoAPI "https://github.com/ds-1090/ezyaid/tree/main/backend/eamiddleware/"
    click KafkaConsumer "https://github.com/ds-1090/ezyaid/tree/main/backend/kafkaconsumer/"
    click SparkJob "https://github.com/ds-1090/ezyaid/tree/main/spark_processing/"
    click RedisConf "https://github.com/ds-1090/ezyaid/blob/main/redis.conf"
    click Compose "https://github.com/ds-1090/ezyaid/blob/main/docker-compose.yaml"
    click SharedReq "https://github.com/ds-1090/ezyaid/blob/main/requirements.txt"
    click DB "https://github.com/ds-1090/ezyaid/blob/main/backend/eamiddleware/db.sqlite3"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef service fill:#90EE90,stroke:#333,stroke-width:1px
    classDef db fill:#FFA500,stroke:#333,stroke-width:1px
    classDef broker fill:#FF6347,stroke:#333,stroke-width:1px
    classDef batch fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef orchestration fill:#D3D3D3,stroke:#333,stroke-width:1px
```
