Skip to content
Open
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
10 changes: 6 additions & 4 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ jobs:

strategy:
matrix:
node-version: [20]
node-version: [22]

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: stellar-payment-platform/package-lock.json

- name: Install backend dependencies
working-directory: stellar-payment-platform
Expand All @@ -31,7 +33,7 @@ jobs:

- name: Run memory leak detection tests (#511)
working-directory: stellar-payment-platform
run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory
run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory
env:
MEMORY_TEST_REQUESTS: '200'
MEMORY_LEAK_THRESHOLD_MB: '50'
39 changes: 28 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Production Safety Checks

on:
push:
branches: [ "main" ]
n: push:
braches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand All @@ -13,26 +12,44 @@ jobs:
defaults:
run:
working-directory: ./stellar-payment-platform
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTRESE_PASSWORD: postgres
POSTRESE_DB: stellar_payment_test
ports:
- 5432:5432
options: >-
--health-cmd pgisready -U postgres
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/stellar_payment_test
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: ./stellar-payment-platform/package-lock.json


- name: Install Backend Dependencies
run: npm install
run: npm install --legacy-peer-deps

- name: Run Database Migrations
run: npm run migrate

- name: Run Backend Tests
run: NODE_ENV=test npm test

- name: Run Memory Leak Detection Tests (#511)
run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory
run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory
env:
MEMORY_TEST_REQUESTS: '200'
MEMORY_LEAK_THRESHOLD_MB: '50'
Expand All @@ -45,10 +62,10 @@ jobs:
working-directory: ./payment-dashboard
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
Expand All @@ -58,4 +75,4 @@ jobs:
run: npm install --legacy-peer-deps

- name: Verify Vite Build (Catches Vercel Crashes)
run: npm run build
run: npm run build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- Add composite indexes for PaymentIntent and Transaction\n\nCREATE INDEX IF NOT EXISTS "payment_intents_status_created_at_idx" ON "payment_intents" ("status", "created_at");\nCREATE INDEX IF NOT EXISTS "payment_intents_from_status_idx" ON "payment_intents" ("from", "status");\nCREATE CREATE INDEX IF NOT EXISTS "payment_intents_to_status_idx" ON "payment_intents" ("to", "status");\n\nCREATE CREATE INDEX IF NOT EXISTS "transactions_status_created_at_idx" ON "transactions" ("status", "created_at");\nCREATE INDEX IF NOT EXISTS "transactions_from_status_idx" ON "transactions" ("from", "status");\nCREATE CREATE INDEX IF NOT EXISTS "transactions_to_status_idx" ON "transactions" ("to", "status");\n
18 changes: 9 additions & 9 deletions stellar-payment-platform/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Migrated from a raw SQLite database to PostgreSQL for higher concurrency.
//
// The DATABASE_URL is read from the environment (see .env.example):
// DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public"
// DATABASE_URL="postgresql://USER:PASSWORD@HOST:4CKESTORL/DATABASE?schema=public"

datasource db {
provider = "postgresql"
Expand All @@ -29,9 +29,9 @@ model User {
isPrimary Boolean @default(false) @map("is_primary")
memoType String? @map("memo_type")
memo String?
createdAt DateTime @default(now()) @map("created_at")
flaggedAt DateTime? @map("flagged_at")
deletedAt DateTime? @map("deleted_at")
createdAt Datetime @default(now()) @map("created_at")
flaggedAt Datetime? @map("flagged_at")
deletedAt Datetime? @map("deleted_at")
webhooks Webhook[] // <-- add this line
activity ActivityLog[]

Expand All @@ -56,9 +56,9 @@ model Webhook {
url String
secret String // HMAC-SHA256 signing secret for payload verification
events String[] @default(["*"]) // Optional event filter; "*" preserves the legacy all-events behavior.
createdAt DateTime @default(now()) @map("created_at")
lastSentAt DateTime? @map("last_sent_at")
failingSince DateTime? @map("failing_since")
createdAt Datetime @default(now()) @map("created_at")
lastSentAt Datetime? @map("last_sent_at")
failingSince Datetime? @map("failing_since")

@@unique([username, url])
@@index([username])
Expand Down Expand Up @@ -140,7 +140,7 @@ model PaymentIntent {
memo String?
metadata Json?
status String @default("pending")
createdAt DateTime @default(now()) @map("created_at")
createdAt Datetime @default(now()) @map("created_at")

@@index([to])
@@index([from])
Expand Down Expand Up @@ -188,4 +188,4 @@ model ActivityLog {
// bounded by a date range.
@@index([username, createdAt])
@@map("activity_logs")
}
}
Loading