Skip to content

Dvurechensky-Tools/Dotnetify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dotnetify Logo

Dotnetify

Turn any OpenAPI (swagger.json) file into a runnable C# (.NET) backend project in seconds.


🌐 Language: πŸ‡·πŸ‡Ί Russian | βœ… πŸ‡ΊπŸ‡Έ English (current)

Overview

Dotnetify is a CLI tool that transforms an OpenAPI / Swagger specification into a fully generated ASP.NET Core server project.

Instead of producing raw generator output, Dotnetify builds a structured, launch-ready backend scaffold that can be compiled, started, and extended immediately.

It is designed for developers who need a fast backend starting point from an existing API schema.

Important

Dotnetify focuses on producing a usable server project, not just generated source files.


What It Does

Input:

swagger.json

Pipeline:

OpenAPI Spec
    ↓
Code Generation
    ↓
Roslyn Processing
    ↓
Project Structuring
    ↓
Runnable .NET Backend

Output:

ProjectName/
 β”œβ”€β”€ Controllers/
 β”œβ”€β”€ Models/
 β”œβ”€β”€ Enums/
 β”œβ”€β”€ Common/
 β”œβ”€β”€ Program.cs
 β”œβ”€β”€ ProjectName.csproj

By default, ProjectName is GeneratedApi. You can override it with --name.


Features

Category Description
OpenAPI Import Reads swagger.json specifications
Controllers Generates API controllers by route groups
Models Generates DTO / entity classes
Enums Generates enums from schema definitions
Mock Responses Auto-generates test responses for endpoints
Build Ready Produces compilable .NET project
Run Ready Can start generated API instantly
Swagger UI Generated server exposes Swagger portal
Custom Name Generates project folders and files with a custom project name
Custom Port Runs generated API on a selected HTTP port with --port
Roslyn Processing Cleans and restructures generated code

Why Dotnetify?

Most generators stop here:

swagger.json β†’ raw generated code

Dotnetify continues further:

swagger.json β†’ working backend project

That means:

  • Faster frontend development
  • Faster prototyping
  • Easier API testing
  • Better reverse engineering workflows
  • Immediate backend starting point

Quick Start

Go to the compiled binary:

cd app\Dotnetify\bin\Debug\net8.0

Generate and run:

Dotnetify.exe generate Input\swagger.json --run

Generate with a custom project name:

Dotnetify.exe generate Input\swagger.json --name MyApi

Generate with a custom project name and run it immediately:

Dotnetify.exe generate Input\swagger.json --name MyApi --run

Generate, run, and bind the generated API to a custom HTTP port:

Dotnetify.exe generate Input\swagger.json --name MyApi --run --port 5103

If --port is not provided, Dotnetify uses port 5000.

This creates:

Output/MyApi/MyApi.csproj

Example output:

[Dotnetify] Running: Roslyn Split Processor
[Dotnetify] Running: Dotnet Project Processor
[Dotnetify] Running: Package Resolve Processor

Generation complete.
Starting server...
Started PID: 29296

Swagger: http://localhost:5000/swagger

With a custom port:

Started PID: 29296
Swagger: http://localhost:5103/swagger

Use Cases

Frontend Teams

Need backend before real backend exists.

QA / API Testing

Generate local API from schema instantly.

Legacy Systems

Recreate documented APIs into editable .NET projects.

Startups / MVP

Launch backend prototype rapidly.


Example Result

Generated controller:

[HttpGet("inventory")]
public Task<IDictionary<string, int>> GetInventory()
{
    var response = new Dictionary<string, int>
    {
        { "test", 1 }
    };

    return Task.FromResult<IDictionary<string, int>>(response);
}

Philosophy

Dotnetify does not aim to replace real backend engineering.

It aims to eliminate the empty starting phase.

Instead of spending hours scaffolding:

  • controllers
  • DTOs
  • routes
  • startup boilerplate
  • fake data

You start with all of it already generated.


Roadmap

Planned future improvements:

  • Database scaffolding
  • Repository generation
  • React admin panel generation
  • Authentication templates
  • Docker support
  • CI/CD templates
  • Multiple architecture modes

Current Status

Active development

Core generation pipeline is already functional and produces runnable projects.


Tech Stack

  • C#
  • .NET
  • ASP.NET Core
  • Roslyn
  • NSwag