Skip to content
CAI
Software that uses CAICheck a score

Gramli/FileApi

49.8

Weak · 8 November 2026

1.4k

lines of production code

C#

with TypeScript

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a file management application built with a .NET 10 backend and an Angular 22 frontend, designed to handle file uploads, downloads, and format conversions. It supports specific data formats including JSON, XML, YAML, TXT, and CSV, allowing users to convert between these types and export files in various structures. The architecture follows a layered approach with core domain logic, infrastructure for in-memory storage, and a comprehensive test suite covering unit, integration, and system levels.

How it got here

2022 — File API implementation and .NET 10 upgrade

22 changes.

This period focused on introducing the File.API service, implementing a full suite of features for file upload, storage, and format conversion between JSON, XML, and YAML. Concurrently, the project upgraded its backend to .NET 10 and frontend to Angular 22, while adding Windows-specific launch scripts and expanding project documentation.

2023–2024 — Frontend integration and test coverage

7 changes.

This period focused on delivering the initial Angular frontend for file management and establishing a robust testing strategy across unit, integration, and system levels. The work included adding localized error resources, migrating the solution structure, and implementing comprehensive test suites to verify end-to-end file operations.

Features

Add domain extension methods for enumerables, file names, and error handling

This change introduces new extension methods in the File.Domain layer to simplify common operations. EnumerableExtensions adds ForEach, ForEachAsync, and HasAny helpers for iterating and checking collections. FileNameExtensions provides GetFileExtension to extract file extensions from strings. FluentResultExtensions adds ToErrorMessages and JoinToMessage to convert and format error lists from FluentResults into user-friendly strings.

src/File.Domain/Extensions · high confidence

Add file upload command handler

Introduces the AddFilesCommandHandler, which processes file upload requests by validating input, persisting files via the repository, and returning a response that includes any errors encountered during the save process.

src/File.Core/Commands · high confidence

Add localized error message resources for file operations

Introduced strongly-typed resource classes and corresponding ResX files to provide localized error messages for file infrastructure operations. Users will now see specific, localized feedback for scenarios such as conversion failures, empty conversion data, and non-existent file IDs, improving clarity when these errors occur.

src/File.Infrastructure/Resources · high confidence

Added database entities and context for file storage

Introduced a new Entity Framework Core setup for managing file data, including a \FileEntity\ model with properties for ID, file name, content type, and binary data, along with a \FileContext\ DbContext to expose the file collection as a DbSet.

src/File.Infrastructure/Database/EFContext · high confidence

Added logging and CORS configuration extensions

The API now includes extension methods to configure console-only logging and a specific CORS policy. Users can enable logging via the new AddLogging method and apply a CORS policy that allows requests from http://127.0.0.1:4200 and http://localhost:4200 with any header and method.

src/File.API/Configuration · high confidence

Added query models for file conversion, download, and export operations

The File.Domain/Queries location now includes three new query classes: ConvertToQuery, DownloadFileQuery, and ExportFileQuery. ConvertToQuery accepts an IFileProxy and a target extension, enabling the initiation of file format conversion. DownloadFileQuery and ExportFileQuery both accept an integer ID, with ExportFileQuery additionally specifying a target extension, supporting distinct download and export workflows.

src/File.Domain/Queries · high confidence

Added solution launch configuration and migrated to .slnx format

Developers can now use the new FileSol.slnLaunch file to start both the File.API and File.Frontend projects simultaneously with their respective debug targets (HTTPS for the API and localhost Chrome for the frontend). The solution structure has also been migrated to the new .slnx format (FileSol.slnx), which organizes the project hierarchy including the new frontend project, core domain/core/infrastructure/API projects, and the various test suites (Unit, Integration, System).

src · high confidence

Configures file conversion and in-memory database services

The infrastructure layer now registers the file conversion pipeline (encoding factory, file conversion factory, and conversion service) and sets up an in-memory Entity Framework Core database with associated repositories. This enables file upload and conversion capabilities within the application using a transient in-memory data store.

src/File.Infrastructure/Configuration · high confidence

Defines core file management abstractions and validation contracts

This change introduces the interface contracts for the file service layer, establishing the structure for handling file operations. It defines handlers for adding files, downloading, exporting, retrieving file info, and converting formats, all integrated with the SmallApiToolkit request handling pattern. Additionally, it specifies validation interfaces for commands and queries, a repository interface for file persistence, and a service interface for file conversion and export logic.

src/File.Core/Abstractions · high confidence

Implement file storage and retrieval repositories

Added FileCommandsRepository and FileQueriesRepository to handle file persistence and querying. FileCommandsRepository now supports adding new files to the database via AddFileAsync, while FileQueriesRepository provides methods to retrieve individual files by ID (GetFile) and list file metadata (GetFilesInfo), utilizing Mapster for DTO mapping and FluentResults for error handling.

src/File.Infrastructure/Database/Repositories · high confidence

Initial Angular frontend for file management

The \src/File.Frontend\ directory now contains a complete Angular application that provides a user interface for uploading, downloading, converting, and exporting files. The app features a main dashboard displaying a table of files with actions to download, download as JSON, export, and convert, utilizing a modal to select the target format for conversion and export. It integrates with a backend API (configured for \https://localhost:7270/v1/file\) via HTTP services, supports internationalization through \@ngx-translate/core\ with English assets, and uses Bootstrap for styling and \gramli-angular-notifier\ for user feedback. The project is scaffolded with standard Angular configuration files, including TypeScript configs, Karma test setup, and VS Code launch tasks.

src/File.Frontend · high confidence

Initial core service registration for file operations

The application now registers the core file management services via the \AddCore\ extension method. This includes dependency injection bindings for command and query handlers (add, get info, download, export, and convert) as well as validation rules for these operations using the Validot library.

src/File.Core/Configuration · high confidence

Initial release of File.API with file upload and format conversion settings

The File.API service is introduced, providing the entry point for file upload functionality. The application is configured to support specific file formats (XML, YAML, JSON, TXT, CSV) with defined content types and export capabilities (e.g., XML can be exported to JSON or YAML). It includes CORS configuration, Swagger UI for API exploration in development, and an exception middleware for error handling.

src/File.API · high confidence

Introduce file format conversion service for JSON, XML, and YAML

The File Infrastructure layer now includes a new file conversion capability, allowing users to convert files between JSON, XML, and YAML formats. This change introduces a \FileConversionService\ that utilizes specific converters (e.g., \JsonToXmlFileConverter\, \XmlToJsonFileConverter\) and an \EncodingFactory\ to handle character encoding detection. The system supports conversions such as JSON to XML, JSON to YAML, XML to JSON, XML to YAML, and YAML to JSON, returning the converted content as a new file proxy.

src/File.Infrastructure/FileConversions · high confidence

Introduce file upload configuration options

Added new configuration classes, FilesOptions and AllowedFile, to define file upload settings. Users can now configure the maximum allowed file length and specify a list of allowed file formats, including their content types and supported export formats, via the FilesOptions structure.

src/File.Domain/Options · high confidence

Introduces file query handlers for download, export, conversion, and info retrieval

The File.Core module now exposes handlers for retrieving and manipulating files via the SmallApiToolkit. Users can download files, export them to different formats, convert file types, and retrieve a list of file information. These handlers integrate validation (via Validot), dependency injection extensions, and mapping (Mapster) to process requests and return standardized HTTP responses.

src/File.Core/Queries · high confidence

Introduction of FormFileProxy for file handling abstraction

The API layer now includes a FormFileProxy class that implements the IFileProxy interface, providing a standardized way to interact with uploaded form files. This component exposes file metadata such as content type, length, and name, and supports asynchronous data retrieval and stream copying, enabling consistent file processing across the application.

src/File.API/Files · high confidence

New DTOs have been added to the domain layer to represent file data and metadata. This includes a base abstract class (BaseFileDto) defining common properties like file name, content type, and length, along with specific implementations for binary data (FileDto), string content (StringContentFileDto), and stored file information (FileInfoDto). These types provide the structured data contracts used for file handling within the application.

src/File.Domain/Dtos · high confidence

Introduction of structured logging event identifiers

A new LogEvents class has been added to the File.Domain.Logging namespace, defining specific integer constants for various file operation scenarios. These constants categorize error codes for adding files (general, stream, and database errors), retrieving files (general, stream, database, and validation errors), exporting files (general and validation errors), and converting files (general error). This change provides a standardized way to identify and handle specific logging events within the file management domain.

src/File.Domain/Logging · high confidence

New Windows launcher script and updated project documentation

Developers on Windows can now use the new run.ps1 script to build and launch both the .NET backend and Angular frontend in separate command windows, with support for options like watch mode, specific launch profiles, and dependency restoration. The project documentation has been significantly expanded to include installation steps, prerequisites (.NET SDK 10, Node.js, Angular CLI 22), and detailed instructions for running the solution via PowerShell or Visual Studio, alongside badges for build status and code quality.

(repo-wide) · high confidence

New file management API endpoints

The File API now exposes a comprehensive set of endpoints for managing files, including uploading files, downloading them in binary or JSON format, retrieving file information, exporting files to different extensions, and converting file formats. These endpoints are grouped under the 'file' route and utilize the SmallApiToolkit for response handling.

src/File.API/EndpointBuilders · high confidence

Behavioural changes

Added localized error and validation message resources

The File.Core module now includes strongly-typed resource classes and corresponding .resx files for error and validation messages. This introduces specific user-facing feedback for file operations, including messages for unsupported conversions, empty files, maximum file size limits, invalid requests, and failures during file reading, saving, exporting, or converting.

src/File.Core/Resources · high confidence

Adds validation for file upload, conversion, download, and export operations

The File.Core.Validation module now enforces strict validation rules for file operations. Uploading files is validated against allowed content types, maximum file size, and empty-file checks. Converting files validates that the source and destination extensions are supported and that the conversion is permitted. Downloading and exporting files require a valid file ID. These checks prevent unsupported formats, oversized uploads, and invalid conversion requests.

src/File.Core/Validation · high confidence

Support for YAML file serving and standardized JSON file responses

The API now supports serving YAML files by registering the text/yaml MIME type in the static file provider, and introduces a standardized response handler that wraps file data into a JSON structure containing base64-encoded content, content type, filename, and length.

src/File.API/Extensions · high confidence

Test coverage

Added integration tests for file format converters; Added system tests for File API endpoints; Added test helper extensions for system tests; Added unit tests for File Core and Infrastructure components.

Dependencies

Upgrade to .NET 10 and Angular 22 with centralized package management

The backend projects have been upgraded to target .NET 10.0, and the frontend has been upgraded to Angular 22.2.2. To support this, the solution now uses centralized package version management via \Directory.Packages.props\, and the backend dependencies have been updated to versions compatible with .NET 10, including SmallApiToolkit 10.0.0, Microsoft.AspNetCore.OpenApi 10.0.0, and Microsoft.EntityFrameworkCore.InMemory 10.0.0.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 51 → 50 (-1.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 94 → 94 (+0.0)
  • Architecture 88 → 64 (-23.8)
  • Maturity 74 → 77 (+2.7)
  • Readiness 38 → 38 (-0.1)
  • Security 46 → 46 (-0.4)
  • Accessibility 69 → 69 (+0.4)
  • Performance 100 → 100 (+0.0)

Resolved (8)

  • High CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • Medium CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • Typo in test asset class name: 'UknownByteData' is missing the 'n' in 'Unknown', while other asset classes like 'ValidConverters' and 'InvalidXmlData' are spelled correctly.
  • XML-doc coverage: File.API (src/File.API/File.API.csproj)
  • XML-doc coverage: File.Core (src/File.Core/File.Core.csproj)
  • XML-doc coverage: File.Domain (src/File.Domain/File.Domain.csproj)
  • XML-doc coverage: File.Infrastructure (src/File.Infrastructure/File.Infrastructure.csproj)
  • redundant comment (src/File.Domain/Logging/LogEvents.cs)

New (8)

  • High CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • High CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • High CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • High CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • High CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • Low CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • Medium CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)
  • Medium CVE: [GHSA redacted] (src/File.Frontend/package-lock.json)

Architecture

  • Unchanged — 2 containers · 0 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

Gramli/FileApi was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 8 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 4990e0843ec8da9af7b00288494e843e45823034 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.