This document outlines the setup process for the Superposition Platform
.
-
Install rust.
-
Install wasm-pack
-
Install Docker
-
Installing Lib Dependencies & Tools :
libpq
,openssl
,libiconv
are required for building the project.diesel_cli
andaws 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 usingcargo
.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
- For Linux:
-
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
- For Linux:
-
Setup Database and Environment Variables
make setup
-
Run Superposition
make run
- 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
curl --location 'http://localhost:8080/health'
# Expected Response : "Health is good :D"
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
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.
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 |