Architecture of bevyengine/bevy
bevyengine/bevy is 2,268 source files holding 51,473 symbols across 9 modules, written mainly in Rust, Kotlin, JavaScript. The largest module is crates, with 1,343 files, and 121 files are entry points into the dependency graph.
How bevy fits together
Application code enters through the public library entry point in src/lib.rs, which exposes the apps, systems, components and assets that a program is built from. The crates directory holds the core work, with small Rust crates that each implement a focused part of the engine, such as ECS-facing primitives, camera and visibility behavior, and transform propagation. Rendering and scene code lives in files such as crates/bevy_scene/src/lib.rs and crates/bevy_pbr/src/render/light.rs, which handle extraction for rendering and UI before the running application produces output. The examples directory contains runnable programs that show how these parts are used together, and benches/src/lib.rs provides shared setup for the per-area benchmark programs. Cargo.toml files describe the packages that make up the project.
Largest modules
- crates: 1,343 files and 398,518 lines of code
- examples: 470 files and 83,391 lines of code
- benches: 106 files and 8,935 lines of code
- tools: 35 files and 2,739 lines of code
- tests: 11 files and 1,272 lines of code
- .github: 5 files and 148 lines of code
- errors: 1 file and 18 lines of code
- src: 1 file and 19 lines of code
Languages
By file count: Rust 1,961 files, Kotlin 4 files, JavaScript 2 files, Makefile 2 files, Shell 2 files, TypeScript 2 files.
Documentation
Repowise documents bevy in 3,656 pages generated from the source, 104 of them written explanations of the repository and its modules. Module guides include:
- crates/bevy_animation/src: Animation Core Types
- crates/bevy_animation/macros/src: Animation Macros
- errors/src: Application Error Handling
More on bevy: summary and FAQ, codebase overview, code health.