How wewb/nomad works
Main Components
• Frontend (track-platform):
• A React-based application (notice the files under track-platform/src) using Vite for rapid development.
• Contains pages such as Login, Dashboard, ApplicationDetail, Documentation, and various tracking-related views.
• Responsible for rendering the user interface and interacting with the backend via API calls.
• Backend (track-server):
• Implements API routes, handles authentication, and manages business logic.
• The src/routes, src/models, src/middleware, and src/services directories indicate a Node.js/Express-style architecture.
• Responsible for receiving tracking events and handling data persistence (even if the database is abstracted via models).
• SDK (track-sdk):
• Provides the core tracking logic that can be integrated into websites or other clients.
• Contains the main tracking functions (track-point.ts) and type definitions to ensure type safety.
• Likely used both by the frontend and potentially by external systems wanting to use the tracking capabilities.
• Documentation and Requirements:
• The doc directory (and requirement docs) provides requirements/specifications which outline the intended behavior and possible integration concerns.
Relationships and Interactions
• The Backend interacts with storage or data persistence via its models (e.g., Application, Event, User) and employs middleware for authentication, validation, etc.
• The SDK (track-sdk) is the core library that encapsulates tracking logic. It can be visualized as an independent module that the Frontend (and possibly other clients) integrates with to report events or errors.
• Additionally, the data flow might include error reports, tracking events, and user activity logs that start at the frontend/SDK, travel to the backend, and are stored/processed.
Key Architectural Patterns and Design Principles
• Separation of Concerns: The frontend, backend, and SDK are clearly separated—each package serves a different responsibility.
• Modular Design: The SDK is built as an independent package, which highlights extensibility and reusability.
• API-driven Interaction: The frontend relies on REST API endpoints provided by the backend.
• Type Safety and Modern Tooling: With TypeScript files (.ts, .tsx) and configurations like tsconfig.json and vite.config.ts, modern tooling is employed to maintain code quality and consistency.
Technologies and Frameworks
• Frontend: React, TypeScript, Vite, and Less for styling.
• Backend: Node.js with an Express-like structure (using middleware, routes, and models), TypeScript.
• SDK: TypeScript-based library providing public APIs for tracking.
• Additional tools: HTTP server for SDK development, npm for package management (noted with package-lock.json files).