How s0t0e0f0a0n/molecular-merge-and-match works
Molecular Merge and Match is a desktop-hosted NMR structure-elucidation learning tool. Students load an exercise, select or create molecular fragments, associate fragments with ¹H/¹³C peaks, merge fragments into a candidate molecule, and check the result against the exercise solution. The frontend also provides exercise authoring/import, spectra viewing, progress and logbook features, and settings. Electron starts the local API backend; the API serves exercise and chemistry data backed by SQLite. The README documents additional domain capabilities whose detailed implementation was not sampled, so their internal wiring is shown only where supported by the API structure.
Main entry points: MolecularBookkeepingPage.tsx Bookkeeping workspace · session.py Database session · MoleculeWorkspace.tsx Fragment editing · warnings.py Warning checks
Components 30
Desktop runtime
- Electron host
main.js - React application
frontend/src/App.tsx
Elucidation workflow
- Bookkeeping workspace
frontend/src/features/layout/MolecularBookkeepingPage.tsx - Exercise state
frontend/src/context/ExerciseDataContext.tsx - Spectra viewing
frontend/src/features/viewingSpectra/SpectraPrototype.tsx - Fragment editing
frontend/src/features/molecule/MoleculeWorkspace.tsx - Fragment operations
frontend/src/hooks/useFragments.ts - Fragment library
frontend/src/features/molecule/PredefinedFragmentMenu.tsx - Peak-fragment linking
frontend/src/hooks/useLinking.ts - Working fragments
frontend/src/features/linking/WorkingFragmentsStrip.tsx - Molecule merging
frontend/src/utils/mergeFragments.ts - Candidate solution
frontend/src/features/solution/WorkingSolutionPanel.tsx - Chemistry warnings
frontend/src/hooks/useLinkedFragmentWarnings.ts
Learning support
- Logbook and progress
frontend/src/features/history/LogbookPanel.tsx - Statistics
frontend/src/features/statistics/StatisticsPanel.tsx - Exercise authoring/import
frontend/src/features/exercises/ExerciseCreationForm.tsx - Settings
frontend/src/features/settings/SettingsPanel.tsx
API and persistence
- FastAPI application
backend/app/main.py - Exercise management
backend/app/api/exercises.py - Fragment API
backend/app/api/fragments.py - Predefined fragments
backend/app/api/predefined_fragments.py - Solution API
backend/app/api/working_solution.py - Warning checks
backend/app/api/warnings.py - Chemistry calculations
backend/app/core/calculation.py - Logbook API
backend/app/api/logbook.py - Statistics API
backend/app/api/statistics.py - Settings API
backend/app/api/settings.py - Database session
backend/app/db/session.py - SQLite data
backend/app/db/models.py
Other components
- Student
Connections 33
- Student → React application: uses
- Electron host → FastAPI application: starts backend
- React application → Bookkeeping workspace: renders
- Bookkeeping workspace → Exercise state: reads exercise state
- Bookkeeping workspace → Spectra viewing: shows spectra
- Bookkeeping workspace → Fragment editing: opens editor
- Bookkeeping workspace → Working fragments: shows fragments
- Bookkeeping workspace → Peak-fragment linking: manages links
- Bookkeeping workspace → Candidate solution: presents candidate
- Fragment editing → Fragment operations: edits fragments
- Fragment operations → Fragment API: fetches and mutates
- Fragment editing → Fragment library: selects fragments
- Fragment library → Predefined fragments: searches library
- Working fragments → Molecule merging: merges structures
- Bookkeeping workspace → Chemistry warnings: checks assignments
- Chemistry warnings → Warning checks: submits checks
- Warning checks → Chemistry calculations: calculates chemistry
- Bookkeeping workspace → Exercise management: loads exercises
- Candidate solution → Solution API: stores candidate
- Logbook and progress → Logbook API: loads progress
- Statistics → Statistics API: requests statistics
- Exercise authoring/import → Exercise management: creates or imports
- Settings → Settings API: reads and updates
- FastAPI application → Database session: initializes database
- Exercise management → Database session: accesses records
- Fragment API → Database session: accesses records
- Predefined fragments → Database session: reads library
- Solution API → Database session: accesses records
- Logbook API → Database session: accesses records
- Statistics API → Database session: accesses records
- Settings API → Database session: accesses records
- Warning checks → Database session: reads exercise data
- Database session → SQLite data: reads and writes