3.9 KiB
Recent Projects Feature
recent-projects is the full cross-process reference for
docs/FEATURE_ARCHITECTURE_STANDARD.md.
Use it as the local example when a feature owns contracts, pure business rules,
runtime composition, transport adapters, preload bridging, and renderer UI.
Read this with:
Feature Shape
src/features/recent-projects/
contracts/
core/
domain/
application/
main/
composition/
adapters/
input/
output/
infrastructure/
preload/
renderer/
This feature intentionally does not have a root index.ts. Production callers
enter through the layer-specific public entrypoints:
contracts/index.tsfor DTOs, channels, API fragments, and payload normalizationmain/index.tsfor main-process registration and compositionpreload/index.tsfor bridge creationrenderer/index.tsfor renderer-owned UI and public renderer utilities
Layer Examples
core/domain/policies/mergeRecentProjectCandidates.tsowns provider-agnostic merge policy and stays purecore/application/use-cases/ListDashboardRecentProjectsUseCase.tsorchestrates ports and response models without importing runtime detailsmain/composition/createRecentProjectsFeature.tswires infrastructure, adapters, ports, and use cases for the main processmain/adapters/input/ipc/registerRecentProjectsIpc.tsandmain/adapters/input/http/registerRecentProjectsHttp.tstranslate transport requests into feature callsmain/adapters/output/sources/*adapts provider/runtime data into the core modelmain/infrastructure/cache/InMemoryRecentProjectsCache.tsandmain/infrastructure/identity/*keep runtime-specific helpers out ofcore/preload/createRecentProjectsBridge.tsexposes the feature API fragment to the rendererrenderer/hooks/useRecentProjectsSection.tscoordinates renderer interaction and data accessrenderer/ui/RecentProjectsSection.tsxkeeps the visual component focused on rendering and callbacks
How To Extend It
When adding another source or provider:
- add or reuse a port in
core/application/ports/ - keep provider-specific parsing in
main/adapters/output/ormain/infrastructure/ - keep merge, ordering, dedupe, and selection rules in
core/domain/ - wire the new dependency in
main/composition/createRecentProjectsFeature.ts - add focused tests beside the layer that owns the behavior
When adding another transport:
- put shared request/response shape in
contracts/ - implement the input adapter under
main/adapters/input/ - keep handler registration out of
core/ - expose only the stable surface from
main/index.ts
When changing renderer behavior:
- keep data fetching and app API calls in hooks or renderer adapters
- keep UI components presentational
- transform DTOs into view models before they reach reusable UI where practical
- update renderer utility tests when sorting, navigation, active-team state, or client cache behavior changes
When updating this reference:
- keep examples tied to real files in this feature
- update this README when public entrypoints or intended extension paths change
- leave cross-feature architecture wording in the shared standard
Test Map
Reference tests live under test/features/recent-projects/:
contracts/covers payload normalizationcore/domain/covers merge policycore/application/covers use-case orchestration through portsmain/adapters/output/andmain/infrastructure/cover provider and runtime integration boundaries with fakesrenderer/adapters/andrenderer/utils/cover view-model mapping and interaction helpers
For new medium or large features, this test shape is a good starting point: domain rules first, application use cases second, then focused adapter and renderer utility coverage for behavior that can break user workflows.