Skip to content

Comments

feat: remove gen_router, add gen_auth command#51

Merged
Taure merged 6 commits intonovaframework:masterfrom
Taure:remove-gen-router
Feb 24, 2026
Merged

feat: remove gen_router, add gen_auth command#51
Taure merged 6 commits intonovaframework:masterfrom
Taure:remove-gen-router

Conversation

@Taure
Copy link
Contributor

@Taure Taure commented Feb 12, 2026

Summary

  • Removes the unused gen_router command (the rebar3 new nova template already creates a router)
  • Adds rebar3 nova gen_auth — scaffolds a complete email/password JSON API authentication system into a Nova app

The generator creates 9 files: Kura migration, user/token schemas, accounts context, security callback, session/registration/user controllers, and a CT test suite. Prints route snippets and setup instructions to stdout.

Generated API endpoints

POST   /api/register       — Register new user
POST   /api/login          — Login (returns session)
DELETE /api/logout          — Logout (requires auth)
GET    /api/me              — Get current user (requires auth)
PUT    /api/me/password     — Change password (requires auth)
PUT    /api/me/email        — Change email (requires auth)

Test plan

  • rebar3 compile — clean
  • rebar3 xref — clean
  • rebar3 dialyzer — no new warnings
  • Ran rebar3 nova gen_auth in a fresh Nova app — all 9 files generated
  • Generated code compiles in the target app with kura + bcrypt deps

🤖 Generated with Claude Code

The rebar3 new nova template always creates a router, so a separate
generator is unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Taure Taure requested a review from burbas February 12, 2026 21:20
Scaffolds a complete email/password authentication system into a Nova
app: migration, schemas, accounts context, security callback,
controllers, and CT test suite.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Taure Taure changed the title Remove gen_router command feat: remove gen_router, add gen_auth command Feb 24, 2026
Taure and others added 4 commits February 24, 2026 18:42
Both openapi.json and swagger.html now default to priv/assets/ relative
to the app directory, making them easy to serve from a Nova static route.
The swagger UI spec URL is now relative so it works from any serving path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The branch protection requires a check named "build" but the custom
name field caused it to report as "OTP 28.0 / rebar3 3.26.0".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Taure Taure merged commit 66a0971 into novaframework:master Feb 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant