Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Description

Please include a summary of the change and which issue is fixed.

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
10 changes: 2 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
interval: "monthly"
open-pull-requests-limit: 10
32 changes: 20 additions & 12 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,40 @@ jobs:
- name: Run Benchmarks
run: |
cd src/Rapp.Benchmark
dotnet run -c Release --no-build -- --exporters json markdown
dotnet run -c Release --no-build -- --exporters markdown csv html

- name: Store benchmark results
uses: actions/upload-artifact@v6
with:
name: benchmark-results
path: |
BenchmarkDotNet.Artifacts/results/*.json
BenchmarkDotNet.Artifacts/results/*.md
src/Rapp.Benchmark/BenchmarkDotNet.Artifacts/results/*.md
src/Rapp.Benchmark/BenchmarkDotNet.Artifacts/results/*.csv
src/Rapp.Benchmark/BenchmarkDotNet.Artifacts/results/*.html

- name: Compare benchmarks
- name: Comment PR with benchmark results
if: github.event_name == 'pull_request'
uses: benchmark-action/github-action-benchmark@v1
uses: actions/github-script@v7
with:
tool: 'benchmarkdotnet'
output-file-path: BenchmarkDotNet.Artifacts/results/Benchmarks-report.json
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-threshold: '150%'
fail-on-alert: false
script: |
const fs = require('fs');
const path = 'src/Rapp.Benchmark/BenchmarkDotNet.Artifacts/results/Benchmarks-report-github.md';

if (fs.existsSync(path)) {
const markdown = fs.readFileSync(path, 'utf8');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## 📊 Benchmark Results\n\n${markdown}`
});
}

- name: Update benchmark results in repo
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
# Copy results to benchmarks directory
cp -r BenchmarkDotNet.Artifacts/results/* benchmarks/
cp -r src/Rapp.Benchmark/BenchmarkDotNet.Artifacts/results/* benchmarks/

# Check if there are changes
if git diff --quiet benchmarks/; then
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "CodeQL"

on:
push:
branches: [ "main", "development" ]
pull_request:
branches: [ "main", "development" ]
schedule:
- cron: '34 1 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2026-01-07

### Added
- **Full AOT Compatibility**: Verified and tested Native AOT support for high-performance deployments.
- **Dashboard Statistics**: Visual dashboard now shows real-time serialization metrics and cache hit/miss rates.
- **Documentation**: Added comprehensive `GETTING_STARTED.md` guide for new users.
- **Telemetry**: Enhanced metric collection for HybridCache integration.

### Changed
- **Performance**: Optimized hashing algorithm for 15% faster cold startups.
- **Samples**: Updated samples to use latest .NET 10 preview features.

## [1.0.0] - 2025-12-31

### Added
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dotnet run

### Code Style
- Follow C# coding conventions
- **Zero Warnings Policy**: The project treats warnings as errors (`TreatWarningsAsErrors=true`). Ensure your code builds without any warnings.
- Use meaningful variable and method names
- Add XML documentation comments to public APIs
- Keep methods focused and single-purpose
Expand Down
18 changes: 18 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<Project>
<PropertyGroup>
<!-- Core Language & Framework Settings -->
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Code Quality & Strictness -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>Recommended</AnalysisMode>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<NoWarn>$(NoWarn);CA2007;CA1014;CA1707</NoWarn>

<!-- Global Feature Flags -->
<IsAotCompatible>true</IsAotCompatible>
<DefineConstants>$(DefineConstants);RAPP_TELEMETRY</DefineConstants>

<!-- Centralized Package Metadata -->
<Authors>Digvijay Chauhan</Authors>
<Copyright>Copyright (c) 2026 Digvijay Chauhan</Copyright>
<PackageProjectUrl>https://github.com/Digvijay/Rapp</PackageProjectUrl>
<RepositoryUrl>https://github.com/Digvijay/Rapp</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
</Project>
35 changes: 35 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<!-- Core Dependencies -->
<PackageVersion Include="MemoryPack" Version="1.21.4" />
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="10.1.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.1" />
<PackageVersion Include="System.Text.Json" Version="10.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />

<!-- Source Generators -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />

<!-- Build & Tools -->
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />

<!-- gRPC & Web -->
<PackageVersion Include="Grpc.AspNetCore" Version="2.70.0" />
<PackageVersion Include="Microsoft.AspNetCore.Grpc.JsonTranscoding" Version="9.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />

<!-- Testing & Benchmarking -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="FluentAssertions" Version="8.8.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
</ItemGroup>
</Project>
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ dotnet add package Rapp

## ⚡ Quick Start

> 📘 **New to Rapp?** Check out our step-by-step [Getting Started Guide](docs/GETTING_STARTED.md) for a comprehensive walkthrough.

### 1. Mark Your Cacheable Types

Decorate DTOs with the `[RappCache]` attribute. The class must be `partial` to allow source generation.
Expand Down Expand Up @@ -234,6 +236,20 @@ Rapp is fully compatible with Native AOT compilation:
</PropertyGroup>
```

```

### 3. Native AOT Compatibility

Rapp is **100% compatible with Native AOT** (Ahead-of-Time) compilation, making it ideal for serverless and high-performance cloud scenarios.

**Why Rapp is AOT Ready:**
- **Source Generation:** All serialization code is generated at compile-time using Roslyn 4.0 source generators.
- **No Runtime Reflection:** Rapp avoids `System.Reflection` entirely for serialization paths, preventing AOT trim warnings.
- **Static Analysis:** All types are analyzed during build, ensuring AOT linkers can see all used types.
- **MemoryPack Foundation:** Built on top of MemoryPack, which is designed from the ground up for AOT.

> **Note on Demos:** The sample applications (`AspNetCoreMinimalApi`, `GrpcService`) utilize `System.Text.Json` reflection-based serialization **solely for comparison purposes** (to calculate cost savings vs JSON). Because of this comparative logic, the demos themselves generate AOT warnings. However, the **Rapp library itself** is fully AOT compliant and can be used in strictly AOT-enforced projects (like the `ConsoleApp` sample configured for AOT).

## 🎯 Advanced Features

### Integration with Existing Code
Expand Down Expand Up @@ -421,6 +437,7 @@ Rapp is open-source. We welcome contributions to expand the validation rule set

- [Contributing Guide](CONTRIBUTING.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Getting Started Guide](docs/GETTING_STARTED.md)
- [Dependencies & Versions](docs/DEPENDENCIES.md)
- [Documentation](docs/)

Expand Down
28 changes: 28 additions & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Support

Thank you for using **Rapp**! We want to ensure you have the best experience possible with our high-performance AOT caching library.

## ❓ Getting Help

If you have questions about how to use Rapp or encounter issues, please use the following channels:

### 1. Documentation
Before opening an issue, please check our [comprehensive documentation](./README.md), the [Getting Started Guide](docs/GETTING_STARTED.md), and the [docs/](./docs/) directory. Most common patterns and limitations are documented there.

### 2. GitHub Discussions
For general questions, architectural advice, or sharing how you use Rapp, please use [GitHub Discussions](https://github.com/Digvijay/Rapp/discussions).

### 3. GitHub Issues
If you've found a bug or have a feature request:
- Search existing [Issues](https://github.com/Digvijay/Rapp/issues) to see if it's already being tracked.
- If not, check our [Contribution Guidelines](./CONTRIBUTING.md) on how to report it effectively.

## 🛡️ Security Vulnerabilities
If you discover a security vulnerability, please follow our [Security Policy](./SECURITY.md). **Do not report security vulnerabilities via public issues.**

## 🤝 Contributing
Interested in helping out? Check our [Contributing Guide](./CONTRIBUTING.md).

---

We aim to respond to all inquiries within a reasonable timeframe, but please remember that Rapp is an open-source project maintained by volunteers.
6 changes: 4 additions & 2 deletions Samples/AspNetCoreMinimalApi/AspNetCoreMinimalApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<Nullable>enable</Nullable>
<!-- Enable Rapp telemetry for demo purposes -->
<DefineConstants>$(DefineConstants);RAPP_TELEMETRY</DefineConstants>
<IsAotCompatible>false</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="10.1.0" />
<PackageReference Include="MemoryPack" Version="1.21.4" />
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" />
<PackageReference Include="MemoryPack" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

<ItemGroup>
Expand Down
44 changes: 26 additions & 18 deletions Samples/AspNetCoreMinimalApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Rapp;
using Rapp.Dashboard;
using MemoryPack;
using Rapp.Samples.MinimalApi;

var builder = WebApplication.CreateBuilder(args);

Expand Down Expand Up @@ -30,6 +31,9 @@
app.UseSwaggerUI();
}

app.UseDefaultFiles();
app.UseStaticFiles();

// Map Rapp Dashboard
app.MapRappDashboard();

Expand Down Expand Up @@ -113,24 +117,28 @@ static async Task<Customer> GetCustomerAsync(int id, CancellationToken ct)
};
}

// Domain models with Rapp attributes
[RappCache]
[MemoryPackable]
public partial class Product
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public decimal Price { get; set; }
public string Category { get; set; } = string.Empty;
public bool InStock { get; set; }
}

[RappCache]
[MemoryPackable]
public partial class Customer
namespace Rapp.Samples.MinimalApi
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public DateTime CreatedAt { get; set; }
// Domain models with Rapp attributes
[RappCache]
[MemoryPackable]
public partial class Product
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public decimal Price { get; set; }
public string Category { get; set; } = string.Empty;
public bool InStock { get; set; }
}

[RappCache]
[MemoryPackable]
public partial class Customer
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public DateTime CreatedAt { get; set; }
}
}
Loading
Loading