Skip to content

Latest commit

 

History

History
131 lines (109 loc) · 3.29 KB

setup.md

File metadata and controls

131 lines (109 loc) · 3.29 KB

Setup Instructions for Superposition Platform

This document outlines the setup process for the Superposition Platform.

Installation for Linux/MacOS

  • Install rust.

  • Install wasm-pack

  • Install Docker

  • Installing Lib Dependencies & Tools :
    libpq, openssl, libiconv are required for building the project. diesel_cli and aws cli is needed for dev.

    For MacOS :

    brew install libpq openssl libiconv awscli

    Set the PQ_LIB_DIR environment variable for ensuring libpq is picked up by diesel and/or diesel_cli.

    export PQ_LIB_DIR="$(brew --prefix libpq)/lib"

    diesel_cli can be installed using cargo.

    cargo install diesel_cli --no-default-features --features postgres
  • Configure AWS CLI

    aws configure

    Use the following values as input:
    - AWS Access Key ID: Test
    - AWS Secret Access Key: Test
    - Default region name: None
    - Default output format: None

  • Ensure make Command is Installed

    • For Linux:
      sudo apt-get install build-essential
    • For MacOS:
      xcode-select --install
  • Clone the Repository

    git clone https://github.com/juspay/superposition.git
    cd superposition
  • Start Docker Daemon

    • For Linux:
      sudo systemctl start docker
    • For MacOS:
      open --background -a Docker
  • Setup Database and Environment Variables

    make setup
  • Run Superposition

    make run

Nix Installation

  • Install docker
  • make sure you have dependencies like libpq, openssl, libiconv,etc installed
  • Clone the repository
    git clone https://github.com/juspay/superposition.git
    cd superposition
  • run nix develop
  • Start docker daemon
    open --background -a Docker
  • setup database and envs make setup
  • Run Superposition make run

Check Installation

Check /health endpoint

 curl --location 'http://localhost:8080/health'
 # Expected Response : "Health is good :D"

Creating New Tenants

 make tenant TENANT=<tenant_name> 
 # Add the tenant in the TENANTS env variable. For example TENANTS=dev,test,<tenant_name>
 # Stop the server and run: 
 make run

Additional Information

Make Targets

The following targets are available

  • db-init: Initializes the database.
  • setup: Sets up the development environment.
  • kill: Stops all running containers.
  • run: Runs the application in development mode.
  • ci-test: Runs unit tests.
  • ci-build: Builds the Docker image.
  • ci-push: Pushes the Docker image to a registry.
  • registry-login: Logs in to a Docker registry.
  • validate-aws-connection: Validates the AWS connection.
  • validate-psql-connection: Validates the PostgreSQL connection.

Environment Variables

Variable Description Default Value
ENABLE_TENANT_AND_SCOPE Enables multi-tenancy true
TENANTS List of Tenants dev,test
DOCKER_DNS DNS server to use within the container localhost