Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
b3d9394
test(#223): add unit tests for data utils (getRRULE, getStartEndDates…
nadavosa May 18, 2026
ade9b6a
Merge branch 'develop' into 223-add-data-utils-tests
arturasmckwcz May 21, 2026
698f635
Merge branch 'develop' into 223-add-data-utils-tests
arturasmckwcz May 27, 2026
71387ac
chore: sync shared CLAUDE rules
arturasmckwcz Jun 18, 2026
7eb31d3
Merge pull request #698 from need4deed-org/chore/sync-claude-rules
arturasmckwcz Jun 18, 2026
25606ed
Merge branch 'develop' into 223-add-data-utils-tests
arturasmckwcz Jun 19, 2026
ccd59bf
fix(test): align data-utils tests with real implementations
arturasmckwcz Jun 19, 2026
fd2f9ee
Merge pull request #528 from need4deed-org/223-add-data-utils-tests
arturasmckwcz Jun 19, 2026
a1d083e
chore(test): fix no-unused-vars lint errors in types.test.ts
arturasmckwcz Jun 19, 2026
b452ccb
Merge pull request #699 from need4deed-org/chore-fix-test-lint-errors
arturasmckwcz Jun 19, 2026
d4add69
add: reading port from env var
arturasmckwcz Jun 21, 2026
0933aeb
Merge pull request #700 from need4deed-org/hotfix--add-setting-port-f…
arturasmckwcz Jun 21, 2026
90654cb
Link opportunity contact person to agent_person on legacy form submit…
nadavosa Jun 22, 2026
d2039f8
fix(#701): add language querystring schema to GET/PATCH /volunteer/:i…
arturasmckwcz Jun 22, 2026
6da69d8
refactor(notify): extract shared email-template helper (#703)
arturasmckwcz Jun 22, 2026
15ebb9d
feat(#679): add ActivityLog entity and CRUD endpoints (#704)
arturasmckwcz Jun 23, 2026
f8a0490
feat: add read_at to comment_person; mark-as-read endpoint (#705)
arturasmckwcz Jun 23, 2026
62fd31f
feat(fe#570): expose agentId on opportunity list response (#706)
arturasmckwcz Jun 23, 2026
acfb250
ci: add AITS deploy workflow (#707)
arturasmckwcz Jun 24, 2026
9844739
ci: bootstrap image workflow + idempotent bootstrap (#708)
arturasmckwcz Jun 24, 2026
21e9d24
chore: gitignore data-bootstrap/*.sql (#709)
arturasmckwcz Jun 24, 2026
87dcca5
chore: use scrambled dump for bootstrap; make idempotent (#710)
arturasmckwcz Jun 24, 2026
a11afa4
fix(deploy): connect as ubuntu, not root (#711)
arturasmckwcz Jun 24, 2026
3f8e8ab
fix(bootstrap): replace n4d_user with n4d; strip RDS scrambler marker…
arturasmckwcz Jun 24, 2026
2baa7cc
✨ feat: add POST /user/admin for admin-privileged user creation (#713)
arturasmckwcz Jun 24, 2026
0b7deed
fix: add workflow_dispatch to deploy-aits workflow (#714)
arturasmckwcz Jun 24, 2026
574900a
chore: upgrade need4deed-sdk to 0.0.115, clean up agentId workarounds
arturasmckwcz Jun 25, 2026
32d80a5
fix: skip agentId lookup for non-agent users in GET /user/me
arturasmckwcz Jun 25, 2026
210790f
test(dto-user): cover agentId presence and absence in serializeUserTo…
arturasmckwcz Jun 25, 2026
7e5cc59
Merge pull request #715 from need4deed-org/chore/sdk-0.0.115-agentid
arturasmckwcz Jun 25, 2026
e847196
feat: add POST /auth/request-reset endpoint for password reset
kiborrdis Jun 25, 2026
5b4b988
feat: add POST /auth/password-reset endpoint
kiborrdis Jun 25, 2026
00bf352
chore: add green path tests for reset/change password endpoints
kiborrdis Jun 25, 2026
bf8b98c
Merge branch 'develop' into change-password
arturasmckwcz Jun 26, 2026
4642908
feat: split password-reset endpoint to password-reset and password-ch…
kiborrdis Jun 26, 2026
49b1dc3
chore: move auth.routes schemas for reset-request, change/reset-passw…
kiborrdis Jun 26, 2026
e8b59ee
refactor: specific error classes for authenticate middleware
kiborrdis Jun 26, 2026
94c011e
Merge branch 'change-password' of github.com:kiborrdis/be into change…
kiborrdis Jun 26, 2026
16fb81d
refactor: authenticate, remove reply status calls, bypass try catch f…
kiborrdis Jun 28, 2026
a75c9e4
chore: make auth.test to be runnable without db spinned up, make test…
kiborrdis Jun 28, 2026
ec32634
chore: use responseSchema for request-reset, password-reset, password…
kiborrdis Jun 28, 2026
69f4840
refactor: remove enveloping try catch from authenticate, unneeded rep…
kiborrdis Jun 29, 2026
d46e27f
Merge pull request #716 from kiborrdis/change-password
arturasmckwcz Jun 29, 2026
8755a34
fix: clear auth cookies at the start of POST /auth/login
arturasmckwcz Jun 29, 2026
f268571
Merge pull request #717 from need4deed-org/clear-cookies-on-failed-login
arturasmckwcz Jun 30, 2026
3645fe8
feat: refactor seeds into reference/dev/fixtures layers; add e2e smok…
arturasmckwcz Jun 30, 2026
949bd5b
feat: implement outbound email system with 9 email types and hourly s…
arturasmckwcz Jul 1, 2026
43f00c9
test: add unit tests for german-holidays utilities
arturasmckwcz Jul 1, 2026
b1cc590
Merge branch 'develop' into clear-cookies-on-failed-login
arturasmckwcz Jul 1, 2026
ad5af2e
fix: address 14 code-review findings in email scheduler and scan jobs
arturasmckwcz Jul 1, 2026
eb4d262
fix: address 6 second-round review findings
arturasmckwcz Jul 1, 2026
fec83b1
chore: upgrade need4deed-sdk to 0.0.117, use OpportunityLegacyType enum
arturasmckwcz Jul 1, 2026
1a0c2e1
fix: harden email scan jobs and OV route side-effects
arturasmckwcz Jul 1, 2026
d90d15a
fix: address round-4 review findings in email scan jobs and routes
arturasmckwcz Jul 1, 2026
9a6b656
fix: address round-5 review findings
arturasmckwcz Jul 1, 2026
698bf7b
fix: harden scheduler, comm delete guard, and email send/rollback paths
arturasmckwcz Jul 1, 2026
9944396
fix: add coordinator guard to volunteer comm GET and complete dtoComm…
arturasmckwcz Jul 2, 2026
b7319a8
Merge pull request #718 from need4deed-org/clear-cookies-on-failed-login
arturasmckwcz Jul 2, 2026
7305160
add: HEAD to health check response
arturasmckwcz Jul 2, 2026
c697348
update: test
arturasmckwcz Jul 2, 2026
3937ac7
Merge pull request #721 from need4deed-org/hotfix--add-HEAD-sha-to-he…
arturasmckwcz Jul 2, 2026
3754672
add: gate outbound emails prod only
arturasmckwcz Jul 2, 2026
d67e574
Merge pull request #722 from need4deed-org/hotfix--send-emailsonly-in…
arturasmckwcz Jul 2, 2026
f87fb82
fix: move seed files out of gitignored dev/ directory
arturasmckwcz Jul 2, 2026
66b4849
fix: exclude e2e tests from default vitest run
arturasmckwcz Jul 2, 2026
c8849e7
Merge pull request #732 from need4deed-org/fix/seed-files-out-of-giti…
arturasmckwcz Jul 2, 2026
6ad4da5
feat: add dry-run mode to fastify.notify transports
arturasmckwcz Jul 2, 2026
6060306
refactor: remove env-gating from BrevoEmailTransport
arturasmckwcz Jul 2, 2026
925be36
chore: wire NOTIFY_EMAIL_DRY_RUN and NOTIFY_SLACK_DRY_RUN into Docker…
arturasmckwcz Jul 2, 2026
879095b
Merge pull request #733 from need4deed-org/notify-dry-run
arturasmckwcz Jul 2, 2026
35bd0f1
feat(post): add Post entity, feed endpoints and migration (#680)
arturasmckwcz Jul 6, 2026
bc99866
fix(post): correct m2m table names and self-auth check
arturasmckwcz Jul 6, 2026
fc5ec7c
refactor(post): move schema + types to shared folders
arturasmckwcz Jul 6, 2026
9179c5d
update: add-post mig
arturasmckwcz Jul 6, 2026
bf40f71
fix(post): restrict POST to AGENT+, simplify GET visibility
arturasmckwcz Jul 7, 2026
2cb20fd
fix(post): tighten ApiPostPost/ApiPostPatch AJV schemas
arturasmckwcz Jul 7, 2026
d5cc903
fix(post): validate relation IDs, resolve agentId, tighten auth
arturasmckwcz Jul 7, 2026
f9bd159
Merge pull request #735 from need4deed-org/680-post-entity
arturasmckwcz Jul 7, 2026
ff44e1d
chore: bump sdk patch
arturasmckwcz Jul 7, 2026
c986084
refactor: back to singulars
arturasmckwcz Jul 7, 2026
4060f3a
add: num opps to schema
arturasmckwcz Jul 7, 2026
a009417
add: num opps to dto
arturasmckwcz Jul 7, 2026
4c3d62f
test: strengthen dtoAgentGetList coverage
arturasmckwcz Jul 7, 2026
1c3b8f3
Merge pull request #738 from need4deed-org/add-num-of-opps-to-agent-g…
arturasmckwcz Jul 7, 2026
62efb9c
chore: upgrade need4deed-sdk to 0.0.120 (#739)
arturasmckwcz Jul 8, 2026
5ceb49f
feat: Infomaniak SMTP transport; dry-run redirect; mute cron flag (#740)
arturasmckwcz Jul 8, 2026
c12f02e
fix: upgrade need4deed-sdk to 0.0.122; fix dtoAgentOpportunity fields…
arturasmckwcz Jul 8, 2026
96d0579
fix: support title in PATCH /opportunity/:id (#743)
arturasmckwcz Jul 9, 2026
be0c6a2
🐛 fix: allow null for timeslots in POST /opportunity schema (#745)
arturasmckwcz Jul 11, 2026
4c5c097
refactor(post): extract validateRelationIds helper (#747)
arturasmckwcz Jul 12, 2026
79522f2
feat(notify): split SMTP into verify and notify transports
arturasmckwcz Jul 12, 2026
0338356
fix: set EMAIL_FROM_NOTIFY to coordinators@need4deed.org
arturasmckwcz Jul 12, 2026
6251955
feat(notify): add CC addresses to outbound notification emails
arturasmckwcz Jul 12, 2026
9018d24
refactor(notify): read sender addresses from env vars
arturasmckwcz Jul 12, 2026
d3319d7
use emailFromNotify as from on all 8 notification triggers
arturasmckwcz Jul 12, 2026
84cbffc
Merge pull request #748 from need4deed-org/738-dual-smtp-transports
arturasmckwcz Jul 12, 2026
74f350e
Merge pull request #749 from need4deed-org/749-add-cc-to-email-notifi…
arturasmckwcz Jul 12, 2026
4725f84
🐛 fix: make PLZ optional in agent address lookup so search fires on s…
arturasmckwcz Jul 12, 2026
8f71cb0
🐛 fix: embed role in verification URL so agent redirect doesn't need …
arturasmckwcz Jul 12, 2026
82749b9
Replace bootstrap SQL dump with clean seed infrastructure (#753)
arturasmckwcz Jul 13, 2026
5fbcd89
ci: fix bootstrap build context to be/ root (#754)
arturasmckwcz Jul 13, 2026
b21d1a6
fix: add genesis migration to unblock migration chain on empty DB (#756)
arturasmckwcz Jul 13, 2026
aadd3aa
fix: pre-populate be_migrations before TypeORM reads it on fresh DB
arturasmckwcz Jul 13, 2026
895be6e
Merge pull request #757 from need4deed-org/756-fix-genesis-bootstrap-…
arturasmckwcz Jul 13, 2026
61f64a8
fix(bootstrap): compile TypeScript at build time to reduce runtime me…
arturasmckwcz Jul 13, 2026
a23db92
Merge pull request #760 from need4deed-org/fix-bootstrap-compile-at-b…
arturasmckwcz Jul 13, 2026
ef2f8f4
fix(bootstrap): copy public assets and seed fixtures into production …
arturasmckwcz Jul 13, 2026
caff2ab
Merge pull request #761 from need4deed-org/fix-bootstrap-public-and-f…
arturasmckwcz Jul 13, 2026
9cc3053
672 feat auto update opportunity and match status when appointment da…
arturasmckwcz Jul 14, 2026
85b0184
fix: agent users get role agent (#763)
arturasmckwcz Jul 14, 2026
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
44 changes: 44 additions & 0 deletions .claude/shared-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Shared project rules

These rules apply to **all three repos** (`be`, `fe`, `sdk`). This file is synced from the
org `.github` repo — do not edit it inside a downstream repo; change it at the source and let
the sync open a PR. Repo-specific rules live below the import in each repo's own `CLAUDE.md`.

## API changes go through the SDK contract first

The `sdk` is the single source of truth for the API contract. Any change to the API surface
(endpoints, request/response shapes, types, error codes) **MUST** follow this order:

1. Define or update the contract in the `sdk` repo first.
2. Publish the new SDK version to npm.
3. Only then update `be` and `fe` to consume the change.

**IMPORTANT:** `be` and `fe` MUST depend on the SDK as published on **npmjs.com** — never on the
local `sdk` checkout or a sibling folder. Do not use `file:../sdk`, `npm link`, workspace or
`link:` references, or any other local linking for the SDK dependency. Pin to a version that is
actually published. If the version you need isn't on npmjs.com yet, the work is **not ready** to
land in `be`/`fe` — finish and publish the SDK first.

Do not implement or "stub" an API change in `be` or `fe` ahead of the contract. If the contract is
missing, wrong, or incomplete, fix it in `sdk` and publish — never work around it locally.

Allways make sure all API related issues are based on the latest dependency "need4deed-sdk".

## Reuse before you create

Before adding any new util, helper, hook, component, or shared function, **first search** the
codebase (and the SDK) for something that already does the job. Prefer reusing or extending
existing code over writing a near-duplicate. If nothing fits and you must add a new one, state
briefly why the existing options didn't work.

## Be conservative with database schema changes

Before altering the database schema:

- Confirm the change is **absolutely necessary** and cannot reasonably be solved without touching
the schema.
- Confirm it is **semantically correct** — names and structure must match existing modeling
conventions and clearly express what the data represents.

Surface the proposed change and your reasoning *before* writing a migration. Schema changes are
deliberate decisions, not incidental side effects of a feature.
29 changes: 26 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
# Transactional email via Brevo. EMAIL_FROM is the from address and must be a
# verified sender/domain in Brevo.
# Verification emails (email-verification, password-reset) — Infomaniak SMTP account #1.
EMAIL_FROM=no-reply@need4deed.org
BREVO_API_KEY=fake-string
SMTP_HOST=mail.infomaniak.com
SMTP_PORT=587
SMTP_USER=no-reply@need4deed.org
SMTP_PASS=fake-string

# Notification emails (cron scans, status-change triggers) — Infomaniak SMTP account #2.
# Infomaniak does not allow multiple senders on one SMTP account, hence the split.
EMAIL_FROM_NOTIFY=coordinators@need4deed.org
SMTP_NOTIFY_HOST=mail.infomaniak.com
SMTP_NOTIFY_PORT=587
SMTP_NOTIFY_USER=coordinators@need4deed.org
SMTP_NOTIFY_PASS=fake-string

# Verification email content is read from a per-locale CDN manifest
# (${CDN_BASE_URL}emails/verification.json), cached in-memory; falls back to
# built-in copy. Optional tuning:
EMAIL_TEMPLATE_TTL_MS=600000
EMAIL_TEMPLATE_FETCH_TIMEOUT_MS=5000

# Sender addresses for outbound notification emails (fall back to these defaults if unset).
# EMAIL_FROM_NOTIFY is the SMTP account used as `from` on all 8 notification triggers.
EMAIL_FROM_NOTIFY=coordinators@need4deed.org
EMAIL_FROM_VOLUNTEER=volunteer@need4deed.org
EMAIL_FROM_CONTACT=contact@need4deed.org
EMAIL_FROM_ACCOMPANYING=accompanying@need4deed.org

# Notification controls (default: dry-run on in non-prod, cron active)
# NOTIFY_DRY_RUN=true — redirect all emails to test@need4deed.org with [TO: <original>] subject prefix
# NOTIFY_EMAIL_DRY_RUN=true — same, email-only override
# NOTIFY_CRON_MUTED=true — suppress cron-triggered email scans entirely

CORS_ORIGINS=http://localhost:3000,http://localhost:3100,http://localhost:3200
CORS_CREDENTIALS=true

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/build-bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build-bootstrap

on:
push:
branches: [develop]
paths:
- data-bootstrap/**
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push bootstrap image
uses: docker/build-push-action@v6
with:
context: .
file: data-bootstrap/Dockerfile
push: true
tags: ghcr.io/need4deed-org/bootstrap:latest
37 changes: 37 additions & 0 deletions .github/workflows/deploy-aits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: deploy-aits

on:
push:
branches: [develop]
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/need4deed-org/be:develop

- name: Roll out new image on AITS
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.AITS_HOST }}
username: ubuntu
key: ${{ secrets.AITS_SSH_KEY }}
script: kubectl rollout restart deployment/be -n n4d-dev
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# raw database dump — contains real PII, never commit
data-bootstrap/dev.dump.sql

.idea/
.vscode/
node_modules/
Expand Down
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@.claude/shared-rules.md

# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Expand Down Expand Up @@ -163,7 +165,8 @@ Copy `.env.example` to `.env` and fill in real values. Key variables:
- `JWT_SECRET` — required; server refuses to start without it
- `NODE_ENV` — `development` | `test` | `production`
- `RUN_MIGRATIONS` — when truthy, auto-run pending migrations on server startup (always on in prod regardless of this flag); see Commands section
- `EMAIL_FROM`, `BREVO_API_KEY` — transactional email via Brevo (verified sender + API key)
- `EMAIL_FROM`, `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS` — Infomaniak SMTP account for verification emails (email-verification, password-reset)
- `EMAIL_FROM_NOTIFY`, `SMTP_NOTIFY_HOST`, `SMTP_NOTIFY_PORT`, `SMTP_NOTIFY_USER`, `SMTP_NOTIFY_PASS` — Infomaniak SMTP account for notification emails (cron scans, status-change triggers); separate account because Infomaniak does not allow multiple senders on one SMTP account
- `EMAIL_TEMPLATE_TTL_MS`, `EMAIL_TEMPLATE_FETCH_TIMEOUT_MS` — optional; cache TTL + fetch timeout for the verification-email CDN manifest (`${CDN_BASE_URL}emails/verification.json`); falls back to built-in copy
- `CORS_ORIGINS` — comma-separated list of allowed origins

Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@

# Note: JWT_SECRET should be provided at runtime via secrets management
# not as build args for security reasons
ARG NODE_ENV=${NODE_ENV:-production}

Check warning on line 12 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$NODE_ENV' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ARG CDN_BASE_URL
ARG NIDS_TOKEN

Check warning on line 14 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NIDS_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG RUN_MIGRATIONS=${RUN_MIGRATIONS:-true}

Check warning on line 15 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$RUN_MIGRATIONS' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ARG GIT_COMMIT_SHA=${GIT_COMMIT_SHA:-unknown}

Check warning on line 16 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$GIT_COMMIT_SHA' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ARG NOTIFY_EMAIL_DRY_RUN=false
ARG NOTIFY_SLACK_DRY_RUN=false

ENV NODE_ENV=${NODE_ENV}
ENV PORT=8000
ENV CDN_BASE_URL=${CDN_BASE_URL}
ENV NIDS_TOKEN=${NIDS_TOKEN}

Check warning on line 23 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "NIDS_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV RUN_MIGRATIONS=${RUN_MIGRATIONS}
ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
ENV NOTIFY_EMAIL_DRY_RUN=${NOTIFY_EMAIL_DRY_RUN}
ENV NOTIFY_SLACK_DRY_RUN=${NOTIFY_SLACK_DRY_RUN}
WORKDIR /app

RUN apk update && apk add --no-cache curl dumb-init
Expand Down
33 changes: 13 additions & 20 deletions data-bootstrap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
FROM postgres:17.2

# Install postgresql-client for pg_restore/psql commands

# Set environment variables for external database connection
ENV PGHOST=localhost
ENV PGPORT=5432
ENV PGDATABASE=mydb
ENV PGUSER=postgres
ENV PGPASSWORD=password

# Copy the SQL files
COPY *.sql /app/

# Create script to restore dump to external database
COPY bootstrap.sh /app/
RUN chmod +x /app/bootstrap.sh

FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production=false
COPY . .
RUN yarn build

# Run the restore script
CMD ["/app/bootstrap.sh"]
FROM node:22-alpine
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production=true && yarn cache clean
COPY --from=builder /app/build ./build
COPY public ./build/public
COPY src/data/seeds/fixtures ./build/src/data/seeds/fixtures
CMD ["node", "build/src/data/seeds/run.js"]
21 changes: 0 additions & 21 deletions data-bootstrap/bootstrap.sh

This file was deleted.

25 changes: 15 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ services:
environment:
- NODE_ENV=${NODE_ENV}
- RUN_MIGRATIONS=${RUN_MIGRATIONS:-true}
- PORT=5000
- PORT=8000
- NOTIFY_EMAIL_DRY_RUN=true
- NOTIFY_SLACK_DRY_RUN=true
- DB_HOST=db
- DB_PORT=5432
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- DB_NAME=postgres
- DB_SCHEMA=public
ports:
- 5000:5000
- ${BE_PORT:-5000}:${PORT:-8000}
networks:
- n4d-net
volumes:
- ./:/app
command: ["yarn", "dev"]
Expand All @@ -33,8 +37,13 @@ services:
db:
condition: service_healthy
build:
context: ./data-bootstrap
context: .
dockerfile: data-bootstrap/Dockerfile
networks:
- n4d-net
environment:
- NODE_ENV=development
- RUN_MIGRATIONS=true
- DB_HOST=db
- DB_PORT=5432
- DB_USER=postgres
Expand All @@ -44,7 +53,7 @@ services:

db:
container_name: db
image: postgres:17.2
image: postgres:17.9
ports:
- 5432:5432
environment:
Expand All @@ -56,18 +65,14 @@ services:
POSTGRES_DB: postgres
volumes:
- be_database:/var/lib/postgresql
networks:
- n4d-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
localstack:
image: localstack/localstack
ports:
- "4566:4566"
environment:
- SERVICES=ses

volumes:
be_database:
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"@swc/core": "^1.15.10",
"@swc/helpers": "^0.5.18",
"@types/node": "^24.9.1",
"@types/node-cron": "^3.0.11",
"@types/nodemailer": "^8.0.1",
"@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2",
"@typescript-eslint/utils": "^8.46.2",
Expand Down Expand Up @@ -41,7 +43,9 @@
"class-validator": "^0.14.2",
"fastify": "^5.3.3",
"fastify-plugin": "^5.0.1",
"need4deed-sdk": "0.0.110",
"need4deed-sdk": "0.0.125",
"node-cron": "^4.5.0",
"nodemailer": "^9.0.3",
"pg": "^8.14.1",
"pino": "^10.3.1",
"pino-pretty": "^13.0.0",
Expand All @@ -51,6 +55,7 @@
},
"scripts": {
"start": "ts-node src/index.ts",
"seed": "ts-node src/data/seeds/run.ts",
"dev": "nodemon",
"typeorm": "typeorm-ts-node-commonjs -d src/data/data-source.ts",
"migration:generate": "yarn typeorm migration:generate",
Expand All @@ -68,6 +73,7 @@
"test:watch": "yarn test --watch",
"test:coverage": "yarn test --coverage",
"test:ui": "yarn test --ui",
"test:e2e": "vitest run --config vitest.e2e.config.ts",
"prepare": "husky",
"what": "./get-json-field-value.sh package.json"
},
Expand Down
Loading
Loading