Skip to content
Merged
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
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
id: docker_build
uses: docker/build-push-action@v6
with:
context: packages/fastify-app
push: true
tags: supabase/stripe-sync-engine:latest,supabase/stripe-sync-engine:v${{ needs.release.outputs.new-release-version }}
platforms: linux/amd64,linux/arm64
Expand Down
5 changes: 2 additions & 3 deletions packages/fastify-app/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ FROM node:22-alpine
RUN npm install -g pnpm@10.10.0

WORKDIR /app
COPY package.json pnpm-lock.yaml ./
COPY . ./
RUN pnpm install --frozen-lockfile
COPY . /app
RUN pnpm build
RUN pnpm prune --production

Expand All @@ -15,4 +14,4 @@ FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY --from=0 /app .
CMD ["npm", "start"]
CMD ["node", "packages/fastify-app/dist/src/server.js"]
2 changes: 1 addition & 1 deletion packages/fastify-app/.env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DATABASE_URL=postgres://postgres:postgres@host:5432/postgres?sslmode=disable&search_path=stripe
DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable&search_path=stripe
STRIPE_WEBHOOK_SECRET=whsec_

# API_KEY is used to authenticate "admin" endpoints (i.e. for backfilling), make sure to generate a secure string
Expand Down
4 changes: 2 additions & 2 deletions packages/fastify-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "@supabase/stripe-sync-fastify",
"version": "0.0.0",
"description": "Stripe sync engine. Sync your Stripe account to your Postgres database.",
"main": "index.js",
"main": "src/server.ts",
"scripts": {
"clean": "rimraf dist",
"dev": "tsx --watch ./src/server.ts",
"build": "pnpm clean && tsc -p tsconfig.json",
"typecheck": "tsc -p tsconfig.json --noEmit",
"lint": "eslint src --ext .ts",
"start": "NODE_ENV=production node dist/server.js",
"start": "NODE_ENV=production node dist/src/server.js",
"test": "vitest"
},
"author": "Supabase",
Expand Down
3 changes: 2 additions & 1 deletion packages/fastify-app/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import path from 'node:path'
import { getConfig } from './utils/config'
import { StripeSync } from '@supabase/stripe-sync-engine'
import { errorSchema } from './error'
import { logger } from './logger'

interface buildOpts extends FastifyServerOptions {
exposeDocs?: boolean
Expand All @@ -15,7 +16,7 @@ export async function createServer(opts: buildOpts = {}): Promise<FastifyInstanc
const app = fastify(opts)

const config = getConfig()
const stripeSync = new StripeSync(config)
const stripeSync = new StripeSync({ ...config, logger })

app.decorate('stripeSync', stripeSync)

Expand Down
1 change: 1 addition & 0 deletions packages/fastify-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"module": "commonjs",
"outDir": "dist",
"declaration": true,
"declarationMap": true,
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
"skipLibCheck": true,
"incremental": true
},
"exclude": ["node_modules", "dist"],
"references": [{ "path": "./packages/sync-engine" }, { "path": "./packages/fastify-app" }]
"exclude": ["node_modules", "dist"]
}