Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions .earthlyignore

This file was deleted.

3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_env_if_exists ".envrc.local"
use flake . --impure
dotenv_if_exists ".env"
20 changes: 0 additions & 20 deletions .github/actions/env/action.yml

This file was deleted.

29 changes: 15 additions & 14 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@ name: Release
on:
push:
tags:
- 'v*.*.*'
- "v*.*.*"
permissions:
contents: write

jobs:
OpenAPI:
Release:
runs-on: "ubuntu-latest"
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- uses: 'actions/checkout@v4'
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/env
- name: Generate OpenAPI final specification
run: >
earthly +build-final-spec --version=${{github.ref_name}}
- uses: cachix/install-nix-action@v31
- name: Build OpenAPI spec and events
run: nix develop --impure --command just build ${{github.ref_name}}
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
- name: Create Release
run: gh release create ${{github.ref_name}} --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add the OpenAPI file to the release assets
run: >
run: |
gh release upload ${{github.ref_name}} ./releases/build/generate.json#openapi.json
gh release upload ${{github.ref_name}} ./events/generated/all.json#events.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish OpenAPI to Speakeasy Registry
run: nix develop --impure --command speakeasy run -s all --registry-tags ${{github.ref_name}},LATEST_RELEASE
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ worktrees
.env


# Earthly
.tmp-earthly-out
# Downloaded OpenAPI specs
components/
.DS_Store
openapi/node_modules
node_modules/


.kubeconfig
Expand Down
41 changes: 41 additions & 0 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
speakeasyVersion: 1.768.2
sources:
stacks-source:
sourceNamespace: stacks-source
sourceRevisionDigest: sha256:45c10ea1febd1e251f079e49a7b0517f74e6b8b5416e12daf850cd551347688a
sourceBlobDigest: sha256:c4a8e0d72bb2f338b2195495b4cd51647e3cbb8f4bf161a3b8370eb33e2511be
tags:
- latest
- SDK_VERSION
targets: {}
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
stacks-source:
inputs:
- location: ./components/auth.openapi.yaml
modelNamespace: auth
- location: ./components/gateway.openapi.yaml
modelNamespace: gateway
- location: ./components/ledger.openapi.yaml
modelNamespace: ledger
- location: ./components/payments.openapi.yaml
modelNamespace: payments
- location: ./components/search.openapi.yaml
modelNamespace: search
- location: ./components/webhooks.openapi.yaml
modelNamespace: webhooks
- location: ./components/wallets.openapi.yaml
modelNamespace: wallets
- location: ./components/orchestration.openapi.yaml
modelNamespace: orchestration
- location: ./components/reconciliation.openapi.yaml
modelNamespace: reconciliation
- location: ./releases/base.yaml
overlays:
- location: ./releases/overlays/shared.overlay.yaml
output: ./releases/build/generate.json
registry:
location: registry.speakeasyapi.dev/formance/formance/stacks-source
targets: {}
30 changes: 30 additions & 0 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
stacks-source:
inputs:
- location: ./components/auth.openapi.yaml
modelNamespace: auth
- location: ./components/gateway.openapi.yaml
modelNamespace: gateway
- location: ./components/ledger.openapi.yaml
modelNamespace: ledger
- location: ./components/payments.openapi.yaml
modelNamespace: payments
- location: ./components/search.openapi.yaml
modelNamespace: search
- location: ./components/webhooks.openapi.yaml
modelNamespace: webhooks
- location: ./components/wallets.openapi.yaml
modelNamespace: wallets
- location: ./components/orchestration.openapi.yaml
modelNamespace: orchestration
- location: ./components/reconciliation.openapi.yaml
modelNamespace: reconciliation
- location: ./releases/base.yaml
overlays:
- location: ./releases/overlays/shared.overlay.yaml
output: ./releases/build/generate.json
registry:
location: registry.speakeasyapi.dev/formance/formance/stacks-source
targets: {}
59 changes: 0 additions & 59 deletions Earthfile

This file was deleted.

59 changes: 59 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Component versions
LEDGER_VERSION := "v2.4.3"
PAYMENTS_VERSION := "v3.2.0"
WALLETS_VERSION := "v2.1.5"
WEBHOOKS_VERSION := "v2.2.0"
AUTH_VERSION := "v2.4.3"
SEARCH_VERSION := "v2.1.0"
ORCHESTRATION_VERSION := "v2.4.1"
RECONCILIATION_VERSION := "v2.2.2"
GATEWAY_VERSION := "v2.2.0"

# Download all component OpenAPI specs from GitHub releases
download-specs:
mkdir -p components
wget -q https://github.com/formancehq/ledger/releases/download/{{LEDGER_VERSION}}/openapi.yaml -O components/ledger.openapi.yaml
wget -q https://github.com/formancehq/payments/releases/download/{{PAYMENTS_VERSION}}/openapi.yaml -O components/payments.openapi.yaml
wget -q https://github.com/formancehq/gateway/releases/download/{{GATEWAY_VERSION}}/openapi.yaml -O components/gateway.openapi.yaml
wget -q https://github.com/formancehq/auth/releases/download/{{AUTH_VERSION}}/openapi.yaml -O components/auth.openapi.yaml
wget -q https://github.com/formancehq/search/releases/download/{{SEARCH_VERSION}}/openapi.yaml -O components/search.openapi.yaml
wget -q https://github.com/formancehq/webhooks/releases/download/{{WEBHOOKS_VERSION}}/openapi.yaml -O components/webhooks.openapi.yaml
wget -q https://github.com/formancehq/wallets/releases/download/{{WALLETS_VERSION}}/openapi.yaml -O components/wallets.openapi.yaml
wget -q https://github.com/formancehq/reconciliation/releases/download/{{RECONCILIATION_VERSION}}/openapi.yaml -O components/reconciliation.openapi.yaml
wget -q https://github.com/formancehq/flows/releases/download/{{ORCHESTRATION_VERSION}}/openapi.yaml -O components/orchestration.openapi.yaml

# Prepend API path prefix to each component spec
prepend-paths: download-specs
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/auth" + .key) | from_entries)' components/auth.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/ledger" + .key) | from_entries)' components/ledger.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/payments" + .key) | from_entries)' components/payments.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/search" + .key) | from_entries)' components/search.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/webhooks" + .key) | from_entries)' components/webhooks.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/wallets" + .key) | from_entries)' components/wallets.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/orchestration" + .key) | from_entries)' components/orchestration.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/reconciliation" + .key) | from_entries)' components/reconciliation.openapi.yaml

# Strip component-level servers blocks so only base.yaml servers survive the merge
strip-servers: prepend-paths
for f in components/*.openapi.yaml; do yq -i 'del(.servers)' "$f"; done

# Build the merged OpenAPI spec using Speakeasy
build-openapi version="v0.0.0": strip-servers
mkdir -p releases/build
speakeasy run -s all
cd releases && sed -i'' -e 's/SDK_VERSION/{{version}}/g' build/generate.json

# Generate event schemas
generate-events:
cd events && npm install
cd events && node index.js

# Build everything (OpenAPI spec + events)
build version="v0.0.0": (build-openapi version) generate-events

# Publish OpenAPI spec to Speakeasy Registry
publish-speakeasy version: prepend-paths
speakeasy run -s all --registry-tags {{version}},LATEST_RELEASE

# Pre-commit: build spec and generate events
pre-commit: (build-openapi) generate-events
30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,6 @@ fctl ui

[1] https://docs.formance.com/guides/newSandbox

## 💻 Getting started locally

### Requirements
1. Make sure docker is installed on your machine.
2. Ensure your docker daemon has at least 5GB uf usable RAM available. Otherwise you will run into random crashes.
3. Make sure Docker Compose is installed and available (it should be the case if you have chosen to install Docker via Docker Desktop); and
4. Make sure Git is also installed on your machine.


### Run the app
To start using Formance Stack, run the following commands in a shell:

```
# Get the code
git clone https://github.com/formancehq/stack.git

# Go to the cloned stack directory
cd stack

# Start the stack containers
docker compose up
```

The Stack's API is exposed at http://localhost/api.

You can run :
````
curl http://localhost/api/ledger/_info
````

## ☁️ Cloud Native Deployment

The Formance Stack is distributed as a collection of binaries, with optional packaging as Docker images and configuration support through command line options and environment variables. The recommended, standard way to deploy the collection of services is to a Kubernetes cluster through our Formance official Helm charts, which repository is available at [helm.formance.com](https://helm.formance.com/).
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading