How povilaskarvelis/e2p-simulator works
Project Type and Purpose
• The project is a web-based simulator designed for quantitative, interactive exploration of effect sizes versus predictive utility. Its primary audience includes biomedical, behavioral science, and other research communities.
• The README outlines that users can interact with the simulator via a browser and that the tool is meant to help with interpretation of statistical metrics, research planning, and educational purposes.
Main Components
a. User Interface (UI) Layer:
– HTML files (index.html, get-started.html) present the simulator’s front end.
– CSS styles are located in the “css” directory, ensuring consistency in design (e.g., base.css, binary.css, continuous.css).
– Client-side JavaScript located in the “js” directory (binary.js, continuous.js, main.js, etc.) handles interactivity, calculations (e.g., effect sizes, predictive utilities), and shared utilities.
– Images (e.g., screenshots) enhance the visual layout.
b. Configuration and Build/Development Tools:
– package.json and package-lock.json to manage dependencies and scripts.
– Node.js is required, as indicated in the README.
– GitHub workflows in the “.github/workflows” directory including CI scripts (like draft-pdf.yml) to automate documentation or other build tasks.
c. Testing Framework:
– End-to-end tests reside in the “cypress” directory. These include:
• E2E test scripts within “cypress/e2e”
• Test fixtures (sample data) in “cypress/fixtures”
• Screenshots and support utilities in “cypress/screenshots” and “cypress/support”
– These components illustrate the testing infrastructure that validates functionality for both “binary” and “continuous” simulation tests.
d. Supporting Documentation and Research Files:
– “README.md” for project overview, setup, and usage instructions.
– “CONTRIBUTING.md” and “LICENSE” files for community collaboration.
– The “paper” directory contains the research document (paper.md) and associated bibliography (paper.bib), highlighting an academic research component that underpins the simulator’s concepts.
Architectural Relationships and Data Flow
• The browser (client) is the primary consumer of the application, loading the HTML, CSS, and JS which work together to provide the interactive simulation.
• The JavaScript components perform the core logic, such as rendering the simulation, calculating effect sizes, and updating the UI dynamically based on user input.
• There is a clear separation between presentation (HTML/CSS) and logic (JS), typical of client-side web applications.
• Testing with Cypress runs in a separate testing environment that simulates user interactions and validates the UI/logic workflow.
Architectural Patterns and Design Principles
• Frontend Architecture: The project follows a client-side application design. The separation of concerns is evident from distinct directories for HTML, CSS, and JavaScript.
• Automated Testing: Use of Cypress tests reflects an emphasis on quality and continuous integration, as evidenced by documented workflows in the ‘.github’ directory.
• Research Integration: The inclusion of a “paper” directory shows the project’s basis in academic research, linking theoretical concepts with practical simulation.
• Browser Client:
– HTML (index.html, get-started.html)
– CSS (base.css, binary.css, continuous.css)
– JavaScript (binary.js, continuous.js, main.js, utils.js, etc.)
• Testing Layer:
– Cypress tests (binary-tests.cy.js, continuous-tests.cy.js, etc.) and test fixtures.
• Build and CI/CD:
– Node.js/npm scripts and GitHub workflows.
• Documentation & Research:
– README, CONTRIBUTING, LICENSE, and Research Paper artifacts.