# ijoben/invest architecture

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

- Interactive diagram: https://gitdiagram.com/ijoben/invest
- Repository: https://github.com/ijoben/invest

## Overview

FGT PRO is a browser-based investment-management application with member and administrator interfaces. Members register or log in, manage investment plans and balances, and access affiliate, market-signal, and points-reward features; administrators manage users, transactions, plans, settings, and redemptions. The sampled code identifies localStorage as the persistence layer. Source excerpts are partial, and the README is empty, so interface-to-feature wiring not demonstrated in the excerpts is omitted.

Main entry points: [`js/db.js`](https://github.com/ijoben/invest/blob/main/js/db.js) (State service), [`js/admin-page.js`](https://github.com/ijoben/invest/blob/main/js/admin-page.js) (Admin controller), [`js/app.js`](https://github.com/ijoben/invest/blob/main/js/app.js) (App controller), [`js/admin.js`](https://github.com/ijoben/invest/blob/main/js/admin.js) (Admin controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Web interfaces"]
  node_member_page["Member interface<br/>[index.html]"]
  node_admin_page_html["Admin interface<br/>[admin.html]"]
  node_app["App controller<br/>[app.js]"]
  node_admin_ui["Admin controller<br/>[admin-page.js]"]
end

subgraph group_money["Investment and payments"]
  node_plans["Investment plans<br/>[plans.js]"]
  node_payment["Payments<br/>[payment.js]"]
end

subgraph group_engagement["Member features"]
  node_affiliate["Affiliate engine<br/>[affiliate.js]"]
  node_signals["Market signals<br/>[signals.js]"]
  node_rewards["Points rewards<br/>[rewards.js]"]
end

subgraph group_operations["Administration and state"]
  node_auth["Authentication<br/>[auth.js]"]
  node_admin["Admin controls<br/>[admin.js]"]
  node_db["State service<br/>[db.js]"]
end

node_member(("Member"))
node_admin_user(("Administrator"))
node_storage[("Browser localStorage")]

node_member -->|"uses"| node_member_page
node_member_page -->|"loads"| node_app
node_admin_user -->|"uses"| node_admin_page_html
node_admin_page_html -->|"loads"| node_admin_ui
node_app -->|"calls"| node_auth
node_app -->|"reads"| node_db
node_auth -->|"reads and writes"| node_db
node_admin_ui -->|"calls"| node_admin
node_admin_ui -->|"reads and writes"| node_db
node_admin_ui -->|"calls"| node_auth
node_admin -->|"reads and writes"| node_db
node_admin -->|"calls"| node_plans
node_plans -->|"reads and writes"| node_db
node_payment -->|"reads and writes"| node_db
node_affiliate -->|"reads and writes"| node_db
node_signals -->|"checks market"| node_plans
node_signals -->|"reads and writes"| node_db
node_rewards -->|"reads and writes"| node_db
node_db -->|"persists state"| node_storage

click node_member_page "https://github.com/ijoben/invest/blob/main/index.html"
click node_admin_page_html "https://github.com/ijoben/invest/blob/main/admin.html"
click node_app "https://github.com/ijoben/invest/blob/main/js/app.js"
click node_admin_ui "https://github.com/ijoben/invest/blob/main/js/admin-page.js"
click node_auth "https://github.com/ijoben/invest/blob/main/js/auth.js"
click node_plans "https://github.com/ijoben/invest/blob/main/js/plans.js"
click node_payment "https://github.com/ijoben/invest/blob/main/js/payment.js"
click node_affiliate "https://github.com/ijoben/invest/blob/main/js/affiliate.js"
click node_signals "https://github.com/ijoben/invest/blob/main/js/signals.js"
click node_rewards "https://github.com/ijoben/invest/blob/main/js/rewards.js"
click node_admin "https://github.com/ijoben/invest/blob/main/js/admin.js"
click node_db "https://github.com/ijoben/invest/blob/main/js/db.js"

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_member_page,node_admin_page_html,node_app,node_admin_ui toneBlue
class node_plans,node_payment,node_storage toneAmber
class node_affiliate,node_signals,node_rewards toneMint
class node_auth,node_admin,node_db toneRose
class node_member,node_admin_user toneIndigo
```

## Components

### Web interfaces

- [Member interface](https://github.com/ijoben/invest/blob/main/index.html): `index.html`
- [Admin interface](https://github.com/ijoben/invest/blob/main/admin.html): `admin.html`
- [App controller](https://github.com/ijoben/invest/blob/main/js/app.js): `js/app.js`
- [Admin controller](https://github.com/ijoben/invest/blob/main/js/admin-page.js): `js/admin-page.js`

### Investment and payments

- [Investment plans](https://github.com/ijoben/invest/blob/main/js/plans.js): `js/plans.js`
- [Payments](https://github.com/ijoben/invest/blob/main/js/payment.js): `js/payment.js`

### Member features

- [Affiliate engine](https://github.com/ijoben/invest/blob/main/js/affiliate.js): `js/affiliate.js`
- [Market signals](https://github.com/ijoben/invest/blob/main/js/signals.js): `js/signals.js`
- [Points rewards](https://github.com/ijoben/invest/blob/main/js/rewards.js): `js/rewards.js`

### Administration and state

- [Authentication](https://github.com/ijoben/invest/blob/main/js/auth.js): `js/auth.js`
- [Admin controls](https://github.com/ijoben/invest/blob/main/js/admin.js): `js/admin.js`
- [State service](https://github.com/ijoben/invest/blob/main/js/db.js): `js/db.js`

### Other components

- **Member**
- **Administrator**
- **Browser localStorage**

## Connections

- Member → Member interface: uses
- Member interface → App controller: loads
- Administrator → Admin interface: uses
- Admin interface → Admin controller: loads
- App controller → Authentication: calls
- App controller → State service: reads
- Authentication → State service: reads and writes
- Admin controller → Admin controls: calls
- Admin controller → State service: reads and writes
- Admin controller → Authentication: calls
- Admin controls → State service: reads and writes
- Admin controls → Investment plans: calls
- Investment plans → State service: reads and writes
- Payments → State service: reads and writes
- Affiliate engine → State service: reads and writes
- Market signals → Investment plans: checks market
- Market signals → State service: reads and writes
- Points rewards → State service: reads and writes
- State service → Browser localStorage: persists state
