How merjoon/merjoon-core works
Project Type and Purpose
• This is a backend/core library (no UI) focused on “integrations.”
Main Architectural Components
a. CLI/Entry Point (“verify” module)
b. Service‐Factory & Dispatcher
c. Individual Integration Modules (ClickUp, GitLab, Jira, …)
– Subcomponents per integration: API client, Service logic, Transformer, Consts, Types
d. Common Library Code
– HttpClient (handles HTTP requests/retries)
– MerjoonTransformer (applies shared transformations)
– Shared consts/types
f. Output Sink
– “.transformed” directory
Component Relationships and Data Flow
1. Developer runs npm run verify:<integration> → invokes ts‐node src/verify/index.ts.
2. Entry Point loads environment, then calls ServiceFactory with the chosen IntegrationId.
3. ServiceFactory returns the specific integration‐service instance implementing a common interface.
4. Integration‐Service uses Api module + Common HttpClient to call the external API.
5. Raw API response flows through the integration’s Transformer, producing Merjoon‐standard JSON.
6. The transformed data is written to the .transformed/<integration> folder.
Architectural Patterns and Principles
• Strategy/Factory Pattern: ServiceFactory selects and returns the correct integration module.
• Layered Architecture per Integration: API → Service → Transformer.
• Shared Infrastructure: common HTTP client and transformation utilities reduce code duplication.
• Plugin‐style extensibility: adding a new integration involves dropping in a new module under src/verify/services and wiring it into the factory.
Technologies and Frameworks to Annotate
• Node.js + TypeScript
• ts‐node (for CLI execution)
• Jest (for tests, e2e suites for each integration)
• ESLint / Husky (static‐analysis, pre‐commit hooks)