Full-stack application that tracks real-time new versions of artifacts published on npm, Maven Central, PyPI, Go modules and crates.io, and notifies users by email (immediately or as a digest recap, as they choose).
- Backend: Node + NestJS 12, Prisma + SQLite, multi-provider OIDC, polling (npm, Maven/PyPI/Go/crates.io), email sending via SMTP (Mailtrap by default).
- Frontend: Angular 22, OIDC authentication and management of artifact subscriptions.
Inspired by an original Deno POC: only new versions of artifacts actually followed by at least one user are stored in the database.
artifact-notifier/
├── backend/ # NestJS + Prisma + real-time listeners + notifications
├── frontend/ # Angular 22 (OIDC auth, dashboard, preferences)
└── package.json # `dev` scripts (concurrently)
- Listeners (npm changes feed / Maven polling / PyPI RSS / Go module index / crates.io RSS, plus a periodic sweep of followed artifacts) receive new publications from their ecosystem.
- Each listener filters by the set of followed artifacts (cached, refreshed every 30 s). Everything else is ignored.
- For a followed artifact whose version is higher than the known version:
- update of
FollowedArtifact.currentVersion - creation of an
ArtifactVersionEvent(only 1 per(artifact, version)) - creation of a PENDING
NotificationDeliveryper user following the artifact
- update of
- Depending on user preferences:
IMMEDIATE→ email sent right away, delivery markedSENTDIGEST→ recap email sent once the configured interval has elapsed, grouping allPENDINGdeliveries of that user
Notification state is therefore per (event, user) via the
NotificationDelivery table — two users following the same artifact with different
intervals still receive their notifications independently.
- Node.js 20+
- npm 10+
- A Mailtrap account (or another SMTP server) for emails
- At least one configured OIDC provider (Google / GitHub / Facebook)
# 1. Install all dependencies (backend + frontend)
npm run install:all
# 2. Configure the backend
cp backend/.env.example backend/.env
# edit backend/.env (SMTP, JWT_SECRET, OIDC providers — see below)
# 3. Create the SQLite database (single init migration, also generates the client)
npm run backend:migrateThe backend loads providers from .env via OIDC_PROVIDERS (comma-separated
list). For each provider xxx (lowercase), fill in:
| Variable | Description |
|---|---|
OIDC_XXX_DISPLAY_NAME |
Name shown on the login button |
OIDC_XXX_ISSUER |
OIDC issuer (discovery .well-known) — Google, Facebook |
OIDC_XXX_AUTHORIZATION_ENDPOINT / TOKEN_ENDPOINT / USERINFO_ENDPOINT |
Manual endpoints (GitHub has no standard OIDC discovery) |
OIDC_XXX_CLIENT_ID / OIDC_XXX_CLIENT_SECRET |
OAuth credentials from your provider |
OIDC_XXX_SCOPES |
Requested scopes |
- Create an "OAuth application" in Google Cloud Console.
- Add the redirect URI:
http://localhost:3000/api/auth/google/callback. - Fill in
OIDC_GOOGLE_CLIENT_ID/OIDC_GOOGLE_CLIENT_SECRET,OIDC_GOOGLE_ISSUER=https://accounts.google.com.
- Developer settings → OAuth Apps → New OAuth App.
- Authorization callback URL:
http://localhost:3000/api/auth/github/callback. - Fill in
OIDC_GITHUB_CLIENT_ID/OIDC_GITHUB_CLIENT_SECRET(endpoints are pre-filled in.env.example).
- Meta for Developers → App → Facebook Login.
- Valid OAuth Redirect URI:
http://localhost:3000/api/auth/facebook/callback. - Fill in
OIDC_FACEBOOK_CLIENT_ID/OIDC_FACEBOOK_CLIENT_SECRET.
From the root:
npm run dev- Backend: http://localhost:3000/api
- Frontend: http://localhost:4200
Open http://localhost:4200, sign in via an OIDC provider, then:
- Add a followed artifact (e.g. npm
react, or mavenorg.springframework:spring-core). - Wait for / trigger a new version → an
ArtifactVersionEventis created only for followed artifacts. - Preferences = immediate → mail received in Mailtrap. Preferences = digest (e.g. 1 min) → recap mail received after the interval.
# List configured OIDC providers
curl http://localhost:3000/api/auth/providers
# Artifact search (authenticated required for /artifacts)
curl -b cookies.txt http://localhost:3000/api/artifacts/search?ecosystem=npm&q=reactSee backend/prisma/schema.prisma: User, UserPreferences, FollowedArtifact,
ArtifactVersionEvent, NotificationDelivery, ListenerSequence, KnownVersion.
-
KnownVersionholds every version already seen per artifact (shared by all followers): any version not in it is notified, patches of older lines included. -
ListenerSequenceallows resuming npm/Maven/PyPI/Go/crates.io tracking where it stopped (_changessequence / timestamp / RSS etag).
/#/admin lists the users and usage statistics (accounts, follows, notifications,
listeners, system). Access is granted by account id in the backend .env:
ADMIN_USER_IDS=cm1abc...,cm2def... # User.id, shown by GET /api/auth/meThe id is used rather than the email on purpose: emails come from the identity
providers and may change. The API (/api/admin/*) enforces it on every call;
the frontend only hides the link for other users.
npm run test # backend (Jest) + frontend (Vitest) unit/integration tests
npm run test:e2e # Playwright: real frontend on desktop + phone viewports, API mocked
npm run lint # ESLint (typescript-eslint, angular-eslint templates/a11y)
npm run format:check # Prettier (npm run format to fix)- Backend (
backend/): unit tests next to the code (src/**/*.spec.ts); integration and HTTP API tests intest/run against a throwaway SQLite database migrated bytest/global-setup.ts(the registry listeners are replaced, no network).npm run test:covwritescoverage/lcov.info. - Frontend (
frontend/):ng test(Vitest + jsdom) for services, guard and components;e2e/for Playwright scenarios. - CI (
.github/workflows/ci.yml, every push and PR): format, lint, tests with coverage, builds, e2e, then a SonarCloud analysis fed with both lcov reports. The analysis needs theSONAR_TOKENrepository secret and Automatic Analysis turned off in SonarCloud (coverage is only accepted from CI-based analysis).
- Frontend: pushed to
main→ built and published to GitHub Pages (.github/workflows/deploy-frontend.yml). - Backend: pushed to
main→ amd64 Docker image built and pushed to GHCR (ghcr.io/artifact-notifier/artifact-notifier-backend, tagslatestand short commit SHA,.github/workflows/backend-image.yml). GitHub has no access to the server: the server pulls the image when a deploy is run there.
On the server, /opt/artifact-notifier contains compose.yml and deploy.sh
(copied from deploy/), the backend .env, data/artifact-notifier.db (SQLite,
mounted at /data, owned by uid 1000) and backups/. nginx proxies
127.0.0.1:3000. The container runs as a non-root user with a read-only
filesystem and no capabilities; migrations are applied at startup.
# deploy a given image tag (backs up the database first); rollback = previous tag
ssh artifact-notifier sudo /opt/artifact-notifier/deploy.sh <short-sha>