# kanahayameilia/reuseid architecture

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

- Interactive diagram: https://gitdiagram.com/kanahayameilia/reuseid
- Repository: https://github.com/kanahayameilia/reuseid

## Overview

Re:Use.ID is a student-focused barter and donation marketplace for reusable goods in Magelang. The main journey is account access, posting a photographed item with a map location, browsing and viewing listings, then arranging an exchange or donation through chat and transaction status; users can also report content and manage their profile. Admin pages provide moderation and operational dashboards. The graph reflects documented capabilities as well as sampled calls; some feature links are documented only in the README, and unsampled implementations are not inferred beyond their directory paths.

Main entry points: [`js/upload.js`](https://github.com/kanahayameilia/reuseid/blob/main/js/upload.js) (Create listing), [`js/browse.js`](https://github.com/kanahayameilia/reuseid/blob/main/js/browse.js) (Browse listings), [`js/detail.js`](https://github.com/kanahayameilia/reuseid/blob/main/js/detail.js) (Listing detail), [`js/admin.js`](https://github.com/kanahayameilia/reuseid/blob/main/js/admin.js) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and account"]
  node_auth["Auth and campus gate<br/>[auth.js]"]
  node_login["Sign-in<br/>[login.js]"]
  node_signup["Registration<br/>[signup.js]"]
  node_profile["Profile and history<br/>[profile.js]"]
end

subgraph group_marketplace["Marketplace listings"]
  node_browse["Browse listings<br/>[browse.js]"]
  node_detail["Listing detail<br/>[detail.js]"]
  node_upload["Create listing<br/>[upload.js]"]
  node_edit["Edit listing<br/>[edit.js]"]
  node_map["Location picker<br/>[map-picker.js]"]
  node_imagefilter["Photo screening<br/>[image-filter.js]"]
  node_geo["Distance lookup<br/>[geo.js]"]
end

subgraph group_exchange["Exchange and trust"]
  node_chat["Chat and exchange<br/>[chat.js]"]
  node_reviews["Ratings and reviews"]
  node_report["User reports<br/>[report.js]"]
  node_myreports["My reports<br/>[my-reports.js]"]
  node_notifications["Notifications<br/>[notifications.js]"]
end

subgraph group_operations["Admin operations"]
  node_admin["Admin dashboard<br/>[admin.js]"]
  node_adminpages["Admin management pages<br/>[admin-pages.js]"]
end

subgraph group_shared["Shared services"]
  node_terms["Terms and conditions<br/>[terms.js]"]
  node_supabaseclient["Supabase client<br/>[supabase-client.js]"]
end

node_student(("Student"))
node_supabase[("Supabase services")]
node_mapservices["Map and geocoding"]

node_student -->|"signs in"| node_login
node_student -->|"registers"| node_signup
node_login -->|"authenticates"| node_auth
node_signup -->|"creates account"| node_auth
node_auth -->|"uses session"| node_supabaseclient
node_supabaseclient -->|"connects"| node_supabase
node_student -->|"posts item"| node_upload
node_upload -->|"selects location"| node_map
node_upload -->|"checks photos"| node_imagefilter
node_upload -->|"stores listing"| node_supabase
node_edit -->|"selects location"| node_map
node_edit -->|"checks photos"| node_imagefilter
node_student -->|"searches items"| node_browse
node_browse -->|"reads listings"| node_supabase
node_browse -->|"computes distance"| node_geo
node_student -->|"views listing"| node_detail
node_detail -->|"reads item data"| node_supabase
node_detail -->|"starts conversation"| node_chat
node_student -->|"arranges exchange"| node_chat
node_chat -->|"stores messages and transactions"| node_supabase
node_student -->|"manages account"| node_profile
node_profile -->|"reads account and history"| node_supabase
node_student -->|"rates exchange"| node_reviews
node_student -->|"reports issue"| node_report
node_report -.->|"submits report"| node_supabase
node_student -.->|"checks reports"| node_myreports
node_student -.->|"receives updates"| node_notifications
node_student -->|"reads terms"| node_terms
node_student -->|"administers platform"| node_admin
node_admin -->|"loads admin pages"| node_adminpages
node_admin -->|"requests dashboard data"| node_supabase
node_adminpages -->|"manages records"| node_supabase
node_map -->|"geocodes location"| node_mapservices

click node_auth "https://github.com/kanahayameilia/reuseid/blob/main/js/auth.js"
click node_login "https://github.com/kanahayameilia/reuseid/blob/main/js/login.js"
click node_signup "https://github.com/kanahayameilia/reuseid/blob/main/js/signup.js"
click node_profile "https://github.com/kanahayameilia/reuseid/blob/main/js/profile.js"
click node_browse "https://github.com/kanahayameilia/reuseid/blob/main/js/browse.js"
click node_detail "https://github.com/kanahayameilia/reuseid/blob/main/js/detail.js"
click node_upload "https://github.com/kanahayameilia/reuseid/blob/main/js/upload.js"
click node_edit "https://github.com/kanahayameilia/reuseid/blob/main/js/edit.js"
click node_map "https://github.com/kanahayameilia/reuseid/blob/main/js/map-picker.js"
click node_imagefilter "https://github.com/kanahayameilia/reuseid/blob/main/js/image-filter.js"
click node_geo "https://github.com/kanahayameilia/reuseid/blob/main/js/geo.js"
click node_chat "https://github.com/kanahayameilia/reuseid/blob/main/js/chat.js"
click node_reviews "https://github.com/kanahayameilia/reuseid/tree/main/js"
click node_report "https://github.com/kanahayameilia/reuseid/blob/main/js/report.js"
click node_myreports "https://github.com/kanahayameilia/reuseid/blob/main/js/my-reports.js"
click node_notifications "https://github.com/kanahayameilia/reuseid/blob/main/js/notifications.js"
click node_admin "https://github.com/kanahayameilia/reuseid/blob/main/js/admin.js"
click node_adminpages "https://github.com/kanahayameilia/reuseid/blob/main/js/admin-pages.js"
click node_terms "https://github.com/kanahayameilia/reuseid/blob/main/js/terms.js"
click node_supabaseclient "https://github.com/kanahayameilia/reuseid/blob/main/js/supabase-client.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_auth,node_login,node_signup,node_profile toneBlue
class node_browse,node_detail,node_upload,node_edit,node_map,node_imagefilter,node_geo,node_supabase toneAmber
class node_chat,node_reviews,node_report,node_myreports,node_notifications toneMint
class node_admin,node_adminpages toneRose
class node_terms,node_supabaseclient,node_student,node_mapservices toneIndigo
```

## Components

### Identity and account

- [Auth and campus gate](https://github.com/kanahayameilia/reuseid/blob/main/js/auth.js): `js/auth.js`
- [Sign-in](https://github.com/kanahayameilia/reuseid/blob/main/js/login.js): `js/login.js`
- [Registration](https://github.com/kanahayameilia/reuseid/blob/main/js/signup.js): `js/signup.js`
- [Profile and history](https://github.com/kanahayameilia/reuseid/blob/main/js/profile.js): `js/profile.js`

### Marketplace listings

- [Browse listings](https://github.com/kanahayameilia/reuseid/blob/main/js/browse.js): `js/browse.js`
- [Listing detail](https://github.com/kanahayameilia/reuseid/blob/main/js/detail.js): `js/detail.js`
- [Create listing](https://github.com/kanahayameilia/reuseid/blob/main/js/upload.js): `js/upload.js`
- [Edit listing](https://github.com/kanahayameilia/reuseid/blob/main/js/edit.js): `js/edit.js`
- [Location picker](https://github.com/kanahayameilia/reuseid/blob/main/js/map-picker.js): `js/map-picker.js`
- [Photo screening](https://github.com/kanahayameilia/reuseid/blob/main/js/image-filter.js): `js/image-filter.js`
- [Distance lookup](https://github.com/kanahayameilia/reuseid/blob/main/js/geo.js): `js/geo.js`

### Exchange and trust

- [Chat and exchange](https://github.com/kanahayameilia/reuseid/blob/main/js/chat.js): `js/chat.js`
- [Ratings and reviews](https://github.com/kanahayameilia/reuseid/tree/main/js): `js`
- [User reports](https://github.com/kanahayameilia/reuseid/blob/main/js/report.js): `js/report.js`
- [My reports](https://github.com/kanahayameilia/reuseid/blob/main/js/my-reports.js): `js/my-reports.js`
- [Notifications](https://github.com/kanahayameilia/reuseid/blob/main/js/notifications.js): `js/notifications.js`

### Admin operations

- [Admin dashboard](https://github.com/kanahayameilia/reuseid/blob/main/js/admin.js): `js/admin.js`
- [Admin management pages](https://github.com/kanahayameilia/reuseid/blob/main/js/admin-pages.js): `js/admin-pages.js`

### Shared services

- [Terms and conditions](https://github.com/kanahayameilia/reuseid/blob/main/js/terms.js): `js/terms.js`
- [Supabase client](https://github.com/kanahayameilia/reuseid/blob/main/js/supabase-client.js): `js/supabase-client.js`

### Other components

- **Student**
- **Supabase services**
- **Map and geocoding**

## Connections

- Student → Sign-in: signs in (evidence: `README.md`)
- Student → Registration: registers (evidence: `README.md`)
- Sign-in → Auth and campus gate: authenticates (evidence: `js/auth.js`)
- Registration → Auth and campus gate: creates account (evidence: `README.md`)
- Auth and campus gate → Supabase client: uses session (evidence: `js/auth.js`)
- Supabase client → Supabase services: connects (evidence: `js/supabase-client.js`)
- Student → Create listing: posts item (evidence: `README.md`)
- Create listing → Location picker: selects location (evidence: `js/upload.js`)
- Create listing → Photo screening: checks photos (evidence: `js/upload.js`)
- Create listing → Supabase services: stores listing (evidence: `js/upload.js`)
- Edit listing → Location picker: selects location (evidence: `js/edit.js`)
- Edit listing → Photo screening: checks photos (evidence: `js/edit.js`)
- Student → Browse listings: searches items (evidence: `README.md`)
- Browse listings → Supabase services: reads listings (evidence: `README.md`)
- Browse listings → Distance lookup: computes distance (evidence: `README.md`)
- Student → Listing detail: views listing (evidence: `README.md`)
- Listing detail → Supabase services: reads item data (evidence: `js/detail.js`)
- Listing detail → Chat and exchange: starts conversation (evidence: `js/detail.js`)
- Student → Chat and exchange: arranges exchange (evidence: `README.md`)
- Chat and exchange → Supabase services: stores messages and transactions (evidence: `js/chat.js`)
- Student → Profile and history: manages account (evidence: `README.md`)
- Profile and history → Supabase services: reads account and history (evidence: `js/profile.js`)
- Student → Ratings and reviews: rates exchange (evidence: `README.md`)
- Student → User reports: reports issue (evidence: `README.md`)
- User reports → Supabase services: submits report
- Student → My reports: checks reports
- Student → Notifications: receives updates
- Student → Terms and conditions: reads terms (evidence: `js/terms.js`)
- Student → Admin dashboard: administers platform (evidence: `README.md`)
- Admin dashboard → Admin management pages: loads admin pages (evidence: `js/admin-pages.js`)
- Admin dashboard → Supabase services: requests dashboard data (evidence: `js/admin.js`)
- Admin management pages → Supabase services: manages records (evidence: `js/admin-pages.js`)
- Location picker → Map and geocoding: geocodes location (evidence: `js/map-picker.js`)
