Use ASP.NET Core 2.2 and host it locally into a frontend like e.g. Electron
Why screw around with Qt or JavaFX if you can just design your client app as if it were a website and bridge it with a locally hosted ASP.NET Core C# backend?
Not only is it better in terms of separation of concerns (because your frontend only receives the data it needs from the backend for presentation), you also have the choice of running the app in the user's browser of choice (like pgAdmin 4 does) or serve it in the background while some lightweight web view wrapper app displays the localhost site in its window.
When you run the application, the included mkcert build will automatically deploy HTTPS certificates to the wwwroot/ssl
folder on startup (check out the Program
entry point class for more information). When opened in the browser, HTTPS should work out-of-the-box. When running in the background, depending on what frontend you use you might need to do some adjustments to get the SSL certificates to work.
- Once you forked the repo, use the IDE of your choice to rename the project to your desired application name.
-
- Don't forget to also rename the namespace to match your new name.
- Open
Program.cs
and decide if the default setup with the#define
s at the top of the file suits your needs. - Localization is provided using the default ASP.NET Core approach.
-
- To localize your views, just add the corresponding
Views.ControllerName.ActionName.CULTURE_SPECIFIER.resx
file toResources/
.
- To localize your views, just add the corresponding
-
-
- Culture specifiers are usually two lowercase letters; e.g.
de
,it
, etc...
- Culture specifiers are usually two lowercase letters; e.g.
-
-
- Update the supported cultures array inside
Startup.cs
to reflect the languages you want to support.
- Update the supported cultures array inside
-
- You can also use the
Layout
dummy class to localize strings generally (inside the correspondingViews.Shared._Layout.CULTURE_SPECIFIER.resx
file). In this case,@inject IStringLocalizer<Layout>
into yourcshtml
views.
- You can also use the
- Document your code using appropriate xml docs.
- To build the API documentation, execute the included
build-docs.bat
on Windows (orbuild-docs.sh
on Linux/macOS respectively). You need to have DocFX installed on your computer for this. The compiled documentation site should then be available to serve (e.g. via github.io pages) inside thedocs/
directory.