How jichao99/check-keywords works
Main Components
• API Gateway (CheckKeywordsGateway): This project holds the controllers (e.g., CheckController.cs) and is responsible for handling HTTP requests, configuration (via Startup.cs and appsettings.json), and integrating middleware (like Swagger/OpenAPI support) for API documentation.
• Mobile Clients (CheckKeywordsMobile): This solution contains multiple platform-specific projects including Android, iOS, Windows, macOS, and also a Blazor web project packaged under CheckKeywordsMobile. Each sub-project (like CheckKeywordsMobile.Android, CheckKeywordsMobile.iOS, etc.) represents a native viewer that communicates with the API.
• Shared Library (CheckKeywords/Shared): This library defines the core business logic, models (such as CheckResult, KeyWords, LanguageWordsItem), handlers (e.g., CheckKeywordsHandler, JsonHandler, OpenAPIHandler, etc.), and data files (keywords.json). This abstraction is used both by the backend and potentially by other consumers.
• External Clients: For command line interaction (using curl or Powershell) that call the exposed REST endpoints directly.
Relationships and Interactions
• All client applications (Blazor web UI, mobile clients, and CLI tools) send HTTP requests to the API Gateway.
• The API Gateway routes these requests to the proper controller action where business logic is executed—often relying on the Shared library for processing the keyword check.
• The Shared library encapsulates the domain logic (keyword checking, file‑based configurations from keywords.json, etc.) and is used throughout the project.
• Mobile and web clients render results returned via the API.
Architectural Patterns and Design Principles
• Separation of Concerns: The solution is clearly split into UI (web/mobile), service (gateway/API), and business logic (shared library).
• Multi-platform / Cross-client design: Different client projects (Blazor, Android, iOS, Windows, macOS) are built and deployed according to target platforms, but they all leverage the same backend REST API.
• RESTful communication: The API Gateway exposes RESTful endpoints that are consumed by various clients.
• Testing: Separate test projects are present (under CheckKeywords/Test) to validate functionality, suggesting an emphasis on test-driven development.
Key Technologies, Frameworks, and Libraries
• .NET/ASP.NET Core: Used for the API Gateway and Shared library with controllers and startup configuration.
• Blazor: For building interactive web UIs.
• Mobile Frameworks: Likely Xamarin or MAUI style components for Android, iOS, Windows, and macOS projects.
• JSON processing: The system is migrating to use System.Text.Json.
• Swagger/OpenAPI: For API documentation and client generation integration.
• Testing frameworks: Likely NUnit or xUnit for handling the tests located in the Test project directories.