railyard/apps/insights/package.json
caelum0x 1bc04fa81b feat(insights): the Insights fork behind the add-on, site entries, tenant summaries, caps that say what happens (PY1.3)
Railyard side of PY1.3 (RYP-D2, RYP-E1, SC-E3). Acceptance:
1. apps/insights: umami-software/umami v3.4.0 (MIT, commit ec0ff503),
   vendored --depth 1, LICENSE kept, NOTICE added. Fork additions only:
   src/railyard/{ingest,summary,tenancy,api-only}.ts, /v1/ingest/batch (the
   edge collector contract v1, bearer INSIGHTS_INGEST_TOKEN, no IP ever,
   retried batches de-duplicated by migration 90_railyard_ingest_receipts),
   /api/v1/tenants/{org}/summary (bearer INSIGHTS_API_TOKEN), src/proxy.ts
   (INSIGHTS_API_ONLY=1 serves only the Railyard API and the heartbeat).
   Tenant isolation is tested at the API level (an app id owned by another org
   is refused) and at the SQL level (upstream migrations 01-26 plus 90 on a
   throwaway cluster: org B never reads org A's rows, even naming its app).
   Upstream vitest suite: not run on the Mac (pnpm 12.3.4 pinned upstream,
   disk floor); it runs in the image build on box 2 or CI.
2. No upstream product name in anything a customer loads: the page tag, the
   console pages and the fork's additions (tests); the upstream dashboard is
   never served in API-only mode.
3. The console writes the collector's site entry on "Add app", on
   auto-created apps from deploys, and rewrites every entry on add-on, plan or
   pause changes (lib/sites.ts, SITES KV binding). The bridge gains
   `sites` (the project's app, site key, page tag and collector URLs, entry
   written) and the analytics proof is the first event from Insights. The
   console's Insights page shows visitors, events, first event and the
   visit -> signup -> first action funnel.
5. insights-edge/src/caps.ts: at 100% of the cap events are still counted and
   not stored until the next UTC month; the console shows the same message
   from a byte-identical copy (lib/caps.ts, tested).
4 (384 MB at 50 events a second for 10 min) is measured on staging before deploy.

Env: INSIGHTS_API_URL, INSIGHTS_API_TOKEN, SITES KV binding (console);
INSIGHTS_INGEST_TOKEN, INSIGHTS_API_TOKEN, INSIGHTS_API_ONLY (Insights).

Tests: console 54/54 (tsc clean), insights fork 7/7 (incl. SQL isolation),
insights-edge caps + collector + sim 14/14, tests/contract 3/3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:23:38 +03:00

170 lines
6.3 KiB
JSON

{
"name": "umami",
"version": "3.4.0",
"description": "A modern, privacy-focused alternative to Google Analytics.",
"author": "Umami Software, Inc. <hello@umami.is>",
"license": "MIT",
"homepage": "https://umami.is",
"repository": {
"type": "git",
"url": "https://github.com/umami-software/umami.git"
},
"type": "module",
"engines": {
"pnpm": "12.3.4"
},
"scripts": {
"dev": "dotenv next dev --turbo",
"build": "npm-run-all check:env build:db check:db build:tracker build:recorder build:geo build:openapi build:packages build:app",
"start": "next start",
"build:docker": "npm-run-all build:db build:tracker build:recorder build:geo build:openapi build:packages build:app",
"start:docker": "npm-run-all check:db update:tracker start:server",
"start:env": "node scripts/start-env.js",
"start:server": "node server.js",
"build:app": "next build --turbo",
"build:icons": "svgr ./src/assets --out-dir src/components/svg --typescript",
"build:components": "node scripts/bump-components.js && tsup",
"build:tracker": "npm-run-all check:tracker build:tracker:script build:tracker:types",
"build:tracker:script": "rollup -c rollup.tracker.config.js",
"build:tracker:types": "tsc -p tsconfig.tracker.types.json && biome format --write src/tracker/index.d.ts",
"check:tracker": "tsc -p tsconfig.tracker.json --noEmit",
"build:recorder": "rollup -c rollup.recorder.config.js",
"build:prisma:client": "node scripts/build-prisma-client.js",
"build:languages": "npm-run-all download:countries download:languages",
"build:geo": "node scripts/build-geo.js",
"build:openapi": "npm-run-all openapi:generate generate:api:client",
"build:db": "npm-run-all generate:db:client build:prisma:client",
"db:pull": "prisma db pull",
"generate:db:client": "prisma generate",
"update:tracker": "node scripts/update-tracker.js",
"db:migrate": "prisma migrate deploy",
"check:db": "node scripts/check-db.js",
"check:env": "node scripts/check-env.js",
"check:messages": "node scripts/check-missing-messages.js",
"download:countries": "node scripts/download-country-names.js",
"download:languages": "node scripts/download-language-names.js",
"openapi:generate": "tsx scripts/generate-openapi.ts",
"openapi:contracts": "tsx scripts/generate-openapi-contracts.ts",
"openapi:check": "tsx scripts/check-openapi.ts",
"generate:api": "npm-run-all openapi:generate generate:api:client",
"generate:api:client": "tsx scripts/generate-api-client.ts",
"check:api:client": "tsx scripts/generate-api-client.ts --check",
"build:packages": "pnpm --filter \"./packages/**\" -r build",
"test:packages": "pnpm --filter \"./packages/**\" -r test",
"postbuild": "node scripts/postbuild.js",
"pretest": "pnpm generate:db:client",
"test": "vitest run",
"test:watch": "vitest",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:api": "tsx scripts/test-api.ts",
"test:api:clickhouse": "tsx scripts/test-api.ts --clickhouse",
"test:api:run": "playwright test -c playwright.api.config.ts",
"test:api:up": "tsx scripts/test-api.ts --up-only",
"test:api:down": "tsx scripts/test-api.ts --down",
"test:api:coverage": "tsx scripts/test-api.ts --coverage-report",
"db:seed": "tsx scripts/seed-data.ts",
"lint": "biome lint .",
"format": "biome format --write .",
"check": "biome check --write"
},
"cacheDirectories": [
".next/cache"
],
"dependencies": {
"@clickhouse/client": "^1.23.1",
"@dicebear/collection": "^9.4.3",
"@dicebear/core": "^9.4.3",
"@playwright/test": "^1.63.0",
"@prisma/adapter-pg": "^7.10.0",
"@prisma/client": "^7.10.0",
"@prisma/extension-read-replicas": "^0.5.0",
"@svgr/cli": "^8.1.0",
"@tanstack/react-query": "^5.102.8",
"@umami/api-client": "workspace:*",
"@umami/mcp": "workspace:*",
"@umami/react-zen": "^0.254.0",
"bcryptjs": "^3.0.2",
"chalk": "^5.6.2",
"chart.js": "^4.5.1",
"chartjs-adapter-date-fns": "^3.0.0",
"colord": "^2.10.0",
"date-fns": "^4.4.0",
"date-fns-tz": "^3.2.0",
"debug": "^4.4.3",
"detect-browser": "^5.2.0",
"dotenv": "^17.4.2",
"esbuild": "^0.28.2",
"immer": "^11.1.18",
"ipaddr.js": "^2.5.0",
"is-ci": "^4.1.0",
"is-docker": "^4.0.0",
"is-localhost-ip": "^3.0.1",
"isbot": "^5.2.2",
"jsonwebtoken": "^9.0.3",
"jszip": "^3.10.2",
"kafkajs": "^2.1.0",
"lucide-react": "^1.44.0",
"maxmind": "^5.0.7",
"motion": "^12.43.0",
"next": "16.3.4",
"next-intl": "4.13.4",
"node-fetch": "^3.2.8",
"npm-run-all": "^4.1.5",
"otplib": "^13.5.0",
"papaparse": "^5.7.0",
"prisma": "^7.10.0",
"prop-types": "^15.8.1",
"punycode": "^2.3.1",
"qrcode": "^1.5.4",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-error-boundary": "^6.1.5",
"react-resizable-panels": "^4.12.4",
"react-simple-maps": "^3.0.0",
"react-window": "^2.3.1",
"redis": "^5.12.1",
"rrweb": "^2.0.1",
"rrweb-player": "2.0.0-alpha.20",
"semver": "^7.8.5",
"serialize-error": "^13.0.1",
"thenby": "^1.4.1",
"ua-parser-js": "^2.0.10",
"uuid": "^14.0.2",
"zod": "^4.6.2",
"zustand": "^5.0.15"
},
"devDependencies": {
"@biomejs/biome": "^2.5.13",
"@netlify/plugin-nextjs": "^5.15.13",
"@rollup/plugin-commonjs": "^29.0.3",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.3",
"@rollup/plugin-terser": "^1.0.0",
"@rollup/plugin-typescript": "^12.3.0",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/jest": "^30.0.0",
"@types/node": "^26.5.1",
"@types/qrcode": "^1.5.6",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"babel-plugin-react-compiler": "19.1.0-rc.2",
"dotenv-cli": "^11.0.0",
"jsdom": "^30.0.1",
"msw": "^2.15.0",
"openapi-typescript": "^7.13.0",
"postcss": "^8.5.28",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "11.3.2",
"rollup": "^4.63.1",
"tar": "^7.5.22",
"tsup": "^8.5.0",
"tsx": "^4.23.13",
"typescript": "^6.0.3",
"vitest": "^4.1.11",
"zod-openapi": "^6.0.2"
}
}