How vaagnavanesyan/onyx works
Main Components
• Nx Workspace/Build System: At the highest level, represent Nx as the “orchestrator” that ties all projects together. Mention that it manages task execution, dependency graphing, and caching.
• Applications (Menu):
• “americano”, “latte”, “tea”: Each of these is generated as an application (with their corresponding e2e projects for end-to-end testing) that forms part of the “menu”. They are likely the entry points that users interact with.
• Libraries (Kitchen):
• “water”, “tea-leaves”, “espresso”: Standard libraries for internal use.
• “roasted-beans”, “ground-coffee”: These libraries are marked as publishable and bundled with tsc, indicating they might be consumed externally as well as by the applications.
• Testing Components: Include both unit (Jest-based library tests inside each project) and end-to-end tests (e2e projects found in the “menu” folder).
Relationships and Interactions
• That the applications (from the menu directory) depend on one or more libraries from the kitchen. For example, the “americano” app might rely on shared functionalities provided by these libraries.
• Testing environment separately by drawing connections from each application to its corresponding e2e test project.
• How Nx acts as the central tool that runs tasks across these projects (command-line generators, build tasks, and tests).
• Grouping or modular boundaries: the “menu” (apps) and the “kitchen” (libraries) are logically separate, with clearly defined communication contracts (via API calls or shared functions).
Architectural Patterns and Design Principles
• Monorepo Modular Architecture: Emphasize the separation of concerns between applications and libraries, following the modular monorepo approach.
• Generation and Consistency: The Nx CLI commands (as shown in the README) indicate a pattern where new applications and libraries are created with a standardized structure.
• Reusability and Publishability: Note that some libraries (“roasted-beans” and “ground-coffee”) are configured for publishing, suggesting a design that supports code reuse across projects.
Incorporate Technologies and Tools
• Nx Build System: Mention that Nx (with its caching, task orchestration, and remote caching potential) is central to how the system is built and maintained.
• Jest: All projects include Jest configuration files, so testing (both unit tests and e2e tests) is a critical component.
• ESLint and Prettier: The presence of these configuration files indicates a focus on code quality and styling across the monorepo.
• TypeScript: The tsconfig files in each project emphasize that the entire workspace is developed using TypeScript.
Overall Approach
• “menu” on one side (or as a separate layer) listing the Node applications, and “kitchen” on the other side listing the libraries.
• Applications to their underlying libraries, and also include test components.
• Boundaries where code generation, CI/CD configurations, and repository-level tools (like ESLint, Prettier, and Nx caching) are applied.