# tanim494/iiuc-pedia architecture

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

- Interactive diagram: https://gitdiagram.com/tanim494/iiuc-pedia
- Repository: https://github.com/tanim494/iiuc-pedia

## Overview

1. **Project shape**
   - This is a single-module Android app written in **Java**: `app/` contains all runtime code, UI, resources, and Firebase configuration. There is no separate backend repo in this tree; the app talks directly to Firebase services.

2. **App entry and session flow**
   - The user journey starts around `LoadingActivity`, then branches into `LoginActivity` / `RegisterActivity` or into the main app if already authenticated.
   - `MainActivity` is the shell that likely hosts the primary navigation and swaps the core fragments.

3. **Primary navigation layer**
   - The app is fragment-driven rather than screen-per-feature. Core user-facing sections include `HomeFragment`, `StudentPortalFragment`, `ResourcesFragment`, `FacultyFragment`, `ProfileFragment`, and `DeveloperFragment`.
   - `activity_main.xml` and `bottom_navigation.xml` indicate a bottom-tab style navigation container.

4. **Academic resource subsystem**
   - The main product value is structured academic content: `Course`, `Semester`, `DriveLink`, `FileItem`, and related adapters/fragments suggest a hierarchy of **department → semester → batch/course → resource files/links**.
   - Screens such as `BatchWiseFragment`, `CourseListFragment`, `SemesterResources`, `ResourcesFragment`, `DriveLinksFragment`, and `FileListFragment` are the content discovery path.

5. **Content delivery and viewers**
   - Files are presented through specialized viewers: `PdfViewerFragment` for PDF reading and `WebFragment` for embedded web content/links.
   - `FileAdapter`, `DriveLinkAdapter`, `DriveLinkItemAdapter`, and `CourseAdapter` render lists/cards for resource browsing.
   - The presence of `UploadFileFragment` implies admins can add downloadable materials that are then surfaced to students.

6. **Community and messaging**
   - The in-app discussion area is centered on `CommunityActivity`, `CommunityMessage`, `Message`, `Notice`, and their adapters.
   - `CommunityChatAdapter`, `MessageAdapter`, and `NoticeAdapter` indicate two content types: conversational chat and announcement/notices.
   - `MyFirebaseMessagingService` shows push notification support for incoming updates.

7. **Admin/control plane**
   - The app includes a sizeable admin surface: `AdminFragment` plus specialized fragments for config, bus schedules, faculty import, links, batch links, user lists, and messages/notices.
   - Files like `AdminConfigFragment`, `AdminUserListFragment`, `ManageMessagesNoticesFragment`, and `ManageBusSchedule` suggest role-based in-app moderation and content management rather than an external CMS.

8. **Operational/configuration data**
   - `UserData`, `UserListModel`, and `ViewTracker` show that the app tracks user accounts and content usage.
   - `AdminConfigFragment` and the config-related model classes imply runtime feature/content settings are stored in Firebase and read dynamically by the client.

9. **Backend boundaries**
   - The architecture is Firebase-centered: `google-services.json` plus the README point to **Firebase Auth** for login, **Firestore** for structured content and chat data, and **Firebase Storage** for uploaded/downloadable files.
   - `MyFirebaseMessagingService` adds Firebase Cloud Messaging as a notification boundary.
   - There is no custom server code in the repository; the Android client is the full application front end.

10. **Department and legacy structure**
   - The README notes a migration from a single-department “CCE Pedia” model to a multi-department “IIUC Pedia” model.
   - `DepartmentRepository` and the presence of department-specific resources imply a shared app with departmental partitioning, not a separate app per department.

11. **UI implementation style**
   - The UI is built with standard Android widgets and RecyclerViews, using many list/card adapters for each data type.
   - The `res/layout` and `res/drawable` trees show custom reusable UI components for messages, notices, files, links, and navigation icons.

12. **Auxiliary feature surfaces**
   - `AIChatActivity` adds an assistant/chatbot entry point separate from the student portal and community chat.
   - `BusScheduleFragment` / `ManageBusSchedule` and `FacultyFragment` / `FacultyAdapter` show that the app bundles non-resource campus information alongside study materials.

13. **Important diagram boundaries**
   - A useful architecture diagram would separate: **authentication/session**, **student content browsing**, **file/link viewing**, **community chat/notifications**, and **admin management**.
   - The external service boundary should show Firebase Auth, Firestore, Storage, and FCM as the only major infrastructure dependencies.

Main entry points: [`app/src/main/res/menu/bottom_navigation.xml`](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/res/menu/bottom_navigation.xml) (Bottom Nav), [`app/src/main/java/com/tanim/ccepedia/AdminFragment.java`](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/AdminFragment.java) (Admin), [`app/src/main/java/com/tanim/ccepedia/ResourcesFragment.java`](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/ResourcesFragment.java) (Resources), [`app/src/main/java/com/tanim/ccepedia/CourseListFragment.java`](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/CourseListFragment.java) (Course List)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_entry["Session & Shell"]
  node_n_loading(("Loading<br/>entry activity"))
  node_n_login(("Login<br/>auth activity<br/>[LoginActivity.java]"))
  node_n_register(("Register<br/>auth activity"))
  node_n_main(("Main Shell<br/>host activity<br/>[MainActivity.java]"))
  node_n_bottom_nav["Bottom Nav<br/>ui menu"]
  node_n_profile["Profile"]
end

subgraph group_g_content["Academic Content"]
  node_n_home["Home<br/>dashboard fragment<br/>[HomeFragment.java]"]
  node_n_student_portal["Student Portal<br/>portal fragment"]
  node_n_resources["Resources<br/>browse fragment"]
  node_n_batch["Batch Wise<br/>browse fragment"]
  node_n_semester["Semester<br/>browse fragment"]
  node_n_course_list["Course List<br/>browse fragment"]
  node_n_drive_links["Drive Links<br/>link fragment"]
  node_n_file_list["File List<br/>file fragment"]
  node_n_pdf["PDF Viewer<br/>viewer fragment"]
  node_n_web["Web View<br/>viewer fragment<br/>[WebFragment.java]"]
  node_n_department_repo["Departments"]
end

subgraph group_g_community["Community"]
  node_n_community(("Community<br/>chat activity"))
  node_n_messaging(("Push Service<br/>firebase messaging"))
end

subgraph group_g_admin["Admin Tools"]
  node_n_admin["Admin<br/>control fragment<br/>[AdminFragment.java]"]
  node_n_admin_config["Config<br/>admin fragment"]
  node_n_admin_messages["Messages<br/>admin fragment"]
  node_n_admin_upload["Upload File<br/>admin fragment"]
  node_n_admin_users["Users<br/>admin fragment"]
end

subgraph group_g_backend["Firebase Boundaries"]
  node_n_firebase_auth[("Firebase Auth<br/>auth service")]
  node_n_firestore[("Firestore<br/>data store")]
  node_n_storage[("Storage<br/>file store")]
  node_n_fcm[("FCM<br/>push service")]
end

node_n_loading -->|"unauthenticated"| node_n_login
node_n_loading -->|"authenticated"| node_n_main
node_n_login -->|"sign in"| node_n_firebase_auth
node_n_register -->|"create account"| node_n_firebase_auth
node_n_main -->|"hosts"| node_n_bottom_nav
node_n_bottom_nav -->|"home"| node_n_home
node_n_bottom_nav -->|"portal"| node_n_student_portal
node_n_bottom_nav -->|"resources"| node_n_resources
node_n_bottom_nav -->|"profile"| node_n_profile
node_n_bottom_nav -->|"admin"| node_n_admin
node_n_resources -->|"partition"| node_n_department_repo
node_n_resources -->|"drill down"| node_n_batch
node_n_batch -->|"select semester"| node_n_semester
node_n_semester -->|"select course"| node_n_course_list
node_n_course_list -->|"open links"| node_n_drive_links
node_n_course_list -->|"open files"| node_n_file_list
node_n_drive_links -->|"open link"| node_n_web
node_n_file_list -->|"view pdf"| node_n_pdf
node_n_file_list -->|"download source"| node_n_storage
node_n_community -->|"chat data"| node_n_firestore
node_n_community -->|"receives pushes"| node_n_messaging
node_n_messaging -->|"push delivery"| node_n_fcm
node_n_admin -->|"config"| node_n_admin_config
node_n_admin -->|"moderate"| node_n_admin_messages
node_n_admin -->|"publish files"| node_n_admin_upload
node_n_admin -->|"manage users"| node_n_admin_users
node_n_admin_config -->|"read/write settings"| node_n_firestore
node_n_admin_messages -->|"edit posts"| node_n_firestore
node_n_admin_upload -->|"store files"| node_n_storage
node_n_admin_users -->|"user records"| node_n_firestore

click node_n_loading "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/LoadingActivity.java"
click node_n_login "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/LoginActivity.java"
click node_n_register "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/RegisterActivity.java"
click node_n_main "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/MainActivity.java"
click node_n_bottom_nav "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/res/menu/bottom_navigation.xml"
click node_n_home "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/HomeFragment.java"
click node_n_student_portal "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/StudentPortalFragment.java"
click node_n_resources "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/ResourcesFragment.java"
click node_n_batch "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/BatchWiseFragment.java"
click node_n_semester "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/SemesterResources.java"
click node_n_course_list "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/CourseListFragment.java"
click node_n_drive_links "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/DriveLinksFragment.java"
click node_n_file_list "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/FileListFragment.java"
click node_n_pdf "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/PdfViewerFragment.java"
click node_n_web "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/WebFragment.java"
click node_n_community "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/CommunityActivity.java"
click node_n_profile "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/ProfileFragment.java"
click node_n_admin "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/AdminFragment.java"
click node_n_admin_config "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/AdminConfigFragment.java"
click node_n_admin_messages "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/ManageMessagesNoticesFragment.java"
click node_n_admin_upload "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/UploadFileFragment.java"
click node_n_admin_users "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/AdminUserListFragment.java"
click node_n_messaging "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/MyFirebaseMessagingService.java"
click node_n_department_repo "https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/DepartmentRepository.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_n_loading,node_n_login,node_n_register,node_n_main,node_n_bottom_nav,node_n_profile toneBlue
class node_n_home,node_n_student_portal,node_n_resources,node_n_batch,node_n_semester,node_n_course_list,node_n_drive_links,node_n_file_list,node_n_pdf,node_n_web,node_n_department_repo toneAmber
class node_n_community,node_n_messaging toneMint
class node_n_admin,node_n_admin_config,node_n_admin_messages,node_n_admin_upload,node_n_admin_users toneRose
class node_n_firebase_auth,node_n_firestore,node_n_storage,node_n_fcm toneIndigo
```

## Components

### Session & Shell

App launch, authentication, and main navigation container.

- [Loading](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/LoadingActivity.java): entry activity · Starts the app and routes based on authentication state. · `app/src/main/java/com/tanim/ccepedia/LoadingActivity.java`
- [Login](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/LoginActivity.java): auth activity · Sign-in screen for existing users. · `app/src/main/java/com/tanim/ccepedia/LoginActivity.java`
- [Register](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/RegisterActivity.java): auth activity · Account creation flow. · `app/src/main/java/com/tanim/ccepedia/RegisterActivity.java`
- [Main Shell](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/MainActivity.java): host activity · Primary container for the app's fragment navigation. · `app/src/main/java/com/tanim/ccepedia/MainActivity.java`
- [Bottom Nav](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/res/menu/bottom_navigation.xml): ui menu · Bottom-tab navigation definition for the main shell. · `app/src/main/res/menu/bottom_navigation.xml`
- [Profile](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/ProfileFragment.java): profile fragment · User account and personal information view. · `app/src/main/java/com/tanim/ccepedia/ProfileFragment.java`

### Academic Content

Student-facing browsing of departments, semesters, courses, files, and links.

- [Home](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/HomeFragment.java): dashboard fragment · Landing hub for featured content and quick actions. · `app/src/main/java/com/tanim/ccepedia/HomeFragment.java`
- [Student Portal](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/StudentPortalFragment.java): portal fragment · Student-facing section entry point. · `app/src/main/java/com/tanim/ccepedia/StudentPortalFragment.java`
- [Resources](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/ResourcesFragment.java): browse fragment · Top-level academic resource browser. · `app/src/main/java/com/tanim/ccepedia/ResourcesFragment.java`
- [Batch Wise](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/BatchWiseFragment.java): browse fragment · Drills into batch-oriented resource discovery. · `app/src/main/java/com/tanim/ccepedia/BatchWiseFragment.java`
- [Semester](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/SemesterResources.java): browse fragment · Semester-level resource listing. · `app/src/main/java/com/tanim/ccepedia/SemesterResources.java`
- [Course List](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/CourseListFragment.java): browse fragment · Lists courses within the selected semester or department. · `app/src/main/java/com/tanim/ccepedia/CourseListFragment.java`
- [Drive Links](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/DriveLinksFragment.java): link fragment · Shows grouped external file links for a course or batch. · `app/src/main/java/com/tanim/ccepedia/DriveLinksFragment.java`
- [File List](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/FileListFragment.java): file fragment · Displays downloadable resource files. · `app/src/main/java/com/tanim/ccepedia/FileListFragment.java`
- [PDF Viewer](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/PdfViewerFragment.java): viewer fragment · Reads PDF documents inside the app. · `app/src/main/java/com/tanim/ccepedia/PdfViewerFragment.java`
- [Web View](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/WebFragment.java): viewer fragment · Embeds web pages or link targets. · `app/src/main/java/com/tanim/ccepedia/WebFragment.java`
- [Departments](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/DepartmentRepository.java): repository · Department partitioning and shared academic structure. · `app/src/main/java/com/tanim/ccepedia/DepartmentRepository.java`

### Community

Chat, notices, and push-driven updates.

- [Community](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/CommunityActivity.java): chat activity · Discussion and announcement surface. · `app/src/main/java/com/tanim/ccepedia/CommunityActivity.java`
- [Push Service](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/MyFirebaseMessagingService.java): firebase messaging · App-side service handling incoming push notifications. · `app/src/main/java/com/tanim/ccepedia/MyFirebaseMessagingService.java`

### Admin Tools

In-app control surface for content and configuration management.

- [Admin](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/AdminFragment.java): control fragment · Entry point for administrative tools. · `app/src/main/java/com/tanim/ccepedia/AdminFragment.java`
- [Config](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/AdminConfigFragment.java): admin fragment · Runtime settings and feature/content configuration. · `app/src/main/java/com/tanim/ccepedia/AdminConfigFragment.java`
- [Messages](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/ManageMessagesNoticesFragment.java): admin fragment · Manage community messages and notices. · `app/src/main/java/com/tanim/ccepedia/ManageMessagesNoticesFragment.java`
- [Upload File](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/UploadFileFragment.java): admin fragment · Adds downloadable content to storage-backed resources. · `app/src/main/java/com/tanim/ccepedia/UploadFileFragment.java`
- [Users](https://github.com/tanim494/iiuc-pedia/blob/master/app/src/main/java/com/tanim/ccepedia/AdminUserListFragment.java): admin fragment · User list and account oversight. · `app/src/main/java/com/tanim/ccepedia/AdminUserListFragment.java`

### Firebase Boundaries

External services used by the Android client.

- **Firebase Auth**: auth service · Authentication provider for login and registration.
- **Firestore**: data store · Structured store for content, chat, notices, and configuration.
- **Storage**: file store · Hosts uploaded PDFs and other downloadable resources.
- **FCM**: push service · Push notification delivery for updates and alerts.

## Connections

- Loading → Login: unauthenticated · Routes to sign-in when no session is available.
- Loading → Main Shell: authenticated · Skips auth and opens the main shell.
- Login → Firebase Auth: sign in · Authenticates users against Firebase Auth.
- Register → Firebase Auth: create account · Registers new users through Firebase Auth.
- Main Shell → Bottom Nav: hosts · Main activity contains the bottom navigation container.
- Bottom Nav → Home: home · Navigation item opens the home fragment.
- Bottom Nav → Student Portal: portal · Navigation item opens the student portal.
- Bottom Nav → Resources: resources · Navigation item opens academic resources.
- Bottom Nav → Profile: profile · Navigation item opens the profile view.
- Bottom Nav → Admin: admin · Navigation item or role-gated entry reaches admin tools.
- Resources → Departments: partition · Uses department structure to scope content.
- Resources → Batch Wise: drill down · Starts batch-oriented browsing.
- Batch Wise → Semester: select semester · Moves from batch to semester resources.
- Semester → Course List: select course · Shows courses inside the chosen semester.
- Course List → Drive Links: open links · Courses can expose external drive link groups.
- Course List → File List: open files · Courses can expose downloadable file listings.
- Drive Links → Web View: open link · External links are viewed in the embedded web screen.
- File List → PDF Viewer: view pdf · PDF resources open in the PDF viewer.
- File List → Storage: download source · File metadata points to Firebase Storage objects.
- Community → Firestore: chat data · Community messages and notices are stored in Firestore.
- Community → Push Service: receives pushes · Community updates are surfaced through the messaging service.
- Push Service → FCM: push delivery · Firebase Cloud Messaging delivers notifications to the app.
- Admin → Config: config · Administrative configuration tools.
- Admin → Messages: moderate · Administrative message and notice management.
- Admin → Upload File: publish files · Admin workflow for uploading content.
- Admin → Users: manage users · Administrative user oversight.
- Config → Firestore: read/write settings · Configuration is persisted in Firestore.
- Messages → Firestore: edit posts · Messages and notices are maintained in Firestore.
- Upload File → Storage: store files · Uploaded materials go to Firebase Storage.
- Users → Firestore: user records · User lists and profile data come from Firestore.
