https://github.com/dvurechensky-tools/dotnetify
Turn any OpenAPI (swagger.json) file into a runnable C# (.NET) backend project in seconds.
https://github.com/dvurechensky-tools/dotnetify
api-generator aspnetcore backend cli code-generation csharp dotnet dvurechensky dvurechenskypro dvurechenskytools nswag openapi roslyn scaffolding swagger swagger-json
Last synced: 4 days ago
JSON representation
Turn any OpenAPI (swagger.json) file into a runnable C# (.NET) backend project in seconds.
- Host: GitHub
- URL: https://github.com/dvurechensky-tools/dotnetify
- Owner: Dvurechensky-Tools
- License: mit
- Created: 2026-04-20T02:03:50.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-26T09:04:29.000Z (8 days ago)
- Last Synced: 2026-05-26T11:08:41.672Z (8 days ago)
- Topics: api-generator, aspnetcore, backend, cli, code-generation, csharp, dotnet, dvurechensky, dvurechenskypro, dvurechenskytools, nswag, openapi, roslyn, scaffolding, swagger, swagger-json
- Language: C#
- Homepage: https://dvurechensky.pro/
- Size: 457 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Dotnetify
### Turn any OpenAPI (`swagger.json`) file into a runnable C# (.NET) backend project in seconds.
---
---
## 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:
```text
swagger.json
```
Pipeline:
```text
OpenAPI Spec
β
Code Generation
β
Roslyn Processing
β
Project Structuring
β
Runnable .NET Backend
```
Output:
```text
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:
```text
swagger.json β raw generated code
```
Dotnetify continues further:
```text
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:
```bash
cd app\Dotnetify\bin\Debug\net8.0
```
Generate and run:
```bash
Dotnetify.exe generate Input\swagger.json --run
```
Generate with a custom project name:
```bash
Dotnetify.exe generate Input\swagger.json --name MyApi
```
Generate with a custom project name and run it immediately:
```bash
Dotnetify.exe generate Input\swagger.json --name MyApi --run
```
Generate, run, and bind the generated API to a custom HTTP port:
```bash
Dotnetify.exe generate Input\swagger.json --name MyApi --run --port 5103
```
If `--port` is not provided, Dotnetify uses port `5000`.
This creates:
```text
Output/MyApi/MyApi.csproj
```
Example output:
```text
[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:
```text
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:
```csharp
[HttpGet("inventory")]
public Task> GetInventory()
{
var response = new Dictionary
{
{ "test", 1 }
};
return Task.FromResult>(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