# funkincrew/funkin architecture

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

- Interactive diagram: https://gitdiagram.com/funkincrew/funkin
- Repository: https://github.com/funkincrew/funkin

## Overview

Friday Night Funkin’ is a HaxeFlixel rhythm game, distributed for web, desktop, and mobile. Its principal user workflow is selecting and playing songs, responding to timed notes, and reaching a results state; the source tree also identifies chart editing, mod support, and platform integrations as meaningful capabilities. The README confirms the product and modding support, while gameplay links below are dashed because the relevant Haxe implementations were not sampled. Android callback wiring is directly visible in the sampled Java source.

Main entry points: [`source/funkin/play/PlayState.hx`](https://github.com/funkincrew/funkin/blob/main/source/funkin/play/PlayState.hx) (Song Play), [`source/funkin/ui/mainmenu`](https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/mainmenu) (Game Menus), [`source/Main.hx`](https://github.com/funkincrew/funkin/blob/main/source/Main.hx) (Funkin Game), [`source/funkin/ui/freeplay`](https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/freeplay) (Freeplay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Rhythm Gameplay"]
  node_game["Funkin Game<br/>[Main.hx]"]
  node_songplay["Song Play<br/>[PlayState.hx]"]
  node_song["Song Runtime<br/>[Song.hx]"]
  node_notes["Notes and Strumlines<br/>[Strumline.hx]"]
  node_scoring["Scoring<br/>[Scoring.hx]"]
  node_results["Results<br/>[ResultState.hx]"]
end

subgraph group_content["Game Content"]
  node_registries["Content Registries"]
  node_songdata["Song Data<br/>[SongData.hx]"]
  node_characters["Characters and Stages<br/>[BaseCharacter.hx]"]
end

subgraph group_tools["Menus and Tools"]
  node_charts["Chart Editor"]
  node_menus["Game Menus"]
  node_freeplay["Freeplay"]
  node_story["Story Mode"]
end

subgraph group_extensions["Modding and Platform"]
  node_modloader["Mod Loader<br/>[PolymodHandler.hx]"]
  node_modules["Script Modules<br/>[ModuleHandler.hx]"]
  node_android["Android Callbacks<br/>[CallbackUtil.java]"]
  node_fnfc["FNFC Import<br/>[FNFCExtension.java]"]
  node_datafolder["Data Folder Access"]
  node_newgrounds["Newgrounds Services"]
end

node_player(("Player"))
node_newgroundsservice(("Newgrounds"))

node_player -.->|"plays"| node_game
node_game -.->|"opens"| node_menus
node_menus -.->|"offers songs"| node_freeplay
node_menus -.->|"offers story"| node_story
node_freeplay -.->|"starts song"| node_songplay
node_story -.->|"starts song"| node_songplay
node_songplay -.->|"runs"| node_song
node_songplay -.->|"handles notes"| node_notes
node_songplay -.->|"uses"| node_characters
node_songplay -.->|"tracks score"| node_scoring
node_songplay -.->|"ends at"| node_results
node_charts -.->|"edits charts"| node_songdata
node_registries -.->|"registers"| node_songdata
node_modloader -.->|"dispatches"| node_modules
node_fnfc -->|"dispatches callback"| node_android
node_player -.->|"browses files"| node_datafolder
node_newgrounds -.->|"connects to"| node_newgroundsservice

click node_game "https://github.com/funkincrew/funkin/blob/main/source/Main.hx"
click node_songplay "https://github.com/funkincrew/funkin/blob/main/source/funkin/play/PlayState.hx"
click node_song "https://github.com/funkincrew/funkin/blob/main/source/funkin/play/song/Song.hx"
click node_notes "https://github.com/funkincrew/funkin/blob/main/source/funkin/play/notes/Strumline.hx"
click node_scoring "https://github.com/funkincrew/funkin/blob/main/source/funkin/play/scoring/Scoring.hx"
click node_results "https://github.com/funkincrew/funkin/blob/main/source/funkin/play/ResultState.hx"
click node_charts "https://github.com/funkincrew/funkin/blob/main/source/funkin/ui/debug/charting/ChartEditorState.hx"
click node_menus "https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/mainmenu"
click node_freeplay "https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/freeplay"
click node_story "https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/story"
click node_registries "https://github.com/funkincrew/funkin/tree/main/source/funkin/data"
click node_songdata "https://github.com/funkincrew/funkin/blob/main/source/funkin/data/song/SongData.hx"
click node_characters "https://github.com/funkincrew/funkin/blob/main/source/funkin/play/character/BaseCharacter.hx"
click node_modloader "https://github.com/funkincrew/funkin/blob/main/source/funkin/modding/PolymodHandler.hx"
click node_modules "https://github.com/funkincrew/funkin/blob/main/source/funkin/modding/module/ModuleHandler.hx"
click node_android "https://github.com/funkincrew/funkin/blob/main/source/funkin/external/android/java/funkin/extension/CallbackUtil.java"
click node_fnfc "https://github.com/funkincrew/funkin/blob/main/source/funkin/external/android/java/funkin/extension/FNFCExtension.java"
click node_datafolder "https://github.com/funkincrew/funkin/blob/main/source/funkin/external/android/java/funkin/provider/DataFolderProvider.java"
click node_newgrounds "https://github.com/funkincrew/funkin/blob/main/source/funkin/api/newgrounds/NewgroundsClient.hx"

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_game,node_songplay,node_song,node_notes,node_scoring,node_results toneBlue
class node_registries,node_songdata,node_characters toneAmber
class node_charts,node_menus,node_freeplay,node_story toneMint
class node_modloader,node_modules,node_android,node_fnfc,node_datafolder,node_newgrounds toneRose
class node_player,node_newgroundsservice toneIndigo
```

## Components

### Rhythm Gameplay

- [Funkin Game](https://github.com/funkincrew/funkin/blob/main/source/Main.hx): `source/Main.hx`
- [Song Play](https://github.com/funkincrew/funkin/blob/main/source/funkin/play/PlayState.hx): `source/funkin/play/PlayState.hx`
- [Song Runtime](https://github.com/funkincrew/funkin/blob/main/source/funkin/play/song/Song.hx): `source/funkin/play/song/Song.hx`
- [Notes and Strumlines](https://github.com/funkincrew/funkin/blob/main/source/funkin/play/notes/Strumline.hx): `source/funkin/play/notes/Strumline.hx`
- [Scoring](https://github.com/funkincrew/funkin/blob/main/source/funkin/play/scoring/Scoring.hx): `source/funkin/play/scoring/Scoring.hx`
- [Results](https://github.com/funkincrew/funkin/blob/main/source/funkin/play/ResultState.hx): `source/funkin/play/ResultState.hx`

### Game Content

- [Content Registries](https://github.com/funkincrew/funkin/tree/main/source/funkin/data): `source/funkin/data`
- [Song Data](https://github.com/funkincrew/funkin/blob/main/source/funkin/data/song/SongData.hx): `source/funkin/data/song/SongData.hx`
- [Characters and Stages](https://github.com/funkincrew/funkin/blob/main/source/funkin/play/character/BaseCharacter.hx): `source/funkin/play/character/BaseCharacter.hx`

### Menus and Tools

- [Chart Editor](https://github.com/funkincrew/funkin/blob/main/source/funkin/ui/debug/charting/ChartEditorState.hx): `source/funkin/ui/debug/charting/ChartEditorState.hx`
- [Game Menus](https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/mainmenu): `source/funkin/ui/mainmenu`
- [Freeplay](https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/freeplay): `source/funkin/ui/freeplay`
- [Story Mode](https://github.com/funkincrew/funkin/tree/main/source/funkin/ui/story): `source/funkin/ui/story`

### Modding and Platform

- [Mod Loader](https://github.com/funkincrew/funkin/blob/main/source/funkin/modding/PolymodHandler.hx): `source/funkin/modding/PolymodHandler.hx`
- [Script Modules](https://github.com/funkincrew/funkin/blob/main/source/funkin/modding/module/ModuleHandler.hx): `source/funkin/modding/module/ModuleHandler.hx`
- [Android Callbacks](https://github.com/funkincrew/funkin/blob/main/source/funkin/external/android/java/funkin/extension/CallbackUtil.java): `source/funkin/external/android/java/funkin/extension/CallbackUtil.java`
- [FNFC Import](https://github.com/funkincrew/funkin/blob/main/source/funkin/external/android/java/funkin/extension/FNFCExtension.java): `source/funkin/external/android/java/funkin/extension/FNFCExtension.java`
- [Data Folder Access](https://github.com/funkincrew/funkin/blob/main/source/funkin/external/android/java/funkin/provider/DataFolderProvider.java): `source/funkin/external/android/java/funkin/provider/DataFolderProvider.java`
- [Newgrounds Services](https://github.com/funkincrew/funkin/blob/main/source/funkin/api/newgrounds/NewgroundsClient.hx): `source/funkin/api/newgrounds/NewgroundsClient.hx`

### Other components

- **Player**
- **Newgrounds**

## Connections

- Player → Funkin Game: plays
- Funkin Game → Game Menus: opens
- Game Menus → Freeplay: offers songs
- Game Menus → Story Mode: offers story
- Freeplay → Song Play: starts song
- Story Mode → Song Play: starts song
- Song Play → Song Runtime: runs
- Song Play → Notes and Strumlines: handles notes
- Song Play → Characters and Stages: uses
- Song Play → Scoring: tracks score
- Song Play → Results: ends at
- Chart Editor → Song Data: edits charts
- Content Registries → Song Data: registers
- Mod Loader → Script Modules: dispatches
- FNFC Import → Android Callbacks: dispatches callback (evidence: `source/funkin/external/android/java/funkin/extension/FNFCExtension.java`)
- Player → Data Folder Access: browses files
- Newgrounds Services → Newgrounds: connects to
