# ballwictb/finanzapp architecture

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

- Interactive diagram: https://gitdiagram.com/ballwictb/finanzapp
- Repository: https://github.com/ballwictb/finanzapp

## Overview

1. **Overall shape**
   - This is a **traditional PHP web application** with browser-side JavaScript and CSS, not a SPA. The server renders pages such as the landing page and the auth/account flows, while the client adds validation, translation, overlays, and richer UI behavior.

2. **Primary request entry points**
   - The top-level entry is `index.php`, which likely serves the public landing experience.
   - Feature pages live under `app/` (`about.php`, `contact.php`, `cookies.php`, `privacy.php`, `terms.php`, `login.php`, `register.php`, `reset.php`, `resetPassword.php`, `userConfig.php`), each acting as a route/page in the app.
   - `receive-data.php` is the clearest standalone backend endpoint in the tree and likely handles posted form or API-style submissions.

3. **Authentication and account management boundary**
   - Auth-related server pages are grouped in `app/auth/`:
     - `logout.php`
     - `deleteAccount.php`
     - `api_response_debug.txt` as a debug artifact for backend responses
   - The auth flow includes registration, login, password reset, and account deletion, with server-side pages paired with client-side validation scripts in `js/`.

4. **Shared layout and page composition**
   - Reusable page chrome is split into `includes/header.php`, `includes/footer.php`, and `includes/mobileMenu.php`.
   - This suggests a componentized PHP template approach: each page includes the shared header/footer and injects page-specific content into a common shell.

5. **Frontend assets and interaction layer**
   - CSS is organized by concern: `css/auth.css`, `css/landing_page.css`, and `css/scrollbar.css`.
   - JavaScript is split by feature:
     - form validation: `loginValidation.js`, `registerValidation.js`, `resetValidation.js`, `contactValidation.js`, `validationUtils.js`
     - page behavior: `landing_page.js`, `overlay.js`, `loader.js`, `liteVideo.js`
     - account/settings behavior: `userConfig.js`, `passwordChange.js`
     - API and email helpers: `api.js`, `email.js`, `initEmail.js`
   - The frontend is therefore responsible for user experience, while the PHP pages own the actual page lifecycle and submission endpoints.

6. **Localization and text rendering**
   - Multi-language support is first-class:
     - `langs/en.json`, `langs/es.json`, `langs/fr.json`
     - `js/trans.js` and `js/translations.js`
   - This indicates text content is dynamically swapped in the browser, so the same PHP pages can serve multiple locales without duplicating page structure.

7. **External service integrations**
   - The README identifies **reCAPTCHA v3** for bot protection and **EmailJS** for notification/email workflows.
   - The presence of `js/email.js` and `js/initEmail.js` supports an outbound-email integration on the client side.
   - README also mentions **Resend** for financial analysis, though the file tree does not expose a dedicated backend integration layer for it; if used, it is likely encapsulated behind `receive-data.php` or client-side API helpers.

8. **Configuration and secrets boundary**
   - `config/config.php` is the central configuration entry point and is likely where environment-dependent values, service keys, and application settings are defined.
   - The architecture implies a clear split between reusable config and page scripts, which is typical for PHP apps that need to share credentials and constants across multiple pages.

9. **Static content and documentation assets**
   - `assets/` contains images and wiki/readme media used by the site and documentation.
   - `manifest/manifest.json` and `manifest/manifest_icons/` indicate PWA-style metadata and install icons, so the frontend is designed to be installable or at least mobile-friendly.
   - `docs/` contains governance and project documentation, while `errors/` holds custom error pages for HTTP and token failures.

10. **Operational and quality tooling**
   - GitHub Actions workflows under `.github/workflows/` cover code scanning, onboarding automation, labels, and SonarCloud analysis.
   - `sonar-project.properties` confirms SonarCloud integration as part of code-quality checks.
   - These tools are repository-level concerns: they do not affect runtime behavior, but they shape CI, security scanning, and maintainability.

11. **Typical runtime flow**
   - A user loads a PHP page.
   - The page includes shared header/footer markup and page-specific CSS/JS.
   - Browser scripts handle localization and form validation.
   - Forms submit to PHP endpoints or dedicated handlers such as `receive-data.php` and auth scripts.
   - The backend returns rendered pages or error pages from `errors/` when needed.

12. **Important architectural boundaries to show in a diagram**
   - **Browser/UI layer**: PHP-rendered pages plus CSS/JS.
   - **Shared templates**: `includes/`.
   - **Feature pages**: `app/` and top-level entry points.
   - **Auth/account backend**: `app/auth/` and reset/login/register flows.
   - **Integration layer**: reCAPTCHA / EmailJS / any API calls from `js/`.
   - **Configuration**: `config/config.php`.
   - **Static/documentation assets**: `assets/`, `manifest/`, `docs/`, `errors/`.

Main entry points: [`includes/header.php`](https://github.com/ballwictb/finanzapp/blob/main/includes/header.php) (Header), [`index.php`](https://github.com/ballwictb/finanzapp/blob/main/index.php) (Home), [`app/contact.php`](https://github.com/ballwictb/finanzapp/blob/main/app/contact.php) (Contact), [`js/trans.js`](https://github.com/ballwictb/finanzapp/blob/main/js/trans.js) (Translations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server pages"]
  node_index["Home<br/>php entry<br/>[index.php]"]
  node_app_about["About<br/>php page<br/>[about.php]"]
  node_app_contact["Contact<br/>php page<br/>[contact.php]"]
  node_app_login["Login<br/>php page<br/>[login.php]"]
  node_app_register["Register<br/>php page<br/>[register.php]"]
  node_app_reset["Reset<br/>php page<br/>[reset.php]"]
  node_app_reset_pw["Set Password<br/>php page<br/>[resetPassword.php]"]
  node_app_userconfig["Settings<br/>php page<br/>[userConfig.php]"]
  node_app_auth["Auth actions<br/>php handlers<br/>[logout.php]"]
  node_receive_data["Receive data<br/>endpoint<br/>[receive-data.php]"]
end

subgraph group_frontend["Frontend layer"]
  node_validation_js["Validation<br/>js forms<br/>[validationUtils.js]"]
  node_landing_js["Landing UI<br/>js ui<br/>[landing_page.js]"]
  node_auth_js["Auth UI<br/>js forms<br/>[loginValidation.js]"]
  node_styles["Styles<br/>css<br/>[landing_page.css]"]
end

subgraph group_shared["Shared shell"]
  node_header["Header<br/>template<br/>[header.php]"]
  node_footer["Footer<br/>template<br/>[footer.php]"]
  node_mobile_menu["Mobile menu<br/>template<br/>[mobileMenu.php]"]
end

subgraph group_integrations["Integrations"]
  node_config["Config<br/>[config.php]"]
  node_api_js["API client<br/>js integration<br/>[api.js]"]
  node_email_js["Email flow<br/>js integration<br/>[email.js]"]
  node_trans_js["Translations<br/>js i18n<br/>[trans.js]"]
end

subgraph group_content["Content and assets"]
  node_langs["Locales<br/>json i18n<br/>[en.json]"]
  node_assets[("Media<br/>static assets")]
  node_errors["Errors<br/>html pages<br/>[404.html]"]
  node_manifest["Manifest<br/>pwa metadata<br/>[manifest.json]"]
end

node_index -->|"includes"| node_header
node_index -->|"includes"| node_footer
node_index -->|"loads"| node_landing_js
node_index -->|"styles"| node_styles
node_app_about -->|"includes"| node_header
node_app_contact -->|"includes"| node_header
node_app_login -->|"includes"| node_header
node_app_register -->|"includes"| node_header
node_app_reset -->|"includes"| node_header
node_app_reset_pw -->|"includes"| node_header
node_app_userconfig -->|"includes"| node_header
node_app_auth -->|"uses"| node_config
node_app_contact -->|"submits to"| node_receive_data
node_app_login -->|"loads"| node_auth_js
node_app_register -->|"loads"| node_auth_js
node_app_reset -->|"loads"| node_auth_js
node_app_reset_pw -->|"loads"| node_auth_js
node_app_userconfig -->|"loads"| node_auth_js
node_app_contact -->|"uses"| node_validation_js
node_app_contact -->|"uses"| node_email_js
node_app_contact -->|"uses"| node_trans_js
node_app_login -->|"uses"| node_trans_js
node_app_register -->|"uses"| node_trans_js
node_app_reset -->|"uses"| node_trans_js
node_app_userconfig -->|"uses"| node_trans_js
node_validation_js -->|"reads"| node_langs
node_trans_js -->|"reads"| node_langs
node_email_js -->|"calls"| node_api_js
node_api_js -->|"uses"| node_config
node_index -->|"publishes"| node_manifest
node_index -->|"uses"| node_assets
node_app_about -->|"uses"| node_assets
node_app_contact -->|"uses"| node_assets
node_app_login -->|"uses"| node_assets
node_errors -.->|"fallback"| node_app_login

click node_index "https://github.com/ballwictb/finanzapp/blob/main/index.php"
click node_app_about "https://github.com/ballwictb/finanzapp/blob/main/app/about.php"
click node_app_contact "https://github.com/ballwictb/finanzapp/blob/main/app/contact.php"
click node_app_login "https://github.com/ballwictb/finanzapp/blob/main/app/login.php"
click node_app_register "https://github.com/ballwictb/finanzapp/blob/main/app/register.php"
click node_app_reset "https://github.com/ballwictb/finanzapp/blob/main/app/reset.php"
click node_app_reset_pw "https://github.com/ballwictb/finanzapp/blob/main/app/resetPassword.php"
click node_app_userconfig "https://github.com/ballwictb/finanzapp/blob/main/app/userConfig.php"
click node_app_auth "https://github.com/ballwictb/finanzapp/blob/main/app/auth/logout.php"
click node_receive_data "https://github.com/ballwictb/finanzapp/blob/main/receive-data.php"
click node_header "https://github.com/ballwictb/finanzapp/blob/main/includes/header.php"
click node_footer "https://github.com/ballwictb/finanzapp/blob/main/includes/footer.php"
click node_mobile_menu "https://github.com/ballwictb/finanzapp/blob/main/includes/mobileMenu.php"
click node_config "https://github.com/ballwictb/finanzapp/blob/main/config/config.php"
click node_api_js "https://github.com/ballwictb/finanzapp/blob/main/js/api.js"
click node_email_js "https://github.com/ballwictb/finanzapp/blob/main/js/email.js"
click node_trans_js "https://github.com/ballwictb/finanzapp/blob/main/js/trans.js"
click node_validation_js "https://github.com/ballwictb/finanzapp/blob/main/js/validationUtils.js"
click node_landing_js "https://github.com/ballwictb/finanzapp/blob/main/js/landing_page.js"
click node_auth_js "https://github.com/ballwictb/finanzapp/blob/main/js/loginValidation.js"
click node_styles "https://github.com/ballwictb/finanzapp/blob/main/css/landing_page.css"
click node_langs "https://github.com/ballwictb/finanzapp/blob/main/langs/en.json"
click node_assets "https://github.com/ballwictb/finanzapp/tree/main/assets/Readme"
click node_errors "https://github.com/ballwictb/finanzapp/blob/main/errors/404.html"
click node_manifest "https://github.com/ballwictb/finanzapp/blob/main/manifest/manifest.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_index,node_app_about,node_app_contact,node_app_login,node_app_register,node_app_reset,node_app_reset_pw,node_app_userconfig,node_app_auth,node_receive_data toneBlue
class node_validation_js,node_landing_js,node_auth_js,node_styles toneAmber
class node_header,node_footer,node_mobile_menu toneMint
class node_config,node_api_js,node_email_js,node_trans_js toneRose
class node_langs,node_assets,node_errors,node_manifest toneIndigo
```

## Components

### Server pages

PHP entry points and request handlers

- [Home](https://github.com/ballwictb/finanzapp/blob/main/index.php): php entry · Public landing page entry point · `index.php`
- [About](https://github.com/ballwictb/finanzapp/blob/main/app/about.php): php page · Informational app page · `app/about.php`
- [Contact](https://github.com/ballwictb/finanzapp/blob/main/app/contact.php): php page · Contact form page · `app/contact.php`
- [Login](https://github.com/ballwictb/finanzapp/blob/main/app/login.php): php page · Sign-in page · `app/login.php`
- [Register](https://github.com/ballwictb/finanzapp/blob/main/app/register.php): php page · Account creation page · `app/register.php`
- [Reset](https://github.com/ballwictb/finanzapp/blob/main/app/reset.php): php page · Password reset request page · `app/reset.php`
- [Set Password](https://github.com/ballwictb/finanzapp/blob/main/app/resetPassword.php): php page · Password reset completion page · `app/resetPassword.php`
- [Settings](https://github.com/ballwictb/finanzapp/blob/main/app/userConfig.php): php page · User configuration page · `app/userConfig.php`
- [Auth actions](https://github.com/ballwictb/finanzapp/blob/main/app/auth/logout.php): php handlers · Logout and account deletion endpoints · `app/auth/logout.php`
- [Receive data](https://github.com/ballwictb/finanzapp/blob/main/receive-data.php): endpoint · Standalone submission handler · `receive-data.php`

### Frontend layer

Browser-side scripts and styles

- [Validation](https://github.com/ballwictb/finanzapp/blob/main/js/validationUtils.js): js forms · Shared form validation utilities · `js/validationUtils.js`
- [Landing UI](https://github.com/ballwictb/finanzapp/blob/main/js/landing_page.js): js ui · Landing page interactions and overlays · `js/landing_page.js`
- [Auth UI](https://github.com/ballwictb/finanzapp/blob/main/js/loginValidation.js): js forms · Login, register, reset, and password-change scripts · `js/loginValidation.js`
- [Styles](https://github.com/ballwictb/finanzapp/blob/main/css/landing_page.css): css · Primary site and auth styles · `css/landing_page.css`

### Shared shell

Reusable templates and common layout

- [Header](https://github.com/ballwictb/finanzapp/blob/main/includes/header.php): template · Shared page chrome and top navigation · `includes/header.php`
- [Footer](https://github.com/ballwictb/finanzapp/blob/main/includes/footer.php): template · Shared page chrome and footer · `includes/footer.php`
- [Mobile menu](https://github.com/ballwictb/finanzapp/blob/main/includes/mobileMenu.php): template · Responsive navigation component · `includes/mobileMenu.php`

### Integrations

External services and app wiring

- [Config](https://github.com/ballwictb/finanzapp/blob/main/config/config.php): app config · Central application configuration · `config/config.php`
- [API client](https://github.com/ballwictb/finanzapp/blob/main/js/api.js): js integration · Client-side API/request helper · `js/api.js`
- [Email flow](https://github.com/ballwictb/finanzapp/blob/main/js/email.js): js integration · EmailJS and outbound email wiring · `js/email.js`
- [Translations](https://github.com/ballwictb/finanzapp/blob/main/js/trans.js): js i18n · Language switching and text rendering · `js/trans.js`

### Content and assets

Static content, localization, and docs

- [Locales](https://github.com/ballwictb/finanzapp/blob/main/langs/en.json): json i18n · Translated site strings · `langs/en.json`
- [Media](https://github.com/ballwictb/finanzapp/tree/main/assets/Readme): static assets · Images and wiki/documentation media · `assets/Readme`
- [Errors](https://github.com/ballwictb/finanzapp/blob/main/errors/404.html): html pages · Custom HTTP and token error pages · `errors/404.html`
- [Manifest](https://github.com/ballwictb/finanzapp/blob/main/manifest/manifest.json): pwa metadata · Install metadata and icons · `manifest/manifest.json`

## Connections

- Home → Header: includes · Uses shared site chrome
- Home → Footer: includes · Uses shared site chrome
- Home → Landing UI: loads · Adds landing interactions
- Home → Styles: styles · Applies landing and site styling
- About → Header: includes · Uses shared site chrome
- Contact → Header: includes · Uses shared site chrome
- Login → Header: includes · Uses shared site chrome
- Register → Header: includes · Uses shared site chrome
- Reset → Header: includes · Uses shared site chrome
- Set Password → Header: includes · Uses shared site chrome
- Settings → Header: includes · Uses shared site chrome
- Auth actions → Config: uses · Reads shared configuration
- Contact → Receive data: submits to · Contact form handler
- Login → Auth UI: loads · Login validation behavior
- Register → Auth UI: loads · Registration validation behavior
- Reset → Auth UI: loads · Reset request behavior
- Set Password → Auth UI: loads · Password reset behavior
- Settings → Auth UI: loads · Account settings behavior
- Contact → Validation: uses · Shared form validation
- Contact → Email flow: uses · Email workflow support
- Contact → Translations: uses · Locale-aware UI text
- Login → Translations: uses · Locale-aware UI text
- Register → Translations: uses · Locale-aware UI text
- Reset → Translations: uses · Locale-aware UI text
- Settings → Translations: uses · Locale-aware UI text
- Validation → Locales: reads · Loads localized validation messages
- Translations → Locales: reads · Loads translated strings
- Email flow → API client: calls · Uses request helpers for outbound actions
- API client → Config: uses · Uses shared endpoints or keys
- Home → Manifest: publishes · Exposes PWA metadata
- Home → Media: uses · Displays site media
- About → Media: uses · Displays site media
- Contact → Media: uses · Displays site media
- Login → Media: uses · Displays site media
- Errors → Login: fallback · Error handling can redirect back to auth flows
