# raul-izquierdo/roster architecture

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

- Interactive diagram: https://gitdiagram.com/raul-izquierdo/roster
- Repository: https://github.com/raul-izquierdo/roster

## Overview

1. **What this repository is**
   - A Java command-line tool for managing a GitHub Classroom roster.
   - It does not call GitHub APIs; instead, it analyzes student and roster files and prints manual action instructions for the instructor to apply in the GitHub Classroom UI.

2. **Top-level execution flow**
   - The entry point is `main.Main`.
   - Execution starts by parsing CLI arguments, loading the relevant input files, computing roster differences or additions, and then delegating to a reporter that formats the final console output.
   - The process is file-in, text-out; there is no persistent storage or network layer.

3. **Command-line boundary**
   - `cli.Arguments` and `cli.ArgumentsParser` define the command surface.
   - The tool supports two modes: `create` and `update`.
   - Options control input file paths and student file format, with defaults for roster and groups files as documented in the README.

4. **Core domain model**
   - `model.Student` is the central domain object.
   - It appears to carry at least the student name and group/roster identity used for comparisons and display.
   - The model is intentionally simple, which keeps the business logic focused on set comparison rather than rich domain behavior.

5. **Student ingestion subsystem**
   - `loaders.students.StudentsLoader` is the orchestration layer for reading enrolled-student files.
   - `loaders.students.FormatLoader` and `loaders.students.FileFormat` provide format selection.
   - `loaders.students.StudentBuilder` and `InvalidStudentFormatException` suggest validation and normalization during parsing.

6. **Supported student file formats**
   - The concrete parsers live under `loaders.students.formats`: `CsvLoader`, `ExcelLoader`, and `SiesLoader`.
   - This is a clear strategy-style boundary: same logical input, multiple file-format implementations.
   - The SIES loader likely includes institution-specific normalization of group labels, while CSV/Excel are generic tabular parsers.

7. **Group filtering subsystem**
   - `loaders.groups.GroupsLoader` reads the teacher’s allowed groups file.
   - The README indicates the file is a simple list or CSV where only the first column matters.
   - This subsystem acts as a filter boundary so the output only includes students relevant to the instructor’s groups.

8. **Roster comparison subsystem**
   - `loaders.roster.RosterLoader` reads the exported GitHub Classroom roster CSV.
   - In `update` mode, it is compared against the newly loaded enrolled-student list to determine three change sets:
     - students to add,
     - students to remove,
     - students whose group changed.
   - The comparison logic is the heart of the tool, converting two file snapshots into actionable deltas.

9. **Naming and identity normalization**
   - `naming.NamingStrategy` indicates a dedicated abstraction for shaping names or roster labels into the form expected by GitHub Classroom or by the output report.
   - The repository includes `ParenthesisStrategyTest`, so formatting of roster identifiers or display names is a meaningful, test-covered concern.
   - This boundary matters because correct formatting affects whether instructors can apply changes manually without mistakes.

10. **Reporting layer**
    - `main.Reporter` is responsible for turning computed results into the instructional console output shown in the README.
    - This layer is not doing business logic; it packages results with human-readable guidance for the GitHub Classroom web workflow.
    - Exit codes likely originate here or in `Main` based on whether changes were found or errors occurred.

11. **Data flow for `create`**
    - Parse CLI args.
    - Load enrolled students from the chosen format.
    - Optionally filter by groups.
    - Apply naming/format normalization.
    - Print the list of students to add, along with step-by-step manual instructions.
    - No existing roster file is needed in this mode.

12. **Data flow for `update`**
    - Parse CLI args.
    - Load enrolled students and the current Classroom roster.
    - Optionally filter by groups.
    - Compare the two sets by student identity and group.
    - Print separate sections for additions, removals, and group changes, each with manual instructions.

13. **Build, test, and delivery**
    - The project is Maven-based (`pom.xml`, Maven wrapper files).
    - Tests are organized by subsystem under `src/test/java`, which suggests the architecture is well-separated and unit-test driven.
    - GitHub Actions release workflow and shell/batch run scripts indicate the project is packaged as a distributable CLI JAR for desktop/server use rather than a long-running service.

14. **Architectural takeaway**
    - The repository is a modular CLI pipeline: argument parsing → file loaders → normalization/comparison → reporting.
    - Its main architectural boundaries are file format adapters, roster diffing logic, and console reporting.
    - That separation makes it suitable for an architecture diagram with clearly labeled input adapters, core comparison logic, and output/reporting at the edge.

Main entry points: [`src/main/java/es/uniovi/raul/roster/main/Main.java`](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/main/Main.java) (Main), [`src/main/java/es/uniovi/raul/roster/loaders/students/FormatLoader.java`](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/FormatLoader.java) (Format loader), [`src/main/java/es/uniovi/raul/roster/loaders/students/StudentBuilder.java`](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/StudentBuilder.java) (Student builder), [`src/main/java/es/uniovi/raul/roster/model/Student.java`](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/model/Student.java) (Student)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_main(("Main<br/>entrypoint<br/>[Main.java]"))
  node_reporter["Reporter<br/>output formatter<br/>[Reporter.java]"]
end

subgraph group_cli["Command line"]
  node_args["Arguments<br/>cli model<br/>[Arguments.java]"]
  node_parser["Arg parser<br/>cli parser"]
end

subgraph group_students["Student ingestion"]
  node_students_loader["Students loader<br/>orchestrator"]
  node_format_loader["Format loader<br/>strategy selector<br/>[FormatLoader.java]"]
  node_file_format["File format<br/>enum<br/>[FileFormat.java]"]
  node_student_builder["Student builder<br/>parser helper"]
  node_csv_loader["CSV loader<br/>format adapter<br/>[CsvLoader.java]"]
  node_excel_loader["Excel loader<br/>format adapter<br/>[ExcelLoader.java]"]
  node_sies_loader["SIES loader<br/>format adapter<br/>[SiesLoader.java]"]
end

subgraph group_groups["Group filter"]
  node_groups_loader["Groups loader<br/>filter loader<br/>[GroupsLoader.java]"]
end

subgraph group_roster["Roster diff"]
  node_roster_loader["Roster loader<br/>input reader<br/>[RosterLoader.java]"]
end

subgraph group_core["Core model"]
  node_student["Student<br/>domain model<br/>[Student.java]"]
  node_naming{{"Naming strategy<br/>formatter"}}
end

node_main -->|"parse args"| node_parser
node_parser -->|"build"| node_args
node_main -->|"load students"| node_students_loader
node_students_loader -->|"select format"| node_format_loader
node_format_loader -->|"uses"| node_file_format
node_format_loader -->|"csv"| node_csv_loader
node_format_loader -->|"excel"| node_excel_loader
node_format_loader -->|"sies"| node_sies_loader
node_csv_loader -->|"normalize"| node_student_builder
node_excel_loader -->|"normalize"| node_student_builder
node_sies_loader -->|"normalize"| node_student_builder
node_student_builder -->|"create"| node_student
node_main -->|"load groups"| node_groups_loader
node_main -->|"load roster"| node_roster_loader
node_main -->|"apply names"| node_naming
node_main -->|"report"| node_reporter
node_groups_loader -->|"filter by group"| node_student
node_roster_loader -->|"compare roster"| node_student
node_main -->|"diff sets"| node_student

click node_main "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/main/Main.java"
click node_args "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/cli/Arguments.java"
click node_parser "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/cli/ArgumentsParser.java"
click node_students_loader "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/StudentsLoader.java"
click node_format_loader "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/FormatLoader.java"
click node_file_format "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/FileFormat.java"
click node_student_builder "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/StudentBuilder.java"
click node_csv_loader "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/formats/CsvLoader.java"
click node_excel_loader "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/formats/ExcelLoader.java"
click node_sies_loader "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/formats/SiesLoader.java"
click node_groups_loader "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/groups/GroupsLoader.java"
click node_roster_loader "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/roster/RosterLoader.java"
click node_student "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/model/Student.java"
click node_naming "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/naming/NamingStrategy.java"
click node_reporter "https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/main/Reporter.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_main,node_reporter toneBlue
class node_args,node_parser toneAmber
class node_students_loader,node_format_loader,node_file_format,node_student_builder,node_csv_loader,node_excel_loader,node_sies_loader toneMint
class node_groups_loader toneRose
class node_roster_loader toneIndigo
class node_student,node_naming toneTeal
```

## Components

### App shell

CLI entrypoint and console reporting.

- [Main](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/main/Main.java): entrypoint · Program entrypoint and orchestration start. · `src/main/java/es/uniovi/raul/roster/main/Main.java`
- [Reporter](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/main/Reporter.java): output formatter · Turns computed results into console instructions. · `src/main/java/es/uniovi/raul/roster/main/Reporter.java`

### Command line

Argument parsing and mode selection.

- [Arguments](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/cli/Arguments.java): cli model · Parsed command-line options and mode settings. · `src/main/java/es/uniovi/raul/roster/cli/Arguments.java`
- [Arg parser](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/cli/ArgumentsParser.java): cli parser · Builds the CLI model from raw arguments. · `src/main/java/es/uniovi/raul/roster/cli/ArgumentsParser.java`

### Student ingestion

Loading enrolled-student inputs from multiple formats.

- [Students loader](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/StudentsLoader.java): orchestrator · Coordinates loading and normalization of enrolled students. · `src/main/java/es/uniovi/raul/roster/loaders/students/StudentsLoader.java`
- [Format loader](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/FormatLoader.java): strategy selector · Chooses the student file-format implementation. · `src/main/java/es/uniovi/raul/roster/loaders/students/FormatLoader.java`
- [File format](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/FileFormat.java): enum · Supported student input formats. · `src/main/java/es/uniovi/raul/roster/loaders/students/FileFormat.java`
- [Student builder](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/StudentBuilder.java): parser helper · Validates and normalizes student records during parsing. · `src/main/java/es/uniovi/raul/roster/loaders/students/StudentBuilder.java`
- [CSV loader](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/formats/CsvLoader.java): format adapter · Parses student data from CSV files. · `src/main/java/es/uniovi/raul/roster/loaders/students/formats/CsvLoader.java`
- [Excel loader](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/formats/ExcelLoader.java): format adapter · Parses student data from spreadsheet files. · `src/main/java/es/uniovi/raul/roster/loaders/students/formats/ExcelLoader.java`
- [SIES loader](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/students/formats/SiesLoader.java): format adapter · Parses and normalizes institution-specific SIES exports. · `src/main/java/es/uniovi/raul/roster/loaders/students/formats/SiesLoader.java`

### Group filter

Loading and filtering allowed instructor groups.

- [Groups loader](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/groups/GroupsLoader.java): filter loader · Reads allowed groups used to restrict the student set. · `src/main/java/es/uniovi/raul/roster/loaders/groups/GroupsLoader.java`

### Roster diff

Reading Classroom roster exports and computing changes.

- [Roster loader](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/loaders/roster/RosterLoader.java): input reader · Reads the current GitHub Classroom roster export. · `src/main/java/es/uniovi/raul/roster/loaders/roster/RosterLoader.java`

### Core model

Shared domain objects and identity shaping.

- [Student](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/model/Student.java): domain model · Central student identity used for comparisons and reporting. · `src/main/java/es/uniovi/raul/roster/model/Student.java`
- [Naming strategy](https://github.com/raul-izquierdo/roster/blob/master/src/main/java/es/uniovi/raul/roster/naming/NamingStrategy.java): formatter · Shapes roster labels and names for comparison or output. · `src/main/java/es/uniovi/raul/roster/naming/NamingStrategy.java`

## Connections

- Main → Arg parser: parse args · Main starts by parsing CLI input.
- Arg parser → Arguments: build · Raw arguments become a typed command model.
- Main → Students loader: load students · Main delegates enrolled-student ingestion.
- Students loader → Format loader: select format · Loader resolves the correct parser strategy.
- Format loader → File format: uses · Format selection is driven by the supported enum.
- Format loader → CSV loader: csv · CSV implementation handles tabular student files.
- Format loader → Excel loader: excel · Excel implementation handles spreadsheet student files.
- Format loader → SIES loader: sies · SIES implementation handles institution-specific exports.
- CSV loader → Student builder: normalize · Parsed rows are validated into domain students.
- Excel loader → Student builder: normalize · Parsed rows are validated into domain students.
- SIES loader → Student builder: normalize · Parsed rows are validated into domain students.
- Student builder → Student: create · Builder produces the central student model.
- Main → Groups loader: load groups · Optional group filtering is loaded from file.
- Main → Roster loader: load roster · Update mode reads the existing Classroom roster.
- Main → Naming strategy: apply names · Names and labels are normalized for output and matching.
- Main → Reporter: report · Computed actions are rendered for the instructor.
- Groups loader → Student: filter by group · Group membership gates which students are kept.
- Roster loader → Student: compare roster · Roster rows are mapped to student identities.
- Main → Student: diff sets · Create/update flows compare student snapshots and emit changes.
