# persevere-5962/2027robotcode architecture

> Architecture diagram of the GitHub repository persevere-5962/2027robotcode, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/persevere-5962/2027robotcode
- Repository: https://github.com/persevere-5962/2027robotcode

## Overview

This is an FRC robot runtime scaffold: WPILib starts the robot, whose lifecycle setup selects real, simulation, or replay behavior, resolves robot identity, and configures AdvantageKit logging. The only sampled drivetrain code is a module I/O contract; no subsystem orchestration, autonomous commands, or vision integration is present in the source tree. The README documents swerve and PhotonVision as the season’s stack, but the available source does not show their runtime wiring.

Main entry points: [`src/main/java/first/robot/Robot.java`](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Robot.java) (Robot lifecycle), [`src/main/java/first/robot/RobotIdentity.java`](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/RobotIdentity.java) (Robot identity), [`src/main/java/first/Main.java`](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/Main.java) (Application entry), [`src/main/java/first/robot/Constants.java`](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Constants.java) (Runtime mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and mode"]
  node_main["Application entry<br/>[Main.java]"]
end

subgraph group_runtime["Robot runtime"]
  node_robot["Robot lifecycle<br/>[Robot.java]"]
  node_mode["Runtime mode<br/>[Constants.java]"]
  node_identity["Robot identity<br/>[RobotIdentity.java]"]
  node_logger["AdvantageKit logger<br/>[Robot.java]"]
  node_logfiles["WPILOG files"]
  node_nt4["NetworkTables publisher"]
  node_marker["Identity marker file"]
  node_alert["Driver Station alert"]
end

subgraph group_hardware["Hardware boundary"]
  node_moduleio["Module I/O contract<br/>[ModuleIO.java]"]
  node_swerve["SDS MK5n swerve"]
  node_photonvision["PhotonVision"]
end

node_operator(("Robot operator"))

node_operator -->|"starts robot"| node_main
node_main -->|"starts"| node_robot
node_robot -->|"selects mode"| node_mode
node_robot -->|"resolves identity"| node_identity
node_robot -->|"configures and starts"| node_logger
node_logger -->|"writes logs"| node_logfiles
node_logger -->|"publishes telemetry"| node_nt4
node_identity -->|"reads on real"| node_marker
node_identity -->|"alerts on failure"| node_alert
node_swerve -.->|"I/O boundary"| node_moduleio

click node_main "https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/Main.java"
click node_robot "https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Robot.java"
click node_mode "https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Constants.java"
click node_identity "https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/RobotIdentity.java"
click node_logger "https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Robot.java"
click node_moduleio "https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/subsystems/drive/io/ModuleIO.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 toneBlue
class node_robot,node_mode,node_identity,node_logger,node_logfiles,node_nt4,node_marker,node_alert toneAmber
class node_moduleio,node_swerve,node_photonvision toneMint
class node_operator toneIndigo
```

## Components

### Startup and mode

- [Application entry](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/Main.java): `src/main/java/first/Main.java`

### Robot runtime

- [Robot lifecycle](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Robot.java): `src/main/java/first/robot/Robot.java`
- [Runtime mode](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Constants.java): `src/main/java/first/robot/Constants.java`
- [Robot identity](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/RobotIdentity.java): `src/main/java/first/robot/RobotIdentity.java`
- [AdvantageKit logger](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/Robot.java): `src/main/java/first/robot/Robot.java`
- **WPILOG files**
- **NetworkTables publisher**
- **Identity marker file**
- **Driver Station alert**

### Hardware boundary

- [Module I/O contract](https://github.com/persevere-5962/2027robotcode/blob/integration/src/main/java/first/robot/subsystems/drive/io/ModuleIO.java): `src/main/java/first/robot/subsystems/drive/io/ModuleIO.java`
- **SDS MK5n swerve**
- **PhotonVision**

### Other components

- **Robot operator**

## Connections

- Robot operator → Application entry: starts robot (evidence: `src/main/java/first/Main.java`)
- Application entry → Robot lifecycle: starts (evidence: `src/main/java/first/Main.java`)
- Robot lifecycle → Runtime mode: selects mode (evidence: `src/main/java/first/robot/Robot.java`)
- Robot lifecycle → Robot identity: resolves identity (evidence: `src/main/java/first/robot/Robot.java`)
- Robot lifecycle → AdvantageKit logger: configures and starts (evidence: `src/main/java/first/robot/Robot.java`)
- AdvantageKit logger → WPILOG files: writes logs (evidence: `src/main/java/first/robot/Robot.java`)
- AdvantageKit logger → NetworkTables publisher: publishes telemetry (evidence: `src/main/java/first/robot/Robot.java`)
- Robot identity → Identity marker file: reads on real (evidence: `src/main/java/first/robot/RobotIdentity.java`)
- Robot identity → Driver Station alert: alerts on failure (evidence: `src/main/java/first/robot/RobotIdentity.java`)
- SDS MK5n swerve → Module I/O contract: I/O boundary
