Apollo Download ManagerApollo Download Manager
On this page

Naming conventions

Names follow each language's standard style, plus the project choices below. When this page doesn't cover a case, copy what the nearest existing code does, and add the case here in the same PR. Formatters and linters (cargo fmt, clippy, ESLint) enforce layout; this page covers what they can't.

Branch, commit and pull-request names are in DEVELOPMENT_WORKFLOW.md.

General

  • Use the domain words from the glossary, such as lease, coverage, validator and checkpoint. One concept has one name across Rust, TypeScript, docs and the UI contract. Don't use synonyms such as chunk for a lease or resumeData for a checkpoint.

  • Spell words out (download, not dl). Common abbreviations are fine: url, id, http, io, ui.

  • Booleans read as a question: is_paused, has_validator, canResume.

  • Units go in the name when the type doesn't carry them: timeout_ms, size_bytes, rateBytesPerSec.

Rust

These follow the Rust API guidelines on naming.

ItemStyleExample
Crateskebab-case with a velocity- prefixvelocity-core, velocity-desktop-v2
Modules and filessnake_casevalidation.rs, database/migrations.rs
Types, traits, enum variantsUpperCamelCaseAppInfo, DirectTransfer, DownloadStatus::Paused
Functions, methods, variablessnake_caseapp_info(), select_checks
Constants and staticsSCREAMING_SNAKE_CASEPRODUCT_NAME, MAX_URL_LEN
Conversionsas_/to_/into_ by cost and ownership; from_ constructorsto_record(), from_metadata()
Fallible constructorsparse_… or try_…, returning Resultparse_content_range()
Unit testsIn #[cfg(test)] mod tests beside the code; the name states the behaviouridentifier_differs_from_v1
Integration testscrates/<crate>/tests/<behaviour>.rstests/range_probe.rs

TypeScript and React

ItemStyleExample
Components and their filesPascalCase, one component per fileApp.tsx, DownloadList.tsx
Other modulescamelCaseappInfo.ts, formatSize.ts
HooksuseCamelCaseuseDownloads()
Functions and variablescamelCaseparseAppInfo(), windowHeading()
Types and interfacesPascalCase, no I prefixAppInfo
ConstantsSCREAMING_SNAKE_CASE for true constants, camelCase otherwiseMAX_VISIBLE_ROWS
TestsNext to the code as <module>.test.ts(x). describe names the unit, it states the behaviourappInfo.test.ts, it('rejects a response without a version')

The UI contract (between Rust and TypeScript)

ItemStyleExample
Tauri commandssnake_case, verb firstapp_info, add_downloads, get_snapshot
Eventsvelocity:// plus a kebab-case nounvelocity://snapshot
Error codesSCREAMING_SNAKE_CASE, stable once released; they describe the cause, not the screenINTEGRITY_CHECK_FAILED
Fields crossing the boundarysnake_case in Rust. The TypeScript side mirrors them as the contract (#25) decides—

Scripts, files and docs

ItemStyleExample
package.json scriptsgroup:actioncheck:fast, test:focused
Node scriptskebab-case.mjs, tests as <name>.test.mjscheck-pr.mjs, checks-lib.test.mjs
Top-level docsUPPER_SNAKE_CASE.mdDEVELOPMENT_WORKFLOW.md
Decision recordsNNNN-kebab-title.md0001-v2-direction.md
ResearchYYYY-MM-DD-kebab-title.md2026-10-21-libcurl-engine-research-r2.md
Environment variablesVELOCITY_ plus SCREAMING_SNAKE_CASEVELOCITY_DATA_DIR