Standalone Deployment
Run Linqra components in standalone mode
Overview
Standalone deployment is ideal for development environments or small-scale production setups. This guide walks you through running Linqra components individually with their required backing services.
Prerequisites
Before proceeding, ensure you have:
- Set up all required environment variables (Environment Variables Guide)
- Docker and Docker Compose installed on your system
- Access to the Linqra project repository
Infrastructure Components
Linqra’s standalone deployment requires several backing services:
- Redis: Rate limiting and temporary data storage
- MongoDB: Application resilience data
- PostgreSQL: Keycloak data storage
- Keycloak: Authentication and authorization
While we use Keycloak with PostgreSQL by default, you can configure any compatible Identity Provider.
Launch Infrastructure Services
Start the backing services using Docker Compose:
For local development, we provide pre-configured JKS files (self-signed certificates). For production deployments, you must generate your own certificates.
Configure Identity Provider
After services are running:
- Access Keycloak at
http://localhost:8281
- Follow our Keycloak Configuration Guide to set up:
- Realms
- Clients
- Roles
- Scopes
Deploy Application Components
After setting up the infrastructure services, you’ll need to build and deploy the Linqra application components.
Build JAR Files
Ensure you’re in the Linqra root directory:
The output should show your root directory, for example:
Build the application components using Maven:
This command will create the following JAR files:
Application | Jar File | Type |
---|---|---|
api-gateway | LiteGateway.jar | Gateway |
discovery-server | DiscoveryService.jar | Discovery |
The JAR files will be created in their respective target
folders within each component’s directory.
Run JAR Files
After building the JARs, you’ll need to start each component in the correct order.
Run the JAR Files from Terminal
EUREKA SERVER
- Start Eureka discovery-server by going to the target folder:
- Run the jar file along with the truststore jks file:
- Check the Eureka discovery-server endpoint:
GATEWAY
- Go to the api-gateway target folder:
- Run the jar file along with the truststore jks file:
Note that we are not simply using ‘java -jar FileName.jar’ because SSL requires the truststore parameters to be provided on the command line. These parameters:
are necessary for establishing secure SSL connections between services. Without them, the applications would fail with SSL handshake errors.
Run Client Applications
After setting up the core services, you can deploy client applications that integrate with the Linqra gateway.
Prepare Client Services
First, ensure you’ve downloaded the example client applications from their respective GitHub repositories.
For each client application, you’ll need to:
- Enable the environmental variables in your terminal:
- Build the application JAR files:
Run Inventory Service
Navigate to the inventory service project:
Build the application:
Navigate to the target directory:
Run the jar file with SSL configuration:
Run Product Service
Navigate to the product service project:
Build the application:
Navigate to the target directory:
Run the jar file with SSL configuration:
Now the last part. We need to start the web. Here is what we need to add:
Assuming you are still at the root folder. go to the web root folder $ cd edge-service/
Then run the web $ sudo npm run dev
Go to the https://localhost:3000/
If you see the “Your connection is not private” on the page, click the link “Proceed to localhost (unsafe)” to continue