{"id":19214544,"url":"https://github.com/birajmainali/dotnet-web-template","last_synced_at":"2025-05-12T22:53:54.744Z","repository":{"id":112772181,"uuid":"534230614","full_name":"BirajMainali/dotnet-web-template","owner":"BirajMainali","description":".NET core web application template with pre-builds, Use this template and deep dive into your product requirement rather then initial setup's.","archived":false,"fork":false,"pushed_at":"2024-02-13T15:30:40.000Z","size":6367,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-05-12T22:53:49.012Z","etag":null,"topics":["custom-authentication","dotnet-core","dotnet-core-8","easy-repo","web-app-template"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BirajMainali.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-09-08T13:42:05.000Z","updated_at":"2024-01-28T15:00:59.000Z","dependencies_parsed_at":"2024-02-13T16:42:07.341Z","dependency_job_id":"01dd2603-a1e1-4497-a0c4-956468dd716e","html_url":"https://github.com/BirajMainali/dotnet-web-template","commit_stats":null,"previous_names":["birajmainali/dotnet-web-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirajMainali%2Fdotnet-web-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirajMainali%2Fdotnet-web-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirajMainali%2Fdotnet-web-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirajMainali%2Fdotnet-web-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BirajMainali","download_url":"https://codeload.github.com/BirajMainali/dotnet-web-template/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837389,"owners_count":21971981,"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":["custom-authentication","dotnet-core","dotnet-core-8","easy-repo","web-app-template"],"created_at":"2024-11-09T14:10:25.145Z","updated_at":"2025-05-12T22:53:54.702Z","avatar_url":"https://github.com/BirajMainali.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# .NET Core Web App Template\n\n## Pre-build's\n\n * Generic Repository, Just inject IRepository to get started.\n   ```csharp\n   IRepository\u003cAppUser, long\u003e userRepository\n   ```\n * Register your services into Dependencies with marks\n    ```csharp\n   public interface IUserValidator : IScopedDependency // We have other too.\n   {\n       Task EnsureUniqueUserEmail(string email, long? id = null);\n   }\n   ```\n * Add your database Entity\n    ```csharp\n   public class AppUser : FullAuditedEntity\u003clong\u003e\n   {\n     // props.\n   }\n   ```\n* Unit Of work\n   ```csharp\n  public class UserService(IUserValidator userValidator, IUow uow) : IUserService\n  { \n   public async Task\u003cAppUser\u003e CreateUser(UserDto dto)\n   {\n       using var tsc = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled);\n       var user = new AppUser();\n       await uow.CreateAsync(user);\n       await uow.CommitAsync();\n       tsc.Complete();\n       return user;\n   }\n  ```\n * Nepali Date, Importantly mentioned implementation show nepali but send English date request.\n    ```html\n       \u003cmulti-date-span value=\"Datetime.Now()\"/\u003e // display nepali date.\n       \u003cvc:date-input-vc name=\"To\" value=\"@Model.Date\"/\u003e // nepali date input\n   ```\n * To current user information, We have `ICurrentUserProvider`\n    ```csharp\n        public interface ICurrentUserProvider\n        {\n            bool IsLoggedIn();\n            Task\u003cAppUser\u003e GetCurrentUser();\n            long? GetCurrentUserId();\n            string GetCurrentConnectionKey();\n        }\n    ```\n * Multi-tenant Configuration `appsetting.json`. Physical separation is been used. \n     ```json\n      \"UseMultiTenancy\": true,  you can control tenant from here.\n    ```\n * App-setting configurations\n   ```csharp\n       IOptions\u003cAppSettings\u003e options\n   ```\n* Use Serilog\n   ```csharp\n    ILogger\u003cIMultiTenantHandler\u003e logger\n    Log.Error(e, \"Error while getting tenant\"); \n   ```\n* Resolve http response\n   ```csharp\n    [Route(\"WhatIsMyTenant\")]\n    public IActionResult WhatIsMyTenant()\n    {\n        try\n        {\n            var connectionKey = _currentUserProvider.GetCurrentConnectionKey();\n            return this.SendSuccess(\"Success\", connectionKey); // here\n        }\n        catch (Exception e)\n        {\n            Log.Error(e, \"Error while getting tenant\");\n            return this.SendError(e.Message); // here\n        }\n    }\n   ```\n\n## Others\n* Swagger `/Swagger`\n* Logs `./Logs`\n* Use of custom authentication including jwt and cookie.\n* Physical content can saved outside application scope.\n* Explore `FileHelper` to work with physical file.\n* Check `IDatabaseConnectionProvider` to create new dapper connection.\n* Used `tabler` theme","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirajmainali%2Fdotnet-web-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbirajmainali%2Fdotnet-web-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirajmainali%2Fdotnet-web-template/lists"}