# elionay00/helpnow-solidarity-app-project architecture

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

- Interactive diagram: https://gitdiagram.com/elionay00/helpnow-solidarity-app-project
- Repository: https://github.com/elionay00/helpnow-solidarity-app-project

## Overview

##### Project Type and Purpose
- Type: Mobile-first/full-stack prototype front-end application (Ionic React + React Router + TypeScript)
- Purpose: “AjudaJá” connects users in need with volunteers via geolocated requests/offers, auth flows, and planned chat/map features.

##### File Structure
- Top-Level Configs:
- package.json, tsconfig.json, vite.config.ts → build and tooling (Vite + TS)
- ionic.config.json → Ionic CLI settings
- cypress.config.ts + cypress/… → end-to-end testing
- Public Assets:
- public/manifest.json, index.html → PWA web manifest and HTML shell
- Source Code (“src”):
- main.tsx → app bootstrap (Ionic React + Router)
- App.tsx + App.test.tsx → top‐level router/tab container and basic tests
- pages/ (Home.tsx) → core tab pages
- Autentication/ (Login.tsx, Register.tsx) → auth flow pages
- components/ExploreContainer.tsx → reusable UI component(s)
- utils/(masks.ts, validationSchemas.ts) → input masks & form validation
- theme/variables.css → theming variables
- Build & Linting:
- eslint.config.js, tsconfig.node.json
- Tests:
- cypress-based E2E, React Testing Library in setupTests.ts

##### Key Insights from README
- Navigation: IonTabs + IonRouterOutlet + React Router for bottom tab navigation (Home, Login, Register)
- Register page uses Yup schema, input masks, Ionic UI components
- Planned features: backend API, map (geolocation), chat, emergency button, NGO management panel

##### Main Components
a. Presentation Layer (Ionic React Front-end)
- Ionic UI Components (IonTabs, IonInput, IonButton, IonCard…)
- React Router (route definitions within IonRouterOutlet)
- Pages: Home, Login, Register
- Reusable Components: ExploreContainer, Input masks & validation services
b. Build & Delivery
- Vite bundler → Outputs PWA/SPA assets
- Cypress E2E & React unit tests
c. External Services (future/backlog)
- Authentication API (Sign-up, Login endpoints)
- Geolocation/Map API (Google Maps or OpenStreetMap)
- Chat Service (WebSocket or REST+Polling)
- Database (User profiles, requests/offers)
- Notification Service (push, emergency alerts)
d. Utility Modules
- Input mask service
- Validation schemas

##### Relationships & Interactions
- User taps a tab → React Router/Ionic RouterOutlet loads the corresponding Page component.
- Register/Login pages call Auth API → JSON over HTTPS → receives JWT/session token.
- Home page fetches geolocated data from Map API and app-specific REST endpoints.
- Components use common utils for validation and formatting before dispatching API calls.
- Build pipeline: Vite bundles src → static assets served to mobile/web platforms.
- Tests: Cypress drives the UI through the tab flow → validates end-to-end behavior.

##### Architectural Patterns & Principles
- Layered Architecture: Presentation (pages/components) → Domain logic (validation, auth services) → Data/Integration (external APIs)
- Component-based UI (Ionic + React)
- Client-side routing (React Router)
- Separation of concerns: utils vs UI vs pages
- Future extensibility for micro-frontend splits or hybrid mobile packaging

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build & Delivery Layer
    subgraph "Build & Delivery" 
        direction TB
        ViteConfig["vite.config.ts"]:::build
        CypressConfig["cypress.config.ts"]:::build
        CypressE2ETests["cypress/e2e/test.cy.ts"]:::build
        ReactUnitSetup["src/setupTests.ts"]:::build
        ReactUnitTest["src/App.test.tsx"]:::build
    end

    %% Frontend UI Layer
    subgraph "Frontend UI Layer"
        direction TB
        Main["main.tsx"]:::frontend
        AppShell["App.tsx"]:::frontend
        subgraph "Router & Tabs Shell"
            direction TB
            IonTabs["IonTabs + IonRouterOutlet"]:::frontend
        end
        subgraph "Pages"
            direction TB
            HomePage["HomePage"]:::frontend
            LoginPage["LoginPage"]:::frontend
            RegisterPage["RegisterPage"]:::frontend
        end
        Reusable["ExploreContainer"]:::frontend
    end

    %% Service & Utils Layer
    subgraph "Service & Utils"
        direction TB
        AuthService["AuthService"]:::service
        InputMask["InputMaskService"]:::service
        Validation["ValidationSchemas"]:::service
    end

    %% External Services
    subgraph "External & Future Services"
        direction TB
        AuthAPI["Authentication API"]:::external
        MapAPI["Geolocation/Map API"]:::external
        ChatService["Chat Service"]:::external
        Database["Database"]:::external
        Notification["Notification Service"]:::external
    end

    %% Connections
    ViteConfig -->|bundles| Main
    Main -->|"bootstraps app"| AppShell
    AppShell --> IonTabs
    IonTabs --> HomePage
    IonTabs --> LoginPage
    IonTabs --> RegisterPage
    HomePage --> Reusable
    LoginPage --> Reusable
    RegisterPage --> Reusable

    HomePage -->|"fetch geolocated data over HTTPS"| MapAPI
    HomePage -->|"fetch app data over HTTPS"| AuthAPI
    LoginPage -->|"validate form"| Validation
    RegisterPage -->|"validate form"| Validation
    LoginPage -->|"apply masks"| InputMask
    RegisterPage -->|"apply masks"| InputMask
    LoginPage -->|"call AuthService"| AuthService
    RegisterPage -->|"call AuthService"| AuthService
    AuthService -->|"HTTPS JWT"| AuthAPI
    AuthService --> Database

    ChatService -.-> Database
    Notification -.-> AuthAPI
    Notification -.-> Database

    %% Click Events
    click Main "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/main.tsx"
    click AppShell "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/App.tsx"
    click HomePage "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/pages/Home.tsx"
    click LoginPage "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/Autentication/Login.tsx"
    click RegisterPage "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/Autentication/Register.tsx"
    click Reusable "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/components/ExploreContainer.tsx"
    click InputMask "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/utils/masks.ts"
    click Validation "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/utils/validationSchemas.ts"
    click ViteConfig "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/vite.config.ts"
    click CypressConfig "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/cypress.config.ts"
    click CypressE2ETests "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/cypress/e2e/test.cy.ts"
    click ReactUnitSetup "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/setupTests.ts"
    click ReactUnitTest "https://github.com/elionay00/helpnow-solidarity-app-project/blob/main/src/App.test.tsx"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#1E90FF,color:#000
    classDef service fill:#DFFFD6,stroke:#32CD32,color:#000
    classDef external fill:#FFD6D6,stroke:#FF6347,color:#000
    classDef build fill:#FFEFD5,stroke:#FFA500,color:#000
```
