How thepurpleone/magtrix works
Main Components
• Front End (User Interface):
– Component: React web application in “src/web/tictactoe/frontend”.
– Role: Displays the game board, processes player interactions, and sends move commands.
• Back End (Game Server API):
– Component: Python server in “src/web/tictactoe/backend”.
– Role: Acts as a bridge between the UI and hardware; receives commands from the frontend and forwards them to the MCU.
• MCU Firmware:
– Component: Firmware (in “src/mcu/tictactoe” and “src/mcu/firmware” for other parts) that handles game move commands.
– Role: Receives move instructions from the backend and drives the electromagnetic coils on the PCB; may include microcontroller scheduling (e.g., via FreeRTOS) and real-time control mechanisms.
• Hardware / PCB:
– Component: Custom PCB designs (e.g., “pcb/magtrix”, “pcb/coil_driver” and others) created using KiCad.
– Role: Physically controls the board’s magnetic elements. The design files and KiCad libraries indicated in the tree help generate schematics and layout files.
• Supporting & Simulation Tools:
– Additional areas include simulation scripts (under “simulation”) and KiCad automation scripts (under “src/kicad_scripts”) that help test and generate PCB/design outputs.
– These tools provide insight into how the hardware may be simulated before fabrication.
Relationships and Data Flow
• The Front End sends player move commands to the Back End.
• The Back End processes the game logic and then communicates with the MCU.
• The MCU Firmware receives commands (e.g., via a serial or similar communication protocol) and activates specific coils on the PCB.
• The physical PCB (designed in KiCad, with coil drivers and associated electronics) receives the actuations, moving the magnetic game pieces.
• Optionally, simulation tools allow for virtual testing of the Coil responses before actual manufacturing.
Final Checklist
• Clear labels for each main block/component.
• Annotations where necessary (e.g., list of frameworks: “React” in frontend, “Python” in backend, “C/FreeRTOS” in MCU firmware, “KiCad” for PCB).
• Optionally, include smaller blocks for simulation/automation if detail is needed.