# shaurya-singh6352/traceit architecture

> Architecture diagram of the GitHub repository shaurya-singh6352/traceit, 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/shaurya-singh6352/traceit
- Repository: https://github.com/shaurya-singh6352/traceit

## Overview

TraceIt is a campus lost-and-found mobile app. A user signs in, browses a live feed of lost or found posts, filters or searches it, and can report an item with an optional photo. They can open a post to view details and contact the poster, or resolve/reopen their own post; My Posts supports tracking their reports. The README documents the Flutter screens, Provider-injected services, and Firebase responsibilities. Native platform files and unsampled Dart implementations are not mapped beyond those documented responsibilities.

Main entry points: [`lib/services/firestore_service.dart`](https://github.com/shaurya-singh6352/traceit/blob/main/lib/services/firestore_service.dart) (Items data service), [`lib/screens/home_screen.dart`](https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/home_screen.dart) (Live feed and My Posts), [`lib/main.dart`](https://github.com/shaurya-singh6352/traceit/blob/main/lib/main.dart) (App entry and routing), [`lib/screens/post_item_screen.dart`](https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/post_item_screen.dart) (Report item)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_main["App entry and routing<br/>[main.dart]"]
  node_login["Email login<br/>[login_screen.dart]"]
  node_theme["Material design system<br/>[app_theme.dart]"]
end

subgraph group_discovery["Browse and report"]
  node_home["Live feed and My Posts<br/>[home_screen.dart]"]
  node_post["Report item"]
  node_detail["Item details and resolve"]
  node_item_card["Notice card<br/>[item_card.dart]"]
  node_status_toggle["Lost/Found toggle<br/>[status_toggle.dart]"]
  node_empty_state["Empty and error state<br/>[empty_state.dart]"]
end

subgraph group_data["Domain and data"]
  node_item_model["Item and status model<br/>[item_model.dart]"]
end

subgraph group_services["Firebase services"]
  node_auth["Auth service<br/>[auth_service.dart]"]
  node_firebase_auth["Firebase Auth"]
  node_firestore_service["Items data service"]
  node_firestore[("Cloud Firestore")]
  node_storage_service["Image storage service"]
  node_cloud_storage["Firebase Storage"]
end

node_user(("Campus user"))

node_user -->|"opens app"| node_main
node_main -->|"initializes Firebase"| node_firebase_auth
node_main -->|"routes by auth"| node_login
node_user -->|"signs in"| node_login
node_login -->|"authenticates"| node_auth
node_auth -->|"calls"| node_firebase_auth
node_user -->|"browses posts"| node_home
node_home -->|"requests feed and My Posts"| node_firestore_service
node_home -->|"selects status"| node_status_toggle
node_home -->|"renders posts"| node_item_card
node_home -->|"shows empty or error"| node_empty_state
node_user -->|"reports item"| node_post
node_post -->|"creates post"| node_firestore_service
node_post -->|"uploads photo"| node_storage_service
node_user -->|"opens post"| node_detail
node_detail -->|"loads and resolves post"| node_firestore_service
node_detail -->|"uses poster contact"| node_auth
node_firestore_service -->|"queries and writes"| node_firestore
node_firestore -->|"streams item data"| node_firestore_service
node_firestore_service -->|"maps item data"| node_item_model
node_storage_service -->|"uploads and deletes images"| node_cloud_storage
node_theme -->|"styles app"| node_main

click node_main "https://github.com/shaurya-singh6352/traceit/blob/main/lib/main.dart"
click node_login "https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/login_screen.dart"
click node_auth "https://github.com/shaurya-singh6352/traceit/blob/main/lib/services/auth_service.dart"
click node_home "https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/home_screen.dart"
click node_post "https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/post_item_screen.dart"
click node_detail "https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/item_detail_screen.dart"
click node_item_card "https://github.com/shaurya-singh6352/traceit/blob/main/lib/widgets/item_card.dart"
click node_status_toggle "https://github.com/shaurya-singh6352/traceit/blob/main/lib/widgets/status_toggle.dart"
click node_empty_state "https://github.com/shaurya-singh6352/traceit/blob/main/lib/widgets/empty_state.dart"
click node_theme "https://github.com/shaurya-singh6352/traceit/blob/main/lib/theme/app_theme.dart"
click node_item_model "https://github.com/shaurya-singh6352/traceit/blob/main/lib/models/item_model.dart"
click node_firestore_service "https://github.com/shaurya-singh6352/traceit/blob/main/lib/services/firestore_service.dart"
click node_storage_service "https://github.com/shaurya-singh6352/traceit/blob/main/lib/services/storage_service.dart"

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_main,node_login,node_theme,node_user toneBlue
class node_home,node_post,node_detail,node_item_card,node_status_toggle,node_empty_state toneAmber
class node_item_model toneMint
class node_auth,node_firebase_auth,node_firestore_service,node_firestore,node_storage_service,node_cloud_storage toneRose
```

## Components

### App and access

- [App entry and routing](https://github.com/shaurya-singh6352/traceit/blob/main/lib/main.dart): `lib/main.dart`
- [Email login](https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/login_screen.dart): `lib/screens/login_screen.dart`
- [Material design system](https://github.com/shaurya-singh6352/traceit/blob/main/lib/theme/app_theme.dart): `lib/theme/app_theme.dart`

### Browse and report

- [Live feed and My Posts](https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Report item](https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/post_item_screen.dart): `lib/screens/post_item_screen.dart`
- [Item details and resolve](https://github.com/shaurya-singh6352/traceit/blob/main/lib/screens/item_detail_screen.dart): `lib/screens/item_detail_screen.dart`
- [Notice card](https://github.com/shaurya-singh6352/traceit/blob/main/lib/widgets/item_card.dart): `lib/widgets/item_card.dart`
- [Lost/Found toggle](https://github.com/shaurya-singh6352/traceit/blob/main/lib/widgets/status_toggle.dart): `lib/widgets/status_toggle.dart`
- [Empty and error state](https://github.com/shaurya-singh6352/traceit/blob/main/lib/widgets/empty_state.dart): `lib/widgets/empty_state.dart`

### Domain and data

- [Item and status model](https://github.com/shaurya-singh6352/traceit/blob/main/lib/models/item_model.dart): `lib/models/item_model.dart`

### Firebase services

- [Auth service](https://github.com/shaurya-singh6352/traceit/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`
- **Firebase Auth**
- [Items data service](https://github.com/shaurya-singh6352/traceit/blob/main/lib/services/firestore_service.dart): `lib/services/firestore_service.dart`
- **Cloud Firestore**
- [Image storage service](https://github.com/shaurya-singh6352/traceit/blob/main/lib/services/storage_service.dart): `lib/services/storage_service.dart`
- **Firebase Storage**

### Other components

- **Campus user**

## Connections

- Campus user → App entry and routing: opens app
- App entry and routing → Firebase Auth: initializes Firebase
- App entry and routing → Email login: routes by auth
- Campus user → Email login: signs in
- Email login → Auth service: authenticates
- Auth service → Firebase Auth: calls
- Campus user → Live feed and My Posts: browses posts
- Live feed and My Posts → Items data service: requests feed and My Posts
- Live feed and My Posts → Lost/Found toggle: selects status
- Live feed and My Posts → Notice card: renders posts
- Live feed and My Posts → Empty and error state: shows empty or error
- Campus user → Report item: reports item
- Report item → Items data service: creates post
- Report item → Image storage service: uploads photo
- Campus user → Item details and resolve: opens post
- Item details and resolve → Items data service: loads and resolves post
- Item details and resolve → Auth service: uses poster contact
- Items data service → Cloud Firestore: queries and writes
- Cloud Firestore → Items data service: streams item data
- Items data service → Item and status model: maps item data
- Image storage service → Firebase Storage: uploads and deletes images
- Material design system → App entry and routing: styles app
