# cmput301w26canopy/canopy-insights architecture

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

- Interactive diagram: https://gitdiagram.com/cmput301w26canopy/canopy-insights
- Repository: https://github.com/cmput301w26canopy/canopy-insights

## Overview

Canopy Insights is an Android event-lottery app. Its documented user journey is account sign-up/login, event entry, selection through an organizer-defined lottery, and accepting or declining an invitation. The tree also shows distinct UI and domain components for event creation, applicant management, history, maps, QR codes, comments, and notifications; these are included as capabilities, but their runtime wiring cannot be verified from the supplied source excerpts. Firestore is the documented persistence service.

Main entry points: [`code/app/src/main/java/com/example/lotteryapp/OrganizerActivity.java`](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/OrganizerActivity.java) (Organizer controls), [`code/app/src/main/java/com/example/lotteryapp/ui/login/LoginFragment.java`](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ui/login/LoginFragment.java) (Sign in), [`code/app/src/main/java/com/example/lotteryapp/MainActivity.java`](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/MainActivity.java) (Event browsing), [`code/app/src/main/java/com/example/lotteryapp/CreateEventActivity.java`](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/CreateEventActivity.java) (Event creation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_login["Sign in<br/>[LoginFragment.java]"]
  node_signup["Sign up"]
  node_profile["Account profile"]
end

subgraph group_events["Event Lottery"]
  node_event_browse["Event browsing<br/>[MainActivity.java]"]
  node_event_create["Event creation"]
  node_event_detail["Event details<br/>[EventActivity.java]"]
  node_lottery_rules["Lottery rules"]
  node_organizer["Organizer controls"]
  node_applicants["Applicant management"]
  node_history["Event history"]
end

subgraph group_engagement["User Engagement"]
  node_inbox["Invitation inbox<br/>[InboxFragment.java]"]
  node_notifications["Notifications"]
  node_comments["Event comments"]
  node_location["Event map<br/>[MapActivity.java]"]
  node_qr["QR scanning"]
end

subgraph group_platform["Data and Services"]
  node_firestore[("Cloud Firestore")]
  node_firestore_helper["Firestore access"]
end

node_user(("App user"))

node_user -->|"signs in"| node_login
node_user -->|"creates account"| node_signup
node_user -->|"enters lottery"| node_event_browse
node_organizer -->|"sets specifications"| node_event_create
node_event_create -.->|"defines selection"| node_lottery_rules
node_organizer -.->|"manages applicants"| node_applicants
node_event_browse -.->|"opens event"| node_event_detail
node_event_detail -.->|"receives invitation"| node_inbox
node_inbox -->|"accepts or declines"| node_user
node_login -.->|"loads account"| node_firestore_helper
node_firestore_helper -->|"reads and writes"| node_firestore

click node_login "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ui/login/LoginFragment.java"
click node_signup "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ui/login/SignUpFragment.java"
click node_profile "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ProfileActivity.java"
click node_event_browse "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/MainActivity.java"
click node_event_create "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/CreateEventActivity.java"
click node_event_detail "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/EventActivity.java"
click node_lottery_rules "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/EventFlowRules.java"
click node_organizer "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/OrganizerActivity.java"
click node_applicants "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ApplicantsActivity.java"
click node_history "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/HistoryActivity.java"
click node_inbox "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/InboxFragment.java"
click node_notifications "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/NotificationHelper.java"
click node_comments "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/CommentsFragment.java"
click node_location "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/MapActivity.java"
click node_qr "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/QRScannerActivity.java"
click node_firestore_helper "https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/FirestoreHelper.java"

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_signup,node_profile,node_user toneBlue
class node_event_browse,node_event_create,node_event_detail,node_lottery_rules,node_organizer,node_applicants,node_history toneAmber
class node_inbox,node_notifications,node_comments,node_location,node_qr toneMint
class node_firestore,node_firestore_helper toneRose
```

## Components

### Accounts

- [Sign in](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ui/login/LoginFragment.java): `code/app/src/main/java/com/example/lotteryapp/ui/login/LoginFragment.java`
- [Sign up](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ui/login/SignUpFragment.java): `code/app/src/main/java/com/example/lotteryapp/ui/login/SignUpFragment.java`
- [Account profile](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ProfileActivity.java): `code/app/src/main/java/com/example/lotteryapp/ProfileActivity.java`

### Event Lottery

- [Event browsing](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/MainActivity.java): `code/app/src/main/java/com/example/lotteryapp/MainActivity.java`
- [Event creation](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/CreateEventActivity.java): `code/app/src/main/java/com/example/lotteryapp/CreateEventActivity.java`
- [Event details](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/EventActivity.java): `code/app/src/main/java/com/example/lotteryapp/EventActivity.java`
- [Lottery rules](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/EventFlowRules.java): `code/app/src/main/java/com/example/lotteryapp/EventFlowRules.java`
- [Organizer controls](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/OrganizerActivity.java): `code/app/src/main/java/com/example/lotteryapp/OrganizerActivity.java`
- [Applicant management](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/ApplicantsActivity.java): `code/app/src/main/java/com/example/lotteryapp/ApplicantsActivity.java`
- [Event history](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/HistoryActivity.java): `code/app/src/main/java/com/example/lotteryapp/HistoryActivity.java`

### User Engagement

- [Invitation inbox](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/InboxFragment.java): `code/app/src/main/java/com/example/lotteryapp/InboxFragment.java`
- [Notifications](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/NotificationHelper.java): `code/app/src/main/java/com/example/lotteryapp/NotificationHelper.java`
- [Event comments](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/CommentsFragment.java): `code/app/src/main/java/com/example/lotteryapp/CommentsFragment.java`
- [Event map](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/MapActivity.java): `code/app/src/main/java/com/example/lotteryapp/MapActivity.java`
- [QR scanning](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/QRScannerActivity.java): `code/app/src/main/java/com/example/lotteryapp/QRScannerActivity.java`

### Data and Services

- **Cloud Firestore**
- [Firestore access](https://github.com/cmput301w26canopy/canopy-insights/blob/main/code/app/src/main/java/com/example/lotteryapp/FirestoreHelper.java): `code/app/src/main/java/com/example/lotteryapp/FirestoreHelper.java`

### Other components

- **App user**

## Connections

- App user → Sign in: signs in (evidence: `README.md`)
- App user → Sign up: creates account (evidence: `README.md`)
- App user → Event browsing: enters lottery (evidence: `README.md`)
- Organizer controls → Event creation: sets specifications (evidence: `README.md`)
- Event creation → Lottery rules: defines selection
- Organizer controls → Applicant management: manages applicants
- Event browsing → Event details: opens event
- Event details → Invitation inbox: receives invitation
- Invitation inbox → App user: accepts or declines (evidence: `README.md`)
- Sign in → Firestore access: loads account
- Firestore access → Cloud Firestore: reads and writes (evidence: `README.md`)
