2.7 KiB
Repository Guidelines
Project Structure & Module Organization
This workspace contains two independently versioned applications:
fe-digitaltwin-v2/is the React 18 + TypeScript frontend. Put routes insrc/pages/, reusable UI insrc/shared/components/, application features insrc/features/, state insrc/store/, and static files inpublic/.be-ircfa/is the Python 3.11+ FastAPI service. API domains live undersrc/(for example,src/rag/andsrc/root_cause/); keep each domain's router, model/schema, and service together. Tests live intests/, with unit tests intests/unit/.
Both directories have their own Git repository; run Git commands from the application being changed.
Build, Test, and Development Commands
Run commands from the relevant application directory.
cd fe-digitaltwin-v2 && npm installinstalls frontend dependencies.npm run devstarts Vite at port 3002;npm run buildtype-checks and creates the production bundle;npm run lintruns ESLint;npm run previewserves the built bundle.cd be-ircfa && make installinstalls Poetry dependencies,make runstarts the service, andmake testrunspytest tests/unit/with the project onPYTHONPATH.
Coding Style & Naming Conventions
Follow the backend .editorconfig: four spaces, LF endings, trimmed trailing whitespace, and a final newline (tabs in Makefile). Use snake_case for Python modules and functions; group backend code by feature with files such as router.py, service.py, and model.py.
Use TypeScript for frontend changes. Components and page files use PascalCase (for example, DashboardPage.tsx); hooks use the use- / use pattern (for example, use-debounce.tsx). Prefer configured @/ aliases over deep relative imports, and reuse existing design-system components and tokens. Run ESLint before submitting frontend changes.
Testing Guidelines
Add or update backend pytest coverage alongside behavioral changes; name test files test_*.py and tests test_*. Run make test before review. The frontend currently exposes lint and production-build checks rather than a test script, so run both npm run lint and npm run build for frontend work.
Commit & Pull Request Guidelines
Frontend history commonly uses Conventional Commit prefixes such as feat:, fix:, and chore:; use concise imperative subjects (for example, feat: add RCFA export filter). Keep commits scoped to one application and concern. Pull requests should explain the user-visible change, list validation performed, link the relevant issue when available, and include screenshots for UI changes. Do not commit secrets, local .env files, debug exports, or generated build output.