Releases: verdantstack/sveltekit-postgres-starter
Releases · verdantstack/sveltekit-postgres-starter
Release list
Release v0.1.0
Added
- Authentication: Email+password with scrypt hashing, DB-backed revocable sessions, hashed session tokens (raw token never persisted)
- Rate limiting: Sliding-window failed-attempt limiter on login/signup —
RateLimiterseam,AUTH_FAILED_ATTEMPTS/AUTH_WINDOW_MSenv, 429 with approximate retry window, cheap pre-check before scrypt - Organizations: Create, unique URL-safe slug, owner bootstrap, member-only reads
- Invites: Single-use hashed tokens, 7-day expiry, revoke, atomic conditional-UPDATE claim, optional recipient-email note
- RBAC:
owner > admin > memberhierarchy with capability matrix, enforced server-side on every load/action; hierarchy rules (act downward, grant strictly below, no self-modification, single-owner invariant) - Billing:
BillingAdapterinterface + deterministicMockBillingAdapter(seat limits enforced at join time viaassertSeatAvailable) - Audit log: Append-only by construction — no UPDATE/DELETE path exists anywhere
- Postgres port: Drizzle Postgres schema (
uuidprimary keys, bigint epoch-ms timestamps, Postgres indexes) with thepostgres.jsdriver; service layer untouched from the SQLite starter (swap the driver, keep the services) - Migrations: Checked-in Drizzle SQL migration (
drizzle/0000_init.sql), applied automatically at boot viamigrate();npm run db:migratefor on-demand application - Connection pooling: Pool sized by
PG_MAX_CONNECTIONS; PgBouncer/Supavisor guidance indocs/deployment.md - RLS (opt-in):
rls/0010_rls_policies.sql— Row-Level Security policies for all tenant tables withFORCE RLS, per-requestapp.current_user_idGUC pattern, documented as fail-closed defense-in-depth - Local Postgres:
docker-compose.ymlwith Postgres 16 (dev :5433 + test :5434 databases) - Testing: 194 tests across 9 suites against a real Postgres test database (per-worker isolated schema + per-test truncation),
fileParallelism: false - Documentation: Architecture, RBAC, billing, testing, deployment (providers, pooling, RLS, optional upgrades), versioning
- Repository hygiene:
AGENTS.md,CLAUDE.md,CONTRIBUTING.md,.githubtemplates (CI with Postgres 16 service container, release pipeline), EULA (LICENSE)
Design Principles
- Server-side enforcement everywhere (UI hides controls, but every load/action re-checks)
- Services are framework-free (import nothing from
@sveltejs/kit) - Every mutating service call re-derives authority
- Errors carry machine codes (
AuthError,RbacError, etc.); one error mapper (errorToFail()) - No ORM lock-in at service boundaries — same service layer runs on SQLite or Postgres
- Tenancy enforced in the app layer by default; RLS shipped as opt-in hardening
Full change history: CHANGELOG.md