# All-in-one Demo Chart

Source: https://docs.formance.com/v4.0/deploy/self-hosted/demo/quick-start

Stack: v4.0

This guide shows you how to deploy a fully working Formance stack for testing using the unified `formance` Helm chart, the `ce-minimal.yaml` profile, and explicit demo resources.

## What Gets Deployed

The steps below install `ce-minimal.yaml` and then apply the demo `Stack`, `Settings`, `Gateway`, and `Ledger` resources that the `ce-demo.yaml` profile encodes as Helm values:

- **Bundled PostgreSQL** — the unified chart's default standalone PostgreSQL
- **A `demo-dev` stack** — Gateway and Ledger modules on version `v3.1`
- **Settings** — PostgreSQL URI, resource requests, and replica count applied with the demo resources
- Each module runs with **2 replicas** and minimal resources (50m CPU, 500Mi memory)

## Install the Demo

These steps install `ce-minimal.yaml`, then apply the demo `Stack`, `Settings`, `Gateway`, and `Ledger` resources explicitly. This matches what the `ce-demo.yaml` profile renders, while keeping each resource visible below.

Before running the install, install the CRDs by following [Install the CRDs](https://docs.formance.com/v4.0/deploy/self-hosted/installation/operator-setup#install-the-crds). The chart creates a `Versions` resource, and the resource file below creates `Stack`, `Settings`, `Gateway`, and `Ledger` resources; all depend on the `formance.com` CRDs being established first.

**Storage:** The rendered chart requests persistent storage:

- `StatefulSet/postgresql:data` requests `8Gi` with the default StorageClass.

Before installation, provide the named StorageClass, a usable default StorageClass where requested, or matching existing volumes. Rendering does not prove that Kubernetes can provision or bind this storage. This demo is for evaluation, not production.

**Access:** No public hostname is configured. Use the port-forward commands below for local access.

Install the chart with the minimal profile:

```bash
helm upgrade --install formance {{infra.helm-chart-url}} \
  --version {{infra.helm-chart-version}} \
  --namespace formance-system \
  --set regions.operator.operator-crds.create=false \
  --create-namespace \
  -f https://raw.githubusercontent.com/formancehq/helm/formance-3.13.1/charts/formance/profiles/ce-minimal.yaml
```

Apply the demo `Stack`, `Settings`, and modules:

```yaml
# demo.yaml
apiVersion: formance.com/v1beta1
kind: Stack
metadata:
  name: demo-dev
spec:
  debug: true
  versionsFromFile: v3.1
---
apiVersion: formance.com/v1beta1
kind: Settings
metadata:
  name: postgres-uri
spec:
  key: postgres.*.uri
  stacks:
    - "*"
  value: "postgresql://formance:formance@postgresql.formance-system.svc:5432?disableSSLMode=true"
---
apiVersion: formance.com/v1beta1
kind: Settings
metadata:
  name: resource-requests
spec:
  key: deployments.*.containers.*.resource-requirements.requests
  stacks:
    - "*"
  value: "cpu=50m,memory=500Mi"
---
apiVersion: formance.com/v1beta1
kind: Settings
metadata:
  name: replicas
spec:
  key: deployments.*.replicas
  stacks:
    - "*"
  value: "2"
---
apiVersion: formance.com/v1beta1
kind: Gateway
metadata:
  name: demo-dev
spec:
  stack: demo-dev
---
apiVersion: formance.com/v1beta1
kind: Ledger
metadata:
  name: demo-dev
spec:
  stack: demo-dev
```

```bash
kubectl apply -f demo.yaml
```

## Verify the Installation

Check that the operator and PostgreSQL pods are running:

```bash
kubectl get pods -n formance-system
```

Check that the stack has been created:

```bash
kubectl get stacks
```

You should see a `demo-dev` stack. Wait for all stack modules to become ready:

```bash
kubectl get pods --all-namespaces -l formance.com/stack
```

## Access the Demo

Port-forward the Gateway to access the stack API locally:

```bash
kubectl port-forward -n demo-dev svc/gateway 8080:8080
```

Verify the stack is responding:

```bash
curl http://localhost:8080/versions
```

## What's Inside the CE Demo Profile

The `ce-demo.yaml` profile configures the following Helm values:

```yaml
global:
  serviceHost: "formance.localhost"
  exports:
    stacks: &stacks
      demo-dev:
        debug: true
        versionsFromFile: "v3.1"
        modules:
          gateway: {}
          ledger: {}

regions:
  settings:
    resource-requests:
      key: deployments.*.containers.*.resource-requirements.requests
      value: "cpu=50m,memory=500Mi"
    replicas:
      key: deployments.*.replicas
      value: "2"
    postgres-uri:
      key: postgres.*.uri
      value: 'postgresql://{{ include "resolveGlobalOrServiceValue" (dict "Context" $ "Key" "postgresql.auth.username" "Default" "") }}:{{ include "resolveGlobalOrServiceValue" (dict "Context" $ "Key" "postgresql.auth.password" "Default" "") }}@postgresql.{{ $.Release.Namespace }}.svc:5432?disableSSLMode=true'
  stacks: *stacks
```

With the default `formance` username and password and the `formance-system` release namespace, the `postgres-uri` value resolves to the connection string used in the `demo.yaml` above.

## Create Your Own Demo Stack

Instead of using the profile, define a custom demo stack directly in your values:

```yaml
# custom-demo.yaml
regions:
  settings:
    postgres-uri:
      key: "postgres.*.uri"
      value: "postgresql://formance:formance@postgresql.formance-system.svc:5432?disableSSLMode=true"
  stacks:
    my-test-stack:
      versionsFromFile: "v3.1"
      modules:
        gateway: {}
        ledger: {}
        payments: {}
```

```bash
helm upgrade --install formance {{infra.helm-chart-url}} \
  --version {{infra.helm-chart-version}} \
  --namespace formance-system \
  --set regions.operator.operator-crds.create=false \
  --create-namespace \
  -f custom-demo.yaml
```

## Clean Up

To remove the demo deployment:

```bash
helm uninstall formance -n formance-system
```
