r/adonisjs • u/web-dev-kev • 4d ago
Sharing 10 pre-release AdonisJS 7 packages I've been building. Looking for API & DX feedback before npm
I've been building an AdonisJS 7 app and kept extracting the plumbing I didn't want to rewrite or get subtly wrong: password resets, session revocation, team role matrices, operator impersonation, soft deletes, SQLite backups, idempotent writes, etc.
These are still pre-release (distributed as GitHub release .tgz archives, not published to npm yet). Honestly, if I don't draw a line and share them now, I'll tinker on them forever, so right at the end of the day, I'm putting them out for Show Off Sunday to get eyes on the APIs and hear what feels right (or awkward) to other AdonisJS 7 devs.
Account & Auth (headless - keep your user model, routes, and UI)
- Account Kit (
v0.12.0):- Password reset, signup & email verification, invitations, account settings, magic links, tracked sessions (with sliding + absolute lifetimes and admin revocation), password screening, and optional social linking.
- Handles the transaction, locking, and token edge cases while leaving routes and UI to your app.
- Account Admission (
v0.2.0):- Domain allowlists, invite evidence, and approval queues on top of Account Kit.
- Access Control (
v0.6.0):- Team/workspace memberships and a ranked role matrix with compile-time
resource:operationpermission keys, atomic ownership transfer, scope middleware, and Bouncer abilities.
- Team/workspace memberships and a ranked role matrix with compile-time
- Masquerade (
v0.9.0):- Server-side operator impersonation without logging in as the target user.
- Read-only by default, explicit edit approval, sensitive route blocking, audit ledger, and support for both sessions and opaque access tokens.
- Confirm Action with Password (
v0.8.0):- Short-lived, single-use password re-confirmation bound to the session, credential revision, operation, and request payload, spent in the same transaction as the protected write.
Lucid & SQLite
- Lucid Soft Delete (
v0.5.0):withSoftDeletesmixin for AdonisJS 7 Lucid models. HandlesOR-predicate wrapping, relation subqueries, group limits, and transactional bulk receipts, tested across SQLite, PostgreSQL, and MySQL.
- Lucid Checked Columns (
v0.5.0):- u/column helpers for JSON, ISO date, and ISO timestamp columns that validate on both write (
prepare) and read (consume) so corrupt rows fail loudly.
- u/column helpers for JSON, ISO date, and ISO timestamp columns that validate on both write (
- SQLite Backup (
v0.6.0):- Verified, immutable online SQLite backup bundles (
db:backup,db:upgrade) with integrity/foreign-key checks and prepare-only restore.
- Verified, immutable online SQLite backup bundles (
HTTP & Reliability
- Request Deduplication (
v0.5.0):- Idempotency guard for AdonisJS 7 + SQLite: reserves a receipt inside the same transaction as your writes so double-clicks/retries return the first result and failed writes retry fresh.
- Origin Guard (
v0.5.0):- Stateless cross-site write protection using
OriginandSec-Fetch-Siteheaders (no tokens to issue), plus origin parsing and private-peer helpers.
- Stateless cross-site write protection using
(There's also a companion Starter Examples repo showing them wired into Edge, Inertia Vue/React, and API apps.)
Design goals across the set
- Built specifically for AdonisJS 7 (Node 24+, Lucid 22, TypeScript 5.9/6).
- Fail-closed defaults and real-database integration tests (SQLite, plus PostgreSQL/MySQL on the packages that target them), plus packed-consumer smoke tests in CI.
- Scoped test fakes using
using(fakeAccountKit,fakeMasquerade,fakeAdmission,fakePasswordConfirmations,fakeSqliteBackup) so app tests don't need to monkey-patch booted services.
Looking for feedback on
- Does anything in the APIs,
ace configureflow, or naming feel un-idiomatic for AdonisJS 7? - Which of these would you actually want on npm first, and what's missing before you'd trust it in a real project?
- Where have I just got things wrong?
Thanks folks.
1
u/web-dev-kev 2d ago
Quick update: security hardening & new features across the repos
The joy of actually releasing/announcing these repo's led to 48 hours of panic of how I the code might be judged. So since posting, every repo has been through three passes:
---
Here are the highlights worth knowing if you’re thinking of using any of these (and sorry it's quite bullet-pointy, its how my brain documents so i can scan easier):
Account Kit (
v0.16.0):Safer defaults out of the box:
Account Admission (
v0.8.0):Much more flexible invite flows:
Access Control (
v0.9.1):Masquerade (
v0.12.2):masquerade:routes --verifycommand to catch unprotected routes.Confirm Action with Password (
v0.11.1):Dogfooding note (coming next in Account Kit):
Using these in a real app caught a UX rough edge: Account Kit’s strict email verification (built to prevent pre-registration hijacking for OWASP compliance) asks users to set a password on the verification link, which feels clunky if they already entered one on signup.
Right now an email-first signup flow avoids that, and we’re adding opt-in confirm-only email verification (plus first-class email-first registration) in #1104, which should land this week.
Request Deduplication (
v0.8.0):SQLite Backup (
v0.9.0):