# reeyanto/android-mvvm-restapi architecture

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

- Interactive diagram: https://gitdiagram.com/reeyanto/android-mvvm-restapi
- Repository: https://github.com/reeyanto/android-mvvm-restapi

## Overview

StudentApp is an Android client that loads a student list from a REST API and presents it in a list. On activity creation, the screen observes a ViewModel; the ViewModel asks its repository to fetch students, which uses Retrofit to call the API and reports success or failure back for display. The adapter renders each student’s NIS and name. The source excerpts establish these runtime links; the README contains only an image, so no other product capabilities are documented.

Main entry points: [`app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java`](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java) (Student repository), [`app/src/main/java/com/riyanto/studentapp/MainActivity.java`](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/MainActivity.java) (Student screen), [`app/src/main/java/com/riyanto/studentapp/viewmodel/StudentViewModel.java`](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/viewmodel/StudentViewModel.java) (Student ViewModel), [`app/src/main/java/com/riyanto/studentapp/network/ApiService.java`](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/network/ApiService.java) (Student API service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Android presentation"]
  node_activity["Student screen<br/>[MainActivity.java]"]
  node_adapter["Student list adapter"]
  node_viewmodel["Student ViewModel"]
end

subgraph group_data["Student data access"]
  node_repository["Student repository"]
  node_client["Retrofit client<br/>[ApiClient.java]"]
  node_service["Student API service<br/>[ApiService.java]"]
  node_student["Student record<br/>[Student.java]"]
end

node_user(("App user"))
node_api{{"Student REST API"}}

node_user -->|"opens"| node_activity
node_activity -->|"observes"| node_viewmodel
node_activity -->|"creates"| node_adapter
node_adapter -->|"renders fields"| node_student
node_viewmodel -->|"fetches students"| node_repository
node_repository -->|"creates service"| node_client
node_repository -->|"requests students"| node_service
node_service -->|"GET students"| node_api
node_service -->|"decodes list"| node_student
node_repository -->|"returns result"| node_viewmodel
node_viewmodel -->|"publishes state"| node_activity

click node_activity "https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/MainActivity.java"
click node_adapter "https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/StudentAdapter.java"
click node_viewmodel "https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/viewmodel/StudentViewModel.java"
click node_repository "https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java"
click node_client "https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/network/ApiClient.java"
click node_service "https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/network/ApiService.java"
click node_student "https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/model/Student.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_activity,node_adapter,node_viewmodel,node_user toneBlue
class node_repository,node_client,node_service,node_student toneAmber
class node_api toneMint
```

## Components

### Android presentation

- [Student screen](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/MainActivity.java): `app/src/main/java/com/riyanto/studentapp/MainActivity.java`
- [Student list adapter](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/StudentAdapter.java): `app/src/main/java/com/riyanto/studentapp/StudentAdapter.java`
- [Student ViewModel](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/viewmodel/StudentViewModel.java): `app/src/main/java/com/riyanto/studentapp/viewmodel/StudentViewModel.java`

### Student data access

- [Student repository](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java): `app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java`
- [Retrofit client](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/network/ApiClient.java): `app/src/main/java/com/riyanto/studentapp/network/ApiClient.java`
- [Student API service](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/network/ApiService.java): `app/src/main/java/com/riyanto/studentapp/network/ApiService.java`
- [Student record](https://github.com/reeyanto/android-mvvm-restapi/blob/main/app/src/main/java/com/riyanto/studentapp/model/Student.java): `app/src/main/java/com/riyanto/studentapp/model/Student.java`

### Other components

- **App user**
- **Student REST API**

## Connections

- App user → Student screen: opens (evidence: `app/src/main/java/com/riyanto/studentapp/MainActivity.java`)
- Student screen → Student ViewModel: observes (evidence: `app/src/main/java/com/riyanto/studentapp/MainActivity.java`)
- Student screen → Student list adapter: creates (evidence: `app/src/main/java/com/riyanto/studentapp/MainActivity.java`)
- Student list adapter → Student record: renders fields (evidence: `app/src/main/java/com/riyanto/studentapp/StudentAdapter.java`)
- Student ViewModel → Student repository: fetches students (evidence: `app/src/main/java/com/riyanto/studentapp/viewmodel/StudentViewModel.java`)
- Student repository → Retrofit client: creates service (evidence: `app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java`)
- Student repository → Student API service: requests students (evidence: `app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java`)
- Student API service → Student REST API: GET students (evidence: `app/src/main/java/com/riyanto/studentapp/network/ApiService.java`)
- Student API service → Student record: decodes list (evidence: `app/src/main/java/com/riyanto/studentapp/network/ApiService.java`)
- Student repository → Student ViewModel: returns result (evidence: `app/src/main/java/com/riyanto/studentapp/repository/StudentRepository.java`)
- Student ViewModel → Student screen: publishes state (evidence: `app/src/main/java/com/riyanto/studentapp/MainActivity.java`)
