How jameswong3388/notemercy_extension works
Main Components
• Frontend: A Next.js application that uses Tailwind CSS and modern frontend libraries (as seen by the Next.js configuration, pages, and an extensive components library).
• Backend API: A Python FastAPI server (api.py) that provides endpoints for receiving handwriting test cases, communicating with the frontend, and invoking handwriting analysis.
• Analysis Libraries: These consist of both MATLAB/M (“.m”) and Python (“.py”) modules organized under backend/lib, backend/lib_py, and backend/legacy. They represent specific analyzers for different handwriting styles (block lettering, calligraphic, cursive, italic, print, and shorthand).
• Test Datasets: The “backend/atest” directory that holds sample handwriting images for testing various handwriting styles.
Relationships and Interactions
• Web Client (Frontend) makes API calls to the Backend.
• The Backend (FastAPI server) handles requests, dispatching them to specific analysis routines by leveraging libraries from lib, lib_py, and legacy.
• The analysis libraries, split by handwriting style, are the computational core. They compute features like angularity, aspect ratio, slant angle, connectivity, and more.
• Test datasets feed into the backend for either training or validating the analysis modules.
Architectural Patterns and Design Principles
• Separation of Concerns: Clear distinctions between the presentation layer (frontend) and processing/logic layer (backend).
• Modular Design: The backend is modularized into multiple analyzers, each dedicated to a specific handwriting style.
• API-Driven Communication: The frontend and backend interact through defined API endpoints (with CORS support mentioned in the README).
• Client: “Next.js Frontend” (include references to Tailwind CSS and any UI components if desired)
• API Server: “FastAPI Backend”
• Analysis Libraries: “Handwriting Analysis Modules” (subdivide into:
· block lettering,
· calligraphic,
· cursive,
· italic,
· print,
· shorthand)
• Test Data: “Test Datasets (atest)”
• From the Frontend to the Backend (indicate API calls, data requests, and responses).
• From the Backend to the Analysis Libraries (indicate function calls or module integrations).
d. Elaborate on any configuration or helper modules if needed (such as helper.py, atest, and legacy modules).