# casullamichaeljoe-cloud/ecoop architecture

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

- Interactive diagram: https://gitdiagram.com/casullamichaeljoe-cloud/ecoop
- Repository: https://github.com/casullamichaeljoe-cloud/ecoop

## Overview

E-COOP is a Laravel cooperative-management application with admin, staff, member, treasurer, committee, and kiosk workflows. Members and staff interact through role-specific controllers and views; operational records support savings, lending, POS/inventory, elections, and cooperative finance, while administrators manage approvals, reports, and settings. The README documents the broader lifecycle capabilities; sampled code confirms selected finance, login, notifications, POS approval, member, and voting interactions. Other feature links reflect documented capabilities and tree structure; unsampled internal wiring is not asserted.

Main entry points: [`app/Models`](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Models) (Domain records), [`app/Http/Controllers/Staff`](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Staff) (Staff portal), [`app/Http/Controllers/Auth/LoginController.php`](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Auth/LoginController.php) (Login), [`app/Http/Controllers/Admin`](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Admin) (Admin portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and portals"]
  node_login["Login"]
  node_user_records["User records<br/>[User.php]"]
  node_admin["Admin portal"]
  node_staff["Staff portal"]
  node_member_portal["Member portal"]
end

subgraph group_operations["Member operations"]
  node_member_records["Member and account records"]
  node_loan_processing["Loan processing"]
  node_savings_interest["Savings and interest"]
  node_pos["POS and inventory<br/>[PosController.php]"]
  node_pos_approval["POS approval"]
end

subgraph group_finance["Cooperative finance"]
  node_finance_controller["Finance management"]
  node_finance_engine["Finance rules"]
  node_distribution["Year-end distribution"]
end

subgraph group_elections["Elections"]
  node_election_admin["Election administration"]
  node_member_ballot["Member ballot"]
  node_kiosk["Voting kiosk"]
  node_election_results["Election results"]
end

subgraph group_platform["Shared platform"]
  node_notifications["Notifications"]
  node_announcements["Announcements"]
  node_audit["Audit logging<br/>[AuditLogger.php]"]
  node_models["Domain records"]
  node_database[("Supabase PostgreSQL")]
end

node_people(("Cooperative users"))

node_people -->|"sign in"| node_login
node_login -->|"looks up"| node_user_records
node_people -->|"manage"| node_admin
node_people -->|"operate"| node_staff
node_people -->|"access"| node_member_portal
node_staff -->|"maintains"| node_member_records
node_staff -->|"processes"| node_loan_processing
node_staff -->|"records activity"| node_savings_interest
node_staff -->|"records sales"| node_pos
node_pos_approval -->|"updates sale"| node_models
node_pos_approval -->|"notifies"| node_notifications
node_member_portal -->|"views accounts"| node_member_records
node_admin -->|"manages finance"| node_finance_controller
node_finance_controller -->|"calculates"| node_finance_engine
node_finance_controller -->|"reads records"| node_models
node_finance_engine -->|"reads rules"| node_models
node_distribution -->|"calculates shares"| node_finance_engine
node_admin -->|"configures elections"| node_election_admin
node_member_ballot -->|"records ballots"| node_models
node_kiosk -->|"records ballots"| node_models
node_election_results -->|"reads votes"| node_models
node_announcements -->|"publishes alerts"| node_notifications
node_login -->|"records activity"| node_audit
node_models -->|"persists records"| node_database

click node_login "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Auth/LoginController.php"
click node_user_records "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Models/User.php"
click node_admin "https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Admin"
click node_staff "https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Staff"
click node_member_portal "https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Member"
click node_member_records "https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Models"
click node_loan_processing "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/LoanProcessingService.php"
click node_savings_interest "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/SavingsInterestService.php"
click node_pos "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Staff/PosController.php"
click node_pos_approval "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Treasurer/PosApprovalController.php"
click node_finance_controller "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/FinanceController.php"
click node_finance_engine "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/FinanceRuleEngine.php"
click node_distribution "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Console/Commands/ComputeYearEndDistribution.php"
click node_election_admin "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/VotingController.php"
click node_member_ballot "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Member/VotingBallotController.php"
click node_kiosk "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Kiosk/VotingKioskController.php"
click node_election_results "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/VotingResultController.php"
click node_notifications "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Api/NotificationController.php"
click node_announcements "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/AnnouncementController.php"
click node_audit "https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/AuditLogger.php"
click node_models "https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Models"

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_login,node_user_records,node_admin,node_staff,node_member_portal,node_people toneBlue
class node_member_records,node_loan_processing,node_savings_interest,node_pos,node_pos_approval toneAmber
class node_finance_controller,node_finance_engine,node_distribution toneMint
class node_election_admin,node_member_ballot,node_kiosk,node_election_results toneRose
class node_notifications,node_announcements,node_audit,node_models,node_database toneIndigo
```

## Components

### Access and portals

- [Login](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [User records](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Models/User.php): `app/Models/User.php`
- [Admin portal](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Admin): `app/Http/Controllers/Admin`
- [Staff portal](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Staff): `app/Http/Controllers/Staff`
- [Member portal](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Http/Controllers/Member): `app/Http/Controllers/Member`

### Member operations

- [Member and account records](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Models): `app/Models`
- [Loan processing](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/LoanProcessingService.php): `app/Services/LoanProcessingService.php`
- [Savings and interest](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/SavingsInterestService.php): `app/Services/SavingsInterestService.php`
- [POS and inventory](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Staff/PosController.php): `app/Http/Controllers/Staff/PosController.php`
- [POS approval](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Treasurer/PosApprovalController.php): `app/Http/Controllers/Treasurer/PosApprovalController.php`

### Cooperative finance

- [Finance management](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/FinanceController.php): `app/Http/Controllers/Admin/FinanceController.php`
- [Finance rules](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/FinanceRuleEngine.php): `app/Services/FinanceRuleEngine.php`
- [Year-end distribution](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Console/Commands/ComputeYearEndDistribution.php): `app/Console/Commands/ComputeYearEndDistribution.php`

### Elections

- [Election administration](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/VotingController.php): `app/Http/Controllers/Admin/VotingController.php`
- [Member ballot](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Member/VotingBallotController.php): `app/Http/Controllers/Member/VotingBallotController.php`
- [Voting kiosk](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Kiosk/VotingKioskController.php): `app/Http/Controllers/Kiosk/VotingKioskController.php`
- [Election results](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/VotingResultController.php): `app/Http/Controllers/Admin/VotingResultController.php`

### Shared platform

- [Notifications](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Api/NotificationController.php): `app/Http/Controllers/Api/NotificationController.php`
- [Announcements](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Http/Controllers/Admin/AnnouncementController.php): `app/Http/Controllers/Admin/AnnouncementController.php`
- [Audit logging](https://github.com/casullamichaeljoe-cloud/ecoop/blob/main/app/Services/AuditLogger.php): `app/Services/AuditLogger.php`
- [Domain records](https://github.com/casullamichaeljoe-cloud/ecoop/tree/main/app/Models): `app/Models`
- **Supabase PostgreSQL**

### Other components

- **Cooperative users**

## Connections

- Cooperative users → Login: sign in
- Login → User records: looks up
- Cooperative users → Admin portal: manage
- Cooperative users → Staff portal: operate
- Cooperative users → Member portal: access
- Staff portal → Member and account records: maintains
- Staff portal → Loan processing: processes
- Staff portal → Savings and interest: records activity
- Staff portal → POS and inventory: records sales
- POS approval → Domain records: updates sale
- POS approval → Notifications: notifies
- Member portal → Member and account records: views accounts
- Admin portal → Finance management: manages finance
- Finance management → Finance rules: calculates
- Finance management → Domain records: reads records
- Finance rules → Domain records: reads rules
- Year-end distribution → Finance rules: calculates shares
- Admin portal → Election administration: configures elections
- Member ballot → Domain records: records ballots
- Voting kiosk → Domain records: records ballots
- Election results → Domain records: reads votes
- Announcements → Notifications: publishes alerts
- Login → Audit logging: records activity
- Domain records → Supabase PostgreSQL: persists records
