{"id":19809646,"url":"https://github.com/purejoymind/apisetupprojecttemplate","last_synced_at":"2025-09-18T05:31:58.492Z","repository":{"id":225320998,"uuid":"764820230","full_name":"PureJoyMind/ApiSetupProjectTemplate","owner":"PureJoyMind","description":"A .NET 8 Web Api project template with EF Core, Swagger, Api Versioning, NLog, and SignalR setup.","archived":false,"fork":false,"pushed_at":"2024-03-01T12:01:34.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-12T09:17:33.875Z","etag":null,"topics":["dotnet","project-template","template-project","visual-studio","webapi"],"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/PureJoyMind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-02-28T19:14:15.000Z","updated_at":"2024-05-02T05:56:13.000Z","dependencies_parsed_at":"2024-03-01T12:31:37.224Z","dependency_job_id":null,"html_url":"https://github.com/PureJoyMind/ApiSetupProjectTemplate","commit_stats":null,"previous_names":["purejoymind/apisetupprojecttemplate"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureJoyMind%2FApiSetupProjectTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureJoyMind%2FApiSetupProjectTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureJoyMind%2FApiSetupProjectTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureJoyMind%2FApiSetupProjectTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PureJoyMind","download_url":"https://codeload.github.com/PureJoyMind/ApiSetupProjectTemplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233451342,"owners_count":18678210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dotnet","project-template","template-project","visual-studio","webapi"],"created_at":"2024-11-12T09:17:42.223Z","updated_at":"2025-09-18T05:31:53.197Z","avatar_url":"https://github.com/PureJoyMind.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# .NET 8 Web Api Project Template\nThis is a web api project template which has EF Core, Swagger, Api Versioning, NLog, and signalR setup.\n\n## How to Use\n***Note***: I have created and tested this template in `Visual Studio 2022 version 17.8`. It should work in version `\u003e17.0`.\n\n* Download the Template: Visit the GitHub [Repository](https://github.com/PureJoyMind/ApiSetupProjectTemplate) of the template project.\n* Get the Template File: Download the template file from the Release section of the repository.\n* Copy the Template file to `C:\\Users\\{User}\\Documents\\Visual Studio 2022\\Templates\\ProjectTemplates`\n* Create A new Project and select the template from the list of templates. If you don't see the template search for it.\n   ![Create New Project in Visual Studio 2022](https://github.com/PureJoyMind/ApiSetupProjectTemplate/assets/27802665/e31f0c7a-11b8-4715-bfda-8fe890a6fb82)\n### Creation\nChoose this Template when creating a new project in visual studio. The nuget packages are updated as needed up to 3/1/2024. \nI have upgraded the packages which had vulnerabilities. \n\n### Features\n* ***Versioning***: The project contains a default Controller, which has two methods. One of them is commented out. Its purpose is to show how to use Api versioning.\n* ***Logging***: I have used NLog as the projects default logger. You can see how to inject and use it in the project in the Default controller. There is a `nlog.config` file in the root of the project. Look at [NLog](https://github.com/nlog/nlog/wiki)'s official docs to see how you can twick its settings. I have setup three log levels(Info, Debug, Error) which are written in separate files outside of the project runtime folder in a folder called Logs. \n* ***DbContext***: In order to use EF Core, you need to know what you are doing. in the `Program.cs` file you can see `builder.Services.AddDbContext\u003cDataContext\u003e` which adds the connection string. you can change this as you want. Or you can move the connection string to `appsettings.json`. You can then inject and use the DbContext whenever you want.\n* ***SignalR***: Even though .NET 8 already has the SignalR packages by default, I have set the project in a way that you can immediately write signalR code upon project creation. In the `Program.cs` file you can see `app.MapHub\u003cDefaultHub\u003e(\"hub\");` which means that the route to SignalR's websocket is `/hub`. The Hub that I have setup is Strong-Typed, which means that you can call client methods by simply calling the methods name (You have to declare clients methods in the Interface. See Strong-Typed Hubs in official [Docs](https://learn.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-server#strongly-typed-hubs)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurejoymind%2Fapisetupprojecttemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurejoymind%2Fapisetupprojecttemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurejoymind%2Fapisetupprojecttemplate/lists"}