| name | service-development |
| description | Build or update services in `app/features/services` using the `_template/service` conventions (container/store/structure/lib/constants) so code stays consistent with project rules. |
| metadata | {"short-description":"Service implementation workflow"} |
Service Development
When to use
- Creating a new service (copy
_template/service into app/features/services/<serviceName> and rename Sample placeholders).
- Updating container/store/structure/lib/constants for an existing service while keeping template rules intact.
- Removing an existing service and its wiring from store/actions via CLI.
Quick start
- Scaffold via CLI:
ill addService auth
- or
ill addService --name auth
- Add
--no-store if the service does not need a Redux slice/store wiring.
- Keep export surface the same (
index.tsx re-exports store/constants/lib and exposes { service: useContainer } from a lowercase export).
- Replace placeholder DTO/UI types, schemas, and data models; move every magic number/string into
constants/ and re-export via constants/index.ts.
- If the service is global (app-wide side effects), register it in the root ServiceInjector services list.
- Remove via CLI when needed:
ill removeService auth
- or
ill removeService --name auth
File roles and guardrails
Store and actions wiring
If you scaffolded without --no-store, the CLI will auto-inject:
- Reducer import + reducer key into
app/application/store/reducers.ts under // Services: Начало
- Actions binding into
app/utils/hooks/useAppActions.ts
If you scaffolded with --no-store:
- CLI will NOT inject reducer/hooks. Keep the service free of Redux usage (or wire it manually if you later add a slice).
Do not confuse templates
- repo root
_template/service/*: scaffolding templates used by ill addService
- widget-local
templates/*: UI decomposition pieces used by widgets (not applicable to services)
Final checks
- Comments preserved/updated per template; no inline magic values; types/mappers/schemas/constants live in their dedicated files.
- Export name casing: service export is lowercase in
index.tsx.
- If the service is app-global: it is included in the
ServiceInjector list in /app/root.tsx.