LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub

Local and Test Cloud Environments

Before we start the react-client, let’s introduce the local and test cloud environments first.

Local

We are trying our best to mimic the local environment like the test cloud so that we can deploy all components to the test cloud without a lot of changes in configuration.

For the initial development of the react-client, we are going to use the Nodejs server to leverage the hot reload. Even when we hook up with the light-oauth2 for the authentication and authorization, we can still use the localhost:3000; however, as OAuth 2.0 provider has the limitation that works with only the HTTPS, we can only start the localhost:3000 on the HTTPS port.

To start the Nodejs server with HTTPS=true, we need to add a line into the generate package.json

    "start": "react-scripts start",
    "startHttps": "HTTPS=true react-scripts start",

To start the react-client on the terminal.

yarn startHttps

Once we reach the point that we need to redirect to the login-view application for credentials, we need to update the /etc/hosts to ensure that we can use the same domain names like the test cloud.

Here is a line in the /etc/hosts that map the two domains to my local desktop address.

192.168.1.144   ob.lightapi.net obsignin.lightapi.net

The above line will bypass the Internet DNS and use the local IP address for these two domains. When we reach this point, we are not going to use the Nodejs for the hot load anymore. We need to build the react-client and login-view with yarn build command on a terminal.

The location of the SPA for the ob.lightapi.net is https://github.com/networknt/light-config-test/tree/master/light-router/local-openbanking/ob/build

The location of the SPA for the obsignin.lightapi.net is https://github.com/networknt/light-config-test/tree/master/light-router/local-openbanking/obsignin/build

On your local, you need to run yarn build and copy the build folder to the corresponding light-config-test folder in the workspace and restart the light-router instance to load the latest site.

Test

  • Consul

On the test cloud, we’ve already had a Consul cluster running with three nodes. Here is the tutorial on how to set it up.

https://doc.networknt.com/tool/consul/cluster-install/

  • light-oauth2

We have all the light-oauth2 services started on the test1 server with the following docker-compose.

https://github.com/networknt/light-config-test/tree/master/light-oauth2/test-cloud

  • open-banking services

We start the open-banking services based on the docker-compose.

https://github.com/open-banking/light-config-test/tree/master/service

  • light-router

We are going to start a light-router instance as a reverse proxy and serve the https://ob.lightapi.net and https://obsignin.lightapi.net

https://github.com/networknt/light-config-test/tree/master/light-router/test-openbanking

In the next step, we are going to walk through the react-client with a hard-coded long-lived token.

  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“Local and Test Cloud Environments” was last updated: February 17, 2020: fixes #159 add open-banking react-client tutorial (a9a21da)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute