How skalskip/make-sense works
Project’s Core Purpose and Type
• The README makes it clear that makesense.ai is a browser-based tool for labeling photos. It is built using TypeScript with React/Redux and integrates on-device AI (e.g., YOLOv5, SSD, PoseNet via TensorFlow.js) to accelerate deep learning dataset preparation.
• Capturing the separation between the user interface (frontend) and the underlying logic (Redux store, AI integrations, rendering, and utilities).
Main Architectural Components
a. User Interface (Frontend Presentation Layer)
• Views: Represented by the many React components in the “src/views” directory (e.g., EditorView, MainView, PopupView, NotificationsView).
• Common components: Present in subdirectories like “Common” that include buttons, inputs, and navigation elements.
• Style: The SCSS files co-located with components indicate a strong focus on styling and user interactions.
b. State Management and Business Logic
• Redux Store: Components for actions, reducers, selectors are clearly delineated within “src/store” and “src/logic/actions”.
• Context and Global State: The “src/logic/context” directory suggests additional context management to handle aspects like editor and popup states.
• The initialization process is visibly handled in “src/logic/initializer/AppInitializer.ts” which sets up the application.
c. AI Integrations and Core Processing
• AI Module: The “src/ai” directory contains modules for different AI functionalities (PoseDetector, RoboflowAPIObjectDetector, SSDObjectDetector, YOLOV5ObjectDetector). These components bridge the gap between UI actions and TensorFlow.js-driven inference.
• AI Actions: There are dedicated actions (e.g., AIActions, AIPoseDetectionActions) that connect the AI modules with the Redux workflow.
d. Rendering & Visualization
• Render Engines: The “src/logic/render” folder holds different rendering engines (Rect, Polygon, Line, Point, and PrimaryEditorRenderEngine). This aspect is crucial for drawing labels and annotations on images.
• The “src/logic/imageRepository” supports image loading and management for annotations.
e. Data and Configuration Models
• Data Layer: The “src/data” structure (with files for EditorData, Import/Export formats, and various label configurations) provides definitions and configurations used throughout the app.
• Interfaces and Enums: Found in “src/interfaces” and “src/data/enums”, these ensure strong typing, which is critical for a TypeScript project.
f. Utility Functions and Helpers
• Numerous helper functions in “src/utils” support array operations, file handling, drawing, notifications, etc. These are utility classes that underpin many core functionalities.
g. Deployment and DevOps
• Docker: The “docker” directory houses the Dockerfile, implying containerization for deployment.
• CI/CD: The “.github/workflows” directory includes GitHub Actions for testing, code analysis, and documentation generation.
• Configuration: Files such as package.json, tsconfig.json, vite.config.ts, and eslint/tslint configurations illustrate the tooling behind the architecture.
Relationships and Interactions
• The React views dispatch actions (defined in “src/logic/actions”) to the Redux store, which then updates the state. Connectors (via selectors) allow the UI to react to state changes.
• AI modules are invoked through dedicated actions. For example, when a user initiates an AI-based detection, the corresponding AI action calls one of the detector classes (YOLOV5ObjectDetector, etc.) that process the image data and return predictions.
• The rendering engine in “src/logic/render” consumes both the labeling data and canvas details to display the results interactively.
• Utilities and helpers play a supporting role across these layers (e.g., handling file I/O, rendering calculations, and event management).
Architectural Patterns and Design Principles
• Separation of Concerns: The project clearly separates UI components, state management, business logic, and AI functions.
• Modular Design: Dedicated directories for AI models, render engines, and data definitions foster maintainability.
• Testability: The extensive “__tests__” folders indicate unit testing is an important aspect.
• Responsiveness: The presence of both “EditorView” and “MobileMainView” shows attention to cross-platform UI.