User Tools

Site Tools


development:webapp:webapp

Web Application

The web application service serves the webapp via http.

Frameworks and Intricacies

  • Template engine:
    • We serve templated html pages via Go's built in template package.
    • Philosophies behind using templates over other javascript frontend frameworks:
      • It allows development to be more backend focused
      • Rendering performance: Templates are often faster as they are rendered on the server-side, reducing the load on the client-side.
      • No Duplication: With templates, you don’t need to duplicate your work on both the server and client side
      • Less Javascript: Templates can reduce the amount of JavaScript required, which can be beneficial for performance and compatibility
      • No advanced interactivity with the site is needed (at this time).
    • “The client's browser is a free compute resource” - citation needed
    • All of our advanced calculators are written in Go. We compile them to WASM to be served with our webapp templates
    • Philosophies behind using WASM:
      • Reduce Waste and Duplicate Engineering: WASM reduces waste and duplicate engineering by letting us use what we already have. For instance, the calculator REST Api's use the exact same code as the WASM calculators.
      • Efficient Execution: WASM provides efficient execution and compact representation of code on modern processors, including in a web browser. It is designed to be executed at near-native speeds.
      • Potentially save network resources: Once an end user renders a WASM calculator, they can freely use it, and even spam it, as much as they want without impacting or relying on Cultivate Finance's resources.
      • Portability: Once an end user renders a WASM calculator, it can still be used without network connection from either the client or server.

Building and Running the Webapp locally

You can build and run the webapp locally by doing the following:

  1. Confirm docker is running on your machine
  2. Change directory to the build directory
    cd build
  3. Use docker-compose to build and run the webapp
    make webapp
  4. Navigate to to http://localhost:8662/

Building and Running the Webapp in Kubernetes production

You can deploy the webapp to our production kubernetes cluster by:

  1. Confirm you are in the build directory:
    cd build
  2. You can deploy using EITHER the make command OR kubectl
    1. make command:
      make k_depoy_webapp
    2. kubectl:
      kubectl apply -f k8s/webapp.yml
  3. Confirm the webapp service is deployed:
    kubectl get service webapp-service
development/webapp/webapp.txt · Last modified: 2024/06/06 16:41 by 127.0.0.1