Giter Site home page Giter Site logo

glitchedpolygons / asp.net-core-2.2-cross-platform-gui Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 7.89 MB

Create Cross-Platform GUI Applications using ASP.NET Core 2.2

License: BSD 3-Clause "New" or "Revised" License

C# 66.89% HTML 28.70% CSS 3.48% JavaScript 0.71% Batchfile 0.11% Shell 0.11%

asp.net-core-2.2-cross-platform-gui's Introduction

License Shield AppVeyor Travis CircleCI

Create Cross-Platform GUI Applications

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.

To do:

  • 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 #defines 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 to Resources/.
      • Culture specifiers are usually two lowercase letters; e.g. de, it, etc...
    • Update the supported cultures array inside Startup.cs to reflect the languages you want to support.
    • You can also use the Layout dummy class to localize strings generally (inside the corresponding Views.Shared._Layout.CULTURE_SPECIFIER.resx file). In this case, @inject IStringLocalizer<Layout> into your cshtml views.
  • Document your code using appropriate xml docs.
  • To build the API documentation, execute the included build-docs.bat on Windows (or build-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 the docs/ directory.

  • Now you can activate your AppVeyor, CircleCI and Travis Continuous Integration services and make them point to your repo; they will run the unit tests inside tests/ and update the build status accordingly.
    • Change the build status badge URLs to point to your CI setup at the top of this readme file.

asp.net-core-2.2-cross-platform-gui's People

Contributors

glitchedpolygons avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.