Git Product home page Git Product logo

wswebarc-fe's Introduction

Web-Architektur-Workshop Frontend-Part

Praxisbeispiel zur Implementierung einer React-SPA mit Typescript und von swagger-codegen generiertem Client. Erstellung eines Docker-Images und Deployment in eine Kubernetes-Plattform.

Voraussetzungen

Generieren mit Swagger

Um ein Beispiel für einen Rest-Service mit etwas höherer Komplexität und umfangreicheren Objekten zu haben, wurde das Modell der Tesla-Owner-Api ausgewählt, die hier in Swagger-Hub modelliert wurde. Die Typescript-fetch - Version wurde aus dem Modell exportiert und unter src/ev-client entpackt.

Build

yarn install
yarn start

Implementierungsaufgabe

  1. Korrigiert die Komponente `ChargerToggle.tsx -> Zugriff auf ChargeState und chargeStart, chargeStop
  2. Integriert Redux um die Aktionen und Datenbereitstellung von den Komponenten stärker zu entkoppeln.

Dockerbuild und run

  1. docker build
     docker build -t ws-crs/ev-frontend .
    
  2. docker run
    docker run -p 8082:80 -d --name ev-frontend -t ws-crs/ev-frontend 
    
  3. Testen mit localhost:8082

GCP-Containerdeployment und starten der Pods auf Kubernetes

    docker tag ws-crs/ev-frontend gcr.io/elite-droplet-256314/ws-crs/ev-frontend
    docker push gcr.io/elite-droplet-256314/ws-crs/ev-frontend
    kubectl apply -f k8s.ev-frontend.deployment.yaml
    # Trick: kubectl patch deployment ev-frontend -p "{\"spec\": {\"template\": {\"metadata\": { \"labels\": {  \"redeploy\": \"$(date +%s)\"}}}}}"
    kubectl apply -f k8s.ev-frontend-service.service.yaml

Als letztes den Ingres-Controller überarbeiten.

wswebarc-fe's People

Contributors

fpestke 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.