# tahuatautempeh/ppk-praktikum-after-uts architecture

> Architecture diagram of the GitHub repository tahuatautempeh/ppk-praktikum-after-uts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tahuatautempeh/ppk-praktikum-after-uts
- Repository: https://github.com/tahuatautempeh/ppk-praktikum-after-uts

## Overview

Presensi Praktikum is a mobile and web attendance app for laboratory classes. Assistants manage classes, participants, laboratories and sessions; opening a session enables enrolled students to submit location-checked attendance. Assistants review leave requests, then close sessions; attendees can submit session feedback, scored by an on-device sentiment model. Firebase Authentication and Firestore provide identity and shared records, with push notifications handled by the app and optional server-side workers. The map and administration capabilities are included as distinct branches. Some service and screen implementations were not excerpted, so those links rely on README statements rather than inspected implementation.

Main entry points: [`src/lib/firebase/firestore.ts`](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/firebase/firestore.ts) (Cloud Firestore), [`src/screens/asisten/sesi/session-manage-list-screen.tsx`](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/sesi/session-manage-list-screen.tsx) (Session management), [`src/lib/attendance-service.ts`](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/attendance-service.ts) (Attendance submission), [`src/context/auth-context.tsx`](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/context/auth-context.tsx) (Authentication and profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_auth_routes["Sign in and register<br/>[login.tsx]"]
  node_auth_context["Authentication and profile<br/>[auth-context.tsx]"]
  node_admin["User administration<br/>[admin.tsx]"]
end

subgraph group_operations["Class and session operations"]
  node_class_enrollment["Classes and enrollment"]
  node_session_management["Session management"]
  node_session_detail["Session controls<br/>[session-screen.tsx]"]
  node_lab_management["Laboratory management"]
  node_permission_review["Leave review<br/>[review-izin.tsx]"]
end

subgraph group_student["Student attendance"]
  node_attendance["Attendance submission"]
  node_location["Location validation<br/>[geo.ts]"]
  node_leave_request["Leave requests"]
  node_student_history["Attendance history<br/>[riwayat-screen.tsx]"]
end

subgraph group_insights["Maps and feedback"]
  node_map["Laboratory map<br/>[peta-screen.tsx]"]
  node_recap["Session recap<br/>[recap-screen.tsx]"]
  node_feedback["Session feedback"]
  node_sentiment["On-device sentiment<br/>[sentiment.js]"]
end

subgraph group_platform["Firebase and notifications"]
  node_firebase_auth["Firebase Authentication<br/>[auth.ts]"]
  node_firestore[("Cloud Firestore<br/>[firestore.ts]")]
  node_notifications["Push notification service"]
  node_notification_handlers["Notification handlers"]
  node_notification_worker["Notification worker<br/>[worker.ts]"]
end

node_assistant(("Assistant"))
node_student_actor(("Student"))

node_student_actor -->|"registers or signs in"| node_auth_routes
node_assistant -->|"signs in"| node_auth_routes
node_auth_routes -.->|"uses identity"| node_auth_context
node_auth_context -->|"authenticates"| node_firebase_auth
node_auth_context -->|"loads profile"| node_firestore
node_assistant -->|"manages roles"| node_admin
node_admin -->|"updates user roles"| node_firestore
node_assistant -->|"manages participants"| node_class_enrollment
node_class_enrollment -->|"reads and writes enrollments"| node_firestore
node_assistant -->|"manages sessions"| node_session_management
node_session_management -.->|"opens session controls"| node_session_detail
node_session_management -->|"loads class data"| node_class_enrollment
node_session_management -->|"loads laboratories"| node_lab_management
node_session_management -->|"creates and updates sessions"| node_firestore
node_assistant -->|"reviews leave"| node_permission_review
node_permission_review -->|"records review"| node_firestore
node_student_actor -->|"submits attendance"| node_attendance
node_attendance -->|"checks open session"| node_session_detail
node_attendance -->|"validates location"| node_location
node_attendance -->|"checks enrollment"| node_class_enrollment
node_attendance -->|"writes attendance"| node_firestore
node_student_actor -->|"requests leave"| node_leave_request
node_leave_request -->|"stores request"| node_firestore
node_student_actor -->|"views attendance"| node_student_history
node_student_history -.->|"reads attendance"| node_firestore
node_student_actor -->|"views laboratories"| node_map
node_assistant -->|"views laboratories"| node_map
node_assistant -->|"reviews attendance"| node_recap
node_student_actor -->|"submits session feedback"| node_feedback
node_feedback -->|"scores sentiment"| node_sentiment
node_feedback -.->|"stores feedback"| node_firestore
node_auth_context -->|"registers push token"| node_notifications
node_notifications -.->|"stores token"| node_firestore
node_notification_worker -->|"dispatches handlers"| node_notification_handlers
node_notification_handlers -->|"reads events and logs"| node_firestore
node_notification_handlers -->|"sends push alerts"| node_student_actor

click node_auth_routes "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/app/(auth)/login.tsx"
click node_auth_context "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/context/auth-context.tsx"
click node_admin "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/app/asisten/(tabs)/admin.tsx"
click node_class_enrollment "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/enrollment-service.ts"
click node_session_management "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/sesi/session-manage-list-screen.tsx"
click node_session_detail "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/session-screen.tsx"
click node_lab_management "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/laboratory-service.ts"
click node_permission_review "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/izin/review-izin.tsx"
click node_attendance "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/attendance-service.ts"
click node_location "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/geo.ts"
click node_leave_request "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/permission-service.ts"
click node_student_history "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/praktikan/riwayat-screen.tsx"
click node_map "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/peta/peta-screen.tsx"
click node_recap "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/recap-screen.tsx"
click node_feedback "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/kesan-pesan-service.ts"
click node_sentiment "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/ai/sentiment.js"
click node_firebase_auth "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/firebase/auth.ts"
click node_firestore "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/firebase/firestore.ts"
click node_notifications "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/notification-service.ts"
click node_notification_handlers "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/functions/src/notification-handlers.ts"
click node_notification_worker "https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/functions/src/worker.ts"

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_routes,node_auth_context,node_admin toneBlue
class node_class_enrollment,node_session_management,node_session_detail,node_lab_management,node_permission_review toneAmber
class node_attendance,node_location,node_leave_request,node_student_history toneMint
class node_map,node_recap,node_feedback,node_sentiment toneRose
class node_firebase_auth,node_firestore,node_notifications,node_notification_handlers,node_notification_worker,node_assistant,node_student_actor toneIndigo
```

## Components

### Identity and access

- [Sign in and register](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/app/(auth)/login.tsx): `src/app/(auth)/login.tsx`
- [Authentication and profile](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/context/auth-context.tsx): `src/context/auth-context.tsx`
- [User administration](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/app/asisten/(tabs)/admin.tsx): `src/app/asisten/(tabs)/admin.tsx`

### Class and session operations

- [Classes and enrollment](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/enrollment-service.ts): `src/lib/enrollment-service.ts`
- [Session management](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/sesi/session-manage-list-screen.tsx): `src/screens/asisten/sesi/session-manage-list-screen.tsx`
- [Session controls](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/session-screen.tsx): `src/screens/asisten/session-screen.tsx`
- [Laboratory management](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/laboratory-service.ts): `src/lib/laboratory-service.ts`
- [Leave review](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/izin/review-izin.tsx): `src/screens/asisten/izin/review-izin.tsx`

### Student attendance

- [Attendance submission](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/attendance-service.ts): `src/lib/attendance-service.ts`
- [Location validation](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/geo.ts): `src/lib/geo.ts`
- [Leave requests](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/permission-service.ts): `src/lib/permission-service.ts`
- [Attendance history](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/praktikan/riwayat-screen.tsx): `src/screens/praktikan/riwayat-screen.tsx`

### Maps and feedback

- [Laboratory map](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/peta/peta-screen.tsx): `src/screens/peta/peta-screen.tsx`
- [Session recap](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/screens/asisten/recap-screen.tsx): `src/screens/asisten/recap-screen.tsx`
- [Session feedback](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/kesan-pesan-service.ts): `src/lib/kesan-pesan-service.ts`
- [On-device sentiment](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/ai/sentiment.js): `ai/sentiment.js`

### Firebase and notifications

- [Firebase Authentication](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/firebase/auth.ts): `src/lib/firebase/auth.ts`
- [Cloud Firestore](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/firebase/firestore.ts): `src/lib/firebase/firestore.ts`
- [Push notification service](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/src/lib/notification-service.ts): `src/lib/notification-service.ts`
- [Notification handlers](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/functions/src/notification-handlers.ts): `functions/src/notification-handlers.ts`
- [Notification worker](https://github.com/tahuatautempeh/ppk-praktikum-after-uts/blob/main/functions/src/worker.ts): `functions/src/worker.ts`

### Other components

- **Assistant**
- **Student**

## Connections

- Student → Sign in and register: registers or signs in (evidence: `README.md`)
- Assistant → Sign in and register: signs in (evidence: `README.md`)
- Sign in and register → Authentication and profile: uses identity
- Authentication and profile → Firebase Authentication: authenticates (evidence: `src/context/auth-context.tsx`)
- Authentication and profile → Cloud Firestore: loads profile (evidence: `src/context/auth-context.tsx`)
- Assistant → User administration: manages roles (evidence: `README.md`)
- User administration → Cloud Firestore: updates user roles (evidence: `README.md`)
- Assistant → Classes and enrollment: manages participants (evidence: `README.md`)
- Classes and enrollment → Cloud Firestore: reads and writes enrollments (evidence: `src/lib/enrollment-service.ts`)
- Assistant → Session management: manages sessions (evidence: `README.md`)
- Session management → Session controls: opens session controls
- Session management → Classes and enrollment: loads class data (evidence: `src/screens/asisten/sesi/session-manage-list-screen.tsx`)
- Session management → Laboratory management: loads laboratories (evidence: `src/screens/asisten/sesi/session-manage-list-screen.tsx`)
- Session management → Cloud Firestore: creates and updates sessions (evidence: `README.md`)
- Assistant → Leave review: reviews leave (evidence: `README.md`)
- Leave review → Cloud Firestore: records review (evidence: `README.md`)
- Student → Attendance submission: submits attendance (evidence: `README.md`)
- Attendance submission → Session controls: checks open session (evidence: `README.md`)
- Attendance submission → Location validation: validates location (evidence: `README.md`)
- Attendance submission → Classes and enrollment: checks enrollment (evidence: `README.md`)
- Attendance submission → Cloud Firestore: writes attendance (evidence: `README.md`)
- Student → Leave requests: requests leave (evidence: `README.md`)
- Leave requests → Cloud Firestore: stores request (evidence: `README.md`)
- Student → Attendance history: views attendance (evidence: `README.md`)
- Attendance history → Cloud Firestore: reads attendance
- Student → Laboratory map: views laboratories (evidence: `README.md`)
- Assistant → Laboratory map: views laboratories (evidence: `README.md`)
- Assistant → Session recap: reviews attendance (evidence: `README.md`)
- Student → Session feedback: submits session feedback (evidence: `README.md`)
- Session feedback → On-device sentiment: scores sentiment (evidence: `README.md`)
- Session feedback → Cloud Firestore: stores feedback
- Authentication and profile → Push notification service: registers push token (evidence: `src/context/auth-context.tsx`)
- Push notification service → Cloud Firestore: stores token
- Notification worker → Notification handlers: dispatches handlers (evidence: `functions/src/worker.ts`)
- Notification handlers → Cloud Firestore: reads events and logs (evidence: `functions/src/notification-handlers.ts`)
- Notification handlers → Student: sends push alerts (evidence: `README.md`)
