Appearance
π Naming Conventions β project-tree
β
This document defines the naming conventions used to assign semantic meaning to files and folders during project-tree
analysis.
These conventions support:
- Static code analysis
- Code navigation and documentation
- Consistent onboarding and architecture
π Table of Contents β
π File Naming Conventions β
File Name / Suffix | Semantic Meaning | Role Type |
---|---|---|
mod.ts | Module entry point | Module |
main.ts | Primary executable script | ExecutableEntryPoint |
index.ts | Node/React-style module entry | Module |
types.ts | Type and interface definitions | TypeDefinition |
constants.ts | Global constants | ConstantDefinition |
config.ts | Module or app configuration | ModuleConfig |
deps.ts | External dependencies (Deno) | ExternalDependencies |
dev_deps.ts | Dev-only dependencies (Deno) | DevDependencies |
*.test.ts , *.spec.ts | Unit or integration test | TestFile |
*.mock.ts | Mocked data / fake implementations | MockFile |
controller.ts | API / CLI / UI controller logic | Controller |
service.ts | Business logic | Service |
router.ts | HTTP route definitions | Router |
utils.ts , helpers.ts | Generic helper functions | ToolBox |
setup.ts | One-time init or seed script | SetupScript |
template.ts | Template content (non-executable) | TemplateFile |
.schema | JSON schema definition | SchemaFile |
README.md | Project readme | ProjectReadme |
LICENSE | Legal notice | LegalNotice |
π Folder Naming Conventions β
Folder Name | Semantic Meaning | Role Type |
---|---|---|
lib/ | Technical utilities / abstractions | TechFolder |
api/ | Business logic (application layer) | BusinessFolder |
apps/ , app/ | Executable applications | AppsFolder |
cli/ | Command-line interface implementation | CommandLineInterfaceFolder |
ext/ | External modules or plugins | ExternalModulesFolder |
tests/ | Manual or automated tests | TestFolder |
mocks/ | Shared mocks (test/dev) | MockFolder |
scenarios/ | Usage or test scenarios | TestScenarioFolder |
examples/ | Usage examples / code snippets | DocumentationExampleFolder |
config/ | Project or module configuration | ConfigurationFolder |
bin/ | CLI executables or tools | CommandsFolder |
processes/ | Modular business/technical processes | ProcessesFolder |
domains/ | DDD-style domain folders | DomainFoldersCollection |
doc/ , docs/ | Markdown documentation and diagrams | DocumentationFolder |
src/ | Source root if no higher-level folders are used | SourceRoot or --ignored-- |
βΉοΈ
src/
is only treated asSourceRoot
when folders likeapps/
,lib/
,domains/
are missing.
π Variants and Aliases β
These are recognized equivalences across projects:
Alias A | Treated as |
---|---|
utils/ | helpers/ |
domain/ | domains/ |
app/ | apps/ |
doc/ | docs/ |
mocks/ | __mocks__/ |
β Special Cases and Rules β
β Flat file naming β
Files like:
txt
user.controller.ts
auth.router.ts
utils/math.ts
β¦are interpreted by their suffix (.controller.ts
, .router.ts
), not their prefix.
This allows scalable flat layouts without ambiguity.
β Ambiguity fallback β
If a file or folder doesnβt match any convention, it will be treated as --untyped--
or ignored by semantic tools. Always prefer naming explicitly.
π§ͺ Supported Additional Files β
File or Folder | Semantic Meaning | Role Type |
---|---|---|
*.mock.ts | Test or development mock file | MockFile |
mocks/ | Directory for reusable mocks | MockFolder |
scenarios/ | End-to-end or testing scenario data | TestScenarioFolder |
examples/ | Usage documentation by code | DocumentationExampleFolder |
π Example Project Tree β
project-root/
βββ apps/
β βββ web/
β βββ main.ts
β βββ web.controller.ts
β βββ web.service.ts
βββ lib/
β βββ constants.ts
β βββ config.ts
β βββ helpers.ts
βββ domains/
β βββ user/
β βββ types.ts
β βββ user.service.ts
βββ tests/
β βββ user.test.ts
βββ mocks/
β βββ user.mock.ts
βββ examples/
β βββ user.example.ts
βββ deps.ts
βββ dev_deps.ts
βββ README.md
βββ LICENSE
β Conclusion β
This convention helps to:
- Maintain consistent and predictable project trees π§
- Improve tooling and semantic code analysis π€
- Align developer expectations across repositories π€
Use it as a base, extend it carefully β and document your extensions.