I would like to propose the creation of a comprehensive style guide and contribution reference for OpenELIS Global — one that spans the entire tech stack: backend, frontend, integration, and E2E tests, dataset conventions, and our UI design system.
As OpenELIS continues to grow and more contributors get involved, maintaining consistency across our stack will improve maintainability, reduce friction for new devs, and ensure smoother PR reviews.
what to cover in the guide:
Backend
- Naming conventions (classes, fields, services)
- Folder structure and layering
- Exception handling, logging, and validation patterns
- Integration test structure using datasets + DBUnit
Datasets
- Naming conventions and organization
- Minimal, clean test data principles
- Use of schema validation
Frontend (React)
-
Component Structure and Folder Layout
-
Organize components by domain or feature, not by type (e.g., group
PatientHeader
,ConfirmPopup
, etc. under common or relevant feature folders). -
Each component lives in its own
.js
file, and related.css
(if needed) lives alongside or in a common styles folder.
Naming Conventions
- Component names use
PascalCase
. - File names match the component (e.g.,
CytologyCaseView.js
). - Props should be descriptive and camelCased.
- Contexts use
SomethingContext
oruseSomething
naming patterns.
Styling Guidelines
- Use plain
.css
files; no CSS-in-JS - Reuse styles through shared CSS files where possible (
PathologyDashboard.css
). - Use BEM or scoped class naming to avoid global class conflicts.
Carbon Design System Integration
- Use components directly from
@carbon/react
. - Always prefer Carbon-provided components unless business logic demands custom implementation.
- Respect Carbon’s accessibility and responsive layout practices.
- For icons, use only what’s available in
@carbon/react/icons
.
Other Principles
- Use
react-intl
for all user-facing strings. - Favor state colocation via hooks (
useState
,useEffect
,useRef
) — no external state managers like Redux unless absolutely necessary. - Maintain clean separation of business logic and presentation within components.
E2E Testing (Cypress)
- Naming structure and file organization
- Setup and teardown practices
- Interaction with test data / mocking vs real data strategy
Documentation & Dev Process
- PR hygiene and checklist
- Branch naming, commit message best practices
- Prettier, ESLint, Spotless, and CI formatting enforcement
Initial Steps:
- Create a Style guide in an OpenELIS Wiki.
- Link it in
CONTRIBUTING.md
and inPULL_REQUEST_TEMPLATE.md
. - Provide small usage examples and link to tooling configs.