Skip to content

schivei/ddap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ›οΈ DDAP - Developer in Control

Dynamic Data API Provider. You control everything. We handle the boilerplate.

NuGet License Build

⚑ What is DDAP?

DDAP automatically generates REST, GraphQL, and gRPC APIs from your database schemaβ€”but without forcing any decisions on you.

Unlike other frameworks that lock you into specific libraries, databases, or patterns, DDAP provides infrastructure only. You choose:

  • πŸ—„οΈ Your database (SQL Server, MySQL, PostgreSQL, SQLite, or custom)
  • πŸ”§ Your ORM (Dapper or Entity Framework)
  • 🎨 Your serializer (System.Text.Json, Newtonsoft.Json, or any)
  • 🌐 Your API style (REST, GraphQL, gRPC, or all three)

DDAP discovers your schema, generates base types, and gets out of your way.


🎯 Developer in Control

What DDAP Provides What You Control
βœ… Entity discovery from database 🎯 Database type (SQL Server, MySQL, etc.)
βœ… Metadata mapping (tables, columns, keys) 🎯 ORM choice (Dapper or Entity Framework)
βœ… Base API types (controllers, queries, services) 🎯 Serialization library (any JSON library)
βœ… Auto-Reload infrastructure 🎯 Auto-Reload configuration (when, how)
βœ… Hooks and lifecycle callbacks 🎯 GraphQL configuration (complete control)
βœ… Partial classes for extension 🎯 REST configuration (formatters, routing)
βœ… Project templates (dotnet new) 🎯 gRPC configuration (services, options)
🎯 Everything else!

❌ Other Frameworks vs βœ… DDAP

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  🚫 Opinionated Frameworks          β”‚
β”‚  ❌ Force Newtonsoft.Json           β”‚
β”‚  ❌ Hardcode XML/YAML formatters    β”‚
β”‚  ❌ Database-specific packages      β”‚
β”‚  ❌ Hidden configurations           β”‚
β”‚  ❌ Lock you into patterns          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  βœ… DDAP - Developer in Control     β”‚
β”‚  βœ… You choose serializer           β”‚
β”‚  βœ… You configure formatters        β”‚
β”‚  βœ… Single Dapper, ANY database     β”‚
β”‚  βœ… Everything explicit             β”‚
β”‚  βœ… You own the architecture        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

1. Install packages

dotnet add package Ddap.Core
dotnet add package Ddap.Data.Dapper  # OR Ddap.Data.EntityFramework
dotnet add package Ddap.GraphQL      # Optional
dotnet add package Ddap.Rest         # Optional
dotnet add package Ddap.Grpc         # Optional

2. Configure (Dapper example)

using Microsoft.Data.SqlClient;

var builder = WebApplication.CreateBuilder(args);

// YOU choose the database connection
builder.Services.AddDdap()
    .AddDapper(() => new SqlConnection(
        builder.Configuration.GetConnectionString("DefaultConnection")
    ))
    .AddRest()
    .AddGraphQL(graphql =>
    {
        // YOU configure HotChocolate
        graphql
            .AddFiltering()
            .AddSorting()
            .AddProjections();
    });

var app = builder.Build();
app.MapControllers();
app.MapGraphQL();
app.Run();

3. Done! πŸŽ‰

  • REST: GET /api/entity
  • GraphQL: POST /graphql { entities { name } }

OR Use the Template

dotnet new install Ddap.Templates
dotnet new ddap-api --name MyApi
cd MyApi
dotnet run

✨ Features

πŸ—„οΈ Database Agnostic

  • Dapper: Works with ANY IDbConnection (SQL Server, MySQL, PostgreSQL, SQLite, Oracle, etc.)
  • Entity Framework: Use your existing DbContext

🌐 Multi-Protocol APIs

  • REST: Standard HTTP/JSON endpoints with full controller customization
  • GraphQL: Powered by HotChocolate, fully configurable
  • gRPC: High-performance RPC, configurable services

πŸ”„ Auto-Reload System

Automatically reloads database schema after idle periods:

  • βœ… 3 Strategies: InvalidateAndRebuild, HotReloadIncremental, RestartExecutor
  • βœ… 3 Behaviors: ServeOldSchema, BlockRequests, QueueRequests
  • βœ… 3 Detection Methods: AlwaysReload, CheckHash, CheckTimestamps
  • βœ… Lifecycle Hooks: OnBeforeReloadAsync, OnAfterReloadAsync
options.AutoReload = new AutoReloadOptions
{
    Enabled = true,
    IdleTimeout = TimeSpan.FromMinutes(5),
    Strategy = ReloadStrategy.InvalidateAndRebuild,
    Behavior = ReloadBehavior.ServeOldSchema,
    Detection = ChangeDetection.CheckHash
};

πŸ“¦ Project Templates

dotnet new ddap-api --database-provider dapper --database-type mysql --api-providers "rest,graphql"

πŸŽ›οΈ Zero Opinions

  • No forced dependencies
  • No hidden configurations
  • No magic behavior
  • You configure everything

πŸ”§ Fully Extensible

// Extend via partial classes
namespace Ddap.Rest;

public partial class EntityController
{
    [HttpGet("custom")]
    public IActionResult Custom() => Ok("Your endpoint");
}

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Your Application                 β”‚
β”‚  (Controllers, Services, Business Logic)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        DDAP Core Infrastructure           β”‚
β”‚  βœ… Entity Discovery                      β”‚
β”‚  βœ… Metadata Mapping                      β”‚
β”‚  βœ… Base Type Generation                  β”‚
β”‚  βœ… Auto-Reload Management                β”‚
β”‚  βœ… Lifecycle Hooks                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Your Configuration Choices          β”‚
β”‚  🎯 Database: SQL Server / MySQL / etc.  β”‚
β”‚  🎯 ORM: Dapper / Entity Framework        β”‚
β”‚  🎯 Serializer: System.Text.Json / etc.  β”‚
β”‚  🎯 APIs: REST / GraphQL / gRPC           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Packages

Package Description Status
Ddap.Core Core abstractions and infrastructure βœ… Stable
Ddap.Data.Dapper Dapper provider (database-agnostic) βœ… Stable
Ddap.Data.EntityFramework Entity Framework Core provider βœ… Stable
Ddap.Rest REST API endpoints βœ… Stable
Ddap.GraphQL GraphQL API (HotChocolate) βœ… Stable
Ddap.Grpc gRPC services βœ… Stable
Ddap.Aspire .NET Aspire orchestration βœ… Stable
Ddap.Templates Project templates βœ… Stable

πŸ“š Documentation


🀝 Contributing

Contributions welcome! See CONTRIBUTING.md


πŸ“„ License

MIT License - see LICENSE


⭐ Star History

If DDAP helps you, please star the repo! 🌟


Built with ❀️ by developers who believe in control, not constraints.

About

Dynamic Data Api Provider

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •