Giter VIP home page Giter VIP logo

blazor-auth-app's Introduction

GitHub Hosted App

This repository is an illustrative template for deploying a web application using GitHub exclusively. It demonstrates a straightforward and effective method to automate the deployment process without relying on external hosting, leveraging GitHub's built-in capabilities.

Key Features:

  1. No external hosting required
  2. Free for Public repositories

How it works

Frontend is a Blazor WASM app compiled into a static website, and any frontend like React, Angular, etc., can be used in its place. It is deployed using GitHub Pages. You also can use custom domain here.

With the backend part, it's a bit more complex. We launch it using GitHub Actions, so there are a few considerations to keep in mind: the job execution cannot exceed 6 hours, we don't have a static IP, and there's no external port within the workflow execution scope. Thus, we need to restart the application periodically, preferably without downtime, and also utilize an external HTTP tunnel. Backend can also be written using any languages or frameworks.

The main logic of operation is summarized in the following sequence:

  1. Publish Frontend to GitHub Pages
  2. Run Backend app
  3. Launch an HTTPS tunnel and obtain its public URL
  4. Publish the public URL to a text file in a dedicated branch of the repository
  5. Frontend requests the public URL from the text file before accessing to backend
  6. For Backend, a restart schedule is set every 4 hours
  7. Backend continuously checks that this instance is available at the address from the text file. If it's not, it terminates its operation

Project Structure:

  • .github/workflows/:

    • ci.yaml: CI workflow. Includes steps for building, publishing the application
    • hosting.yaml: Hosting workflow. Includes steps for hosting backend part of the application
  • .hosting/:

    • docker-compose.yaml: docker compose for Backend and an HTTPs tunnel
    • start-tunnel.sh: launch the HTTPs tunnel, track changes in the public URL and publish it to Git
    • monitor-app.sh: monitor that Backend is still running, so if the app is terminated, then terminate the tunnel too
  • src/:

HTTPS Tunnel:

This template uses https://localhost.run/ to organize a gateway to the backend. You can use any other service like ngrok or something else. However, keep in mind that ngrok allows only one tunnel per region in the free plan, so smooth migration between backend instances is not possible.

Usage Instructions:

TODO

blazor-auth-app's People

Contributors

nrukavkov avatar

Watchers

 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.