# datonefeed/eventanywhere-app architecture

> Architecture diagram of the GitHub repository datonefeed/eventanywhere-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/datonefeed/eventanywhere-app
- Repository: https://github.com/datonefeed/eventanywhere-app

## Overview

##### Project Type and Purpose
- This is a multi-component event management platform that integrates both online and offline event handling. The system supports features such as event management, multi-session livestreaming with interactive tools (e.g., Q&A, surveys), personalized AI recommendations, and seamless authentication (via Google/Facebook).
- The overall architecture is split across several repositories:
∘ A mobile/frontend part built with Flutter (the file tree provided reflects this Flutter project).
∘ A Node.js-based backend server.
∘ A Python-based AI recommendation system.
∘ A .NET Core admin panel for managing events and users.
∘ External integrations like MongoDB for data storage and ZEGOCLOUD SDK for livestreaming.

##### Analyzing the File Structure (Flutter Frontend)
- The file tree shows clear separation into Android and iOS directories which indicate platform-specific projects.
- The “lib” directory contains:
∘ “ui” – which holds view files, widgets, and viewmodels that follow the MVVM pattern.
∘ “api”, “models”, “repositories”, and “services” – these directories indicate a layered architecture separating business logic, data models, and API calls.
- Assets such as fonts and Rive animations are organized under “assets”.
- The well-organized Flutter directories ensure good separation between the UI, state management, and API services.

A. Frontend (Mobile Client)
- Platforms: Android and iOS – representing the native builds.
- UI Layer: Includes UI views, widgets, and viewmodels (the “lib/ui” directory). Indicate that the UI is built using Flutter.
- Service Layer: Consists of API, repositories, and services (e.g., authentication service, event service, notification service) that connect to the backend.
- Assets and Localization: Represent custom themes, fonts, and localization (from “assets” and “lib/core/localization”).

B. Backend Server (Node.js)
- Node.js server as described in the README.
- RESTful API endpoints to be consumed by the mobile app.
- Handles authentication, event CRUD operations, participant registrations, and integrates with MongoDB.
- Deployment notes: Configured via environment variables (PORT, JWT_SECRET, MONGO_URI, etc.).

C. AI Recommendation Service (Python)
- This is a separate microservice that runs on port 9000.
- It uses packages like pandas, scikit-learn, surprise, and Flask.
- This component processes user data and search history to provide personalized event recommendations.

D. Admin Panel (.NET Core)
- A separate admin front-end/back-end built with .NET Core for event and user management.
- Connects to MongoDB and uses JWT for authentication.
- Provides a dashboard for organizers to manage events, sessions, and participants.

E. External Services & Integrations
- MongoDB: Data persistence for events, users, and other resources.
- ZEGOCLOUD SDK: For managing livestreaming features and multi-room sessions.
- External Authentication Providers: Google and Facebook (used by the authentication service).

##### Relationships and Interactions
- The Flutter mobile app (frontend) communicates via HTTP/HTTPS RESTful APIs with the Node.js backend.
- The backend in turn interfaces with the MongoDB database for persistent storage.
- The AI recommendation service receives data (or pulls relevant data) from the backend and serves recommendations back either directly to the mobile client or through the backend.
- The admin panel, built using .NET Core, also connects to MongoDB and provides administrative functionalities.
- Livestream services are integrated via the ZEGOCLOUD SDK within the mobile app, and likely through some backend management.

##### Architectural Patterns and Design Principles
- The mobile app follows a layered approach (or even MVVM), separating UI from business logic (shown by the existence of viewmodels, services, and repositories).
- The overall system design is microservices-inspired, with separate repositories and services (backend, recommendation, admin panel) communicating mostly via REST APIs.
- Usage of environment variables, external configuration files, and clear separation of concerns across components for scalability and maintainability.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter Mobile Client Subgraph
    subgraph "Flutter Mobile Client"
        A["Android Native Project"]:::mobile
        B["iOS Native Project"]:::mobile
        
        subgraph "UI Layer"
            C["Views"]:::mobile
            D["ViewModels"]:::mobile
        end
        
        subgraph "Service Layer"
            E["API Calls"]:::mobile
            F["Services"]:::mobile
            G["Data Repositories"]:::mobile
        end
        
        subgraph "Assets & Localization"
            H["Assets"]:::mobile
            I["Localization"]:::mobile
            J["Theme Settings"]:::mobile
        end
    end

    %% Other Major Components
    K["Node.js Backend"]:::nodejs
    L["Python AI Recommendation Service"]:::microservice
    M[".NET Core Admin Panel"]:::admin
    N[(MongoDB Database)]:::database
    O["ZEGOCLOUD Livestreaming"]:::external
    P["External Authentication (Google/Facebook)"]:::external

    %% Connections
    E -->|"RESTAPI"| K
    K -->|"CRUD"| N
    K -->|"RecommendationQuery"| L
    M -->|"AdminCRUD"| N
    A -->|"Livestream"| O
    K -->|"UsesOAuth"| P

    %% Click Events
    click A "https://github.com/datonefeed/eventanywhere-app/tree/dev/android/app"
    click B "https://github.com/datonefeed/eventanywhere-app/tree/dev/ios/Runner"
    click C "https://github.com/datonefeed/eventanywhere-app/tree/dev/lib/ui/views"
    click D "https://github.com/datonefeed/eventanywhere-app/tree/dev/lib/ui/viewmodels"
    click E "https://github.com/datonefeed/eventanywhere-app/tree/dev/lib/api"
    click F "https://github.com/datonefeed/eventanywhere-app/tree/dev/lib/services"
    click G "https://github.com/datonefeed/eventanywhere-app/tree/dev/lib/repositories"
    click H "https://github.com/datonefeed/eventanywhere-app/tree/dev/assets"
    click I "https://github.com/datonefeed/eventanywhere-app/tree/dev/lib/core/localization"
    click J "https://github.com/datonefeed/eventanywhere-app/tree/dev/lib/core/theme"

    %% Styles
    classDef mobile fill:#add8e6,stroke:#000,stroke-width:1px;
    classDef nodejs fill:#ffcc00,stroke:#000,stroke-width:1px;
    classDef microservice fill:#90ee90,stroke:#000,stroke-width:1px;
    classDef admin fill:#f0e68c,stroke:#000,stroke-width:1px;
    classDef database fill:#d3d3d3,stroke:#000,stroke-width:1px;
    classDef external fill:#ff9999,stroke:#000,stroke-width:1px;
```
