{"id":37035772,"url":"https://github.com/mateusslezinsky/model-generator","last_synced_at":"2026-01-14T04:14:06.595Z","repository":{"id":281024054,"uuid":"943961312","full_name":"mateusslezinsky/model-generator","owner":"mateusslezinsky","description":"This library aims to generate Typescript interfaces from many programming languages.","archived":false,"fork":false,"pushed_at":"2025-03-13T15:49:59.000Z","size":7247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T07:31:54.888Z","etag":null,"topics":["code-generation","csharp","interfaces","transpiler","typescript"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mateusslezinsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-06T14:55:31.000Z","updated_at":"2025-03-13T16:18:21.000Z","dependencies_parsed_at":"2025-03-13T16:33:03.790Z","dependency_job_id":null,"html_url":"https://github.com/mateusslezinsky/model-generator","commit_stats":null,"previous_names":["mateusslezinsky/model-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mateusslezinsky/model-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusslezinsky%2Fmodel-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusslezinsky%2Fmodel-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusslezinsky%2Fmodel-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusslezinsky%2Fmodel-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateusslezinsky","download_url":"https://codeload.github.com/mateusslezinsky/model-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusslezinsky%2Fmodel-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28409224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","csharp","interfaces","transpiler","typescript"],"created_at":"2026-01-14T04:14:05.888Z","updated_at":"2026-01-14T04:14:06.588Z","avatar_url":"https://github.com/mateusslezinsky.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Model Generator\n\nThis library aims to generate Typescript interfaces from many programming languages.\n\nIn the backend development it is very common to create DTOs (Data Transfer Objects) to represent the data that is being sent or received by the API. It is also very common to have models that generate database migrations. This library generates Typescript interfaces for frontend (whether it is to be used in React, Angular, or any other web frameworks) from the backend.\n\n## Usage\n```csharp\n // Import statements\n // ...\nnamespace ExampleUsage;\n \nclass Program\n{\n    private static DirectoryInfo? TryGetSolutionDirectoryInfo(string? currentPath = null)\n    {\n        var directory = new DirectoryInfo(\n            currentPath ?? Directory.GetCurrentDirectory()\n        );\n        while (directory != null \u0026\u0026 !directory.GetFiles(\"*.sln\").Any())\n        {\n            directory = directory.Parent;\n        }\n\n        return directory;\n    }\n\n    public static void Main()\n    {\n        var directory = TryGetSolutionDirectoryInfo();\n        if (directory != null)\n        {\n            var typescriptOutPath = $\"{directory}/ExampleUsage/Out\";\n            var csharpModelsPaths = new List\u003cstring\u003e\n            {\n                $\"{directory}/ExampleUsage/Models\"\n            };\n            var outSubFolders = new List\u003cstring\u003e\n            {\n                \"addresses\",\n                \"products\",\n                \"orders\",\n                \"payments\",\n                \"customers\",\n                \"categories\",\n            };\n\n            var convertModels = new ConvertModels(\n                typescriptOutPath: typescriptOutPath,\n                csharpModelsPaths: csharpModelsPaths,\n                outSubFolders: outSubFolders\n            );\n            convertModels.GenerateTypeScriptInterfaces();\n        }\n    }\n}\n```\n\nTo get started, you must provide the paths to the C# models and the path where the Typescript interfaces will be generated. The `outSubFolders` parameter is optional and it is used to aggregate the interfaces in subfolders.\nWe have a base class called `ConvertModels` and at this class we have exposed methods to convert to either interfaces, types or classes in typescript. You can also find this example at `ExampleUsage` C# project.\n\n## Contributing\n\nIf you want to contribute to this project, please read the [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateusslezinsky%2Fmodel-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateusslezinsky%2Fmodel-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateusslezinsky%2Fmodel-generator/lists"}