How kylemath/eegedu works
Project Type and Purpose
• EEGEdu is a front-end interactive web application built with React. Its purpose is to offer an educational playground where users can learn about and interact with different aspects of EEG (electroencephalogram) data.
• The app provides a curriculum broken into multiple “lessons” (e.g., tutorials on raw data viewing, frequency analysis, neurofeedback demos, etc.) delivered as separate interactive components.
File Structure
• The top-level directories and files indicate:
• Project configuration and deployment: Files like .env, firebase.json, app.yaml, and the GitHub workflows.
• A public folder (contains index.html and manifest.json) that serves as the container for the React application.
• A src directory where the bulk of the application code resides – notably, the /components folder contains React components.
• Under “src/components/PageSwitcher”, you see multiple subdirectories corresponding to different lessons (EEGEduIntro, EEGEduHeartRaw, EEGEduSpectra, etc.). Each of these contains a main component file and supporting translation and sketch files, suggesting that each module encapsulates a single feature or educational module.
• The PageSwitcher component itself acts like a router or a navigation hub between these lesson components.
README for Additional Insights
• The README explains the overall curriculum with step-by-step lessons each linked to a specific component.
• It details the deployment pipeline using Firebase and GitHub Actions and outlines local development and testing steps.
• The README highlights that the application runs in any modern web browser and explains the user flow from connecting via a Mock or real Muse headband to visualizing various EEG data experiments.
a. Main Components to Include:
• User/Client Browser: Represents the end-user accessing the application.
• Web Application (React Frontend): Encapsulate the core UI, broken down into:
• Entry Point (public/index.html and src/index.js)
• Main App Component (src/components/App) – includes general layout and translation support.
• PageSwitcher Component (src/components/PageSwitcher) – the central routing hub that manages lesson navigation.
• Lesson Modules: Each lesson (EEGEduIntro, EEGEduHeartRaw, EEGEduPredict, etc.) as individual components with their own internal structures (sketch files, translations, and any custom logic).
• Data Stream / EEG Data Processing Module: Although largely within the client code, the utils (e.g., mockMuseEEG.js) indicate that certain utilities are provided for handling the EEG data streams (both mock and real).
b. Relationships and Interactions:
• The User interacts via the browser with the React App, which in turn loads the App Component.
• The App dispatches navigation through the PageSwitcher, determining which lesson module to present.
• Each lesson/module receives data either from a simulated (mock) EEG data stream or directly from the Muse headband when connected.
• The communication is bidirectional; user events (e.g., slider changes or button clicks) trigger visual updates in the sketches (using libraries like p5.js) and data processing utilities.
• Deployment pipelines feed updated builds to Firebase Hosting, ensuring the latest version is available to users.
c. Architectural Patterns or Design Principles:
• Component-based architecture inherent to React.
• A clear separation of concerns: UI routing (via PageSwitcher), modularized educational lessons, and external utilities for EEG data handling.
• Localization support is evident (translations stored per component).
• Build and deployment automation emphasize a modern CI/CD approach.
d. Key Technologies, Frameworks, and Libraries:
• React (component-based UI design)
• Firebase (for hosting and deployment)
• Yarn/Node.js (for package management and building the app)
• p5.js or similar drawing libraries (as implied by the “sketch” files for interactive visualizations)
• Possibly Chart.js (referenced in README for charting needs)
• Muse headband connectivity libraries (as mentioned in the README references)