Zero-config CLI that inspects your design tokens and injects polished, animated authentication routes into React & Next.js apps in seconds.
✨ Features • 🚀 Quickstart • 🎨 Styles & Layouts • 🔌 Auth Providers • ⚙️ Configuration
┌─────────────────────────────────────────────────────────────────────────────┐
│ ⚡ authica v2.0.0 │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ? Global CSS path? (src/index.css) │
│ ✔ Theme read from src/index.css (13 tokens) │
│ ? Layout: split, centered, canvas, modal, or glass? (split) │
│ ? Style preset: default, brutalist, or glassmorphism? (default) │
│ ? Auth provider: none, supabase, next-auth, or clerk? (supabase) │
│ ? Select OAuth providers: Google, GitHub, Apple │
│ │
│ ✔ Created src/routes/login.tsx │
│ ✔ Wired /login into src/main.tsx │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
- 🎨 Auto Theme Scanning: Automatically parses
:rootHSL, RGB, and OKLCH CSS variables from yourglobals.cssorindex.css. - 🚀 Zero-Config Route Injection: Safely creates routes and injects imports into Next.js App/Pages Router or Vite (
react-router-dom) with automatic.baksafety backups. - 🛡️ Pluggable Backend Handlers: Generates pre-typed hooks for Supabase, Clerk, Next-Auth, or Custom APIs.
- ⚡ Zero Tailwind Lock-in: Includes self-contained CSS fallbacks so animated cards look hyper-polished even without pre-configured Tailwind directives.
- 🎨 5 Layout Frameworks: Choose between
split,centered,canvas,modal, andglass. - ✨ 3 Aesthetic Presets: Toggle between
default(Shadcn-esque),brutalist(hard shadows, 2px borders), andglassmorphism(frosted blur). - 🔑 Pure Inline SVG OAuth: Built-in crisp vector logos for Google, GitHub, Apple, Discord, and Facebook—no extra icon packages required.
- 🧪 Opt-in tooling: AST route insertion with regex fallback, an advisory token-storage scan, Next.js middleware starters, and an isolated local preview studio.
Run authica inside the root directory of any existing React or Next.js project:
npx authica
Skip prompts by passing flags directly:
npx authica --layout=split --style=brutalist --auth=supabase --providers=google,github --yes
| Layout | Description |
|---|---|
split |
Modern two-column hero layout with animated side-swapping cards on tab toggle. |
centered |
Clean, floating authentication card focused on high conversion and low cognitive load. |
canvas |
Full-screen interactive gradient canvas background with a centered glass form. |
modal |
Triggerable overlay dialog with backdrop-filter background blurring. |
glass |
Standalone translucent frosted card with glowing neon border accents. |
| Preset | Visual Vibe |
|---|---|
default |
Neutral, high-contrast, subtle borders, and soft shadows (Shadcn aesthetic). |
brutalist |
Bold 2px dark borders, hard 4px offset drop-shadows, yellow active accents, and monospaced typography. |
glassmorphism |
Ultra-frosted blur backdrop (backdrop-blur-xl) over glowing radial background meshes. |
| Backend | Flag | Features Handled |
|---|---|---|
| None / Custom | --auth=none |
Pure unopinionated state & submit payload handlers. |
| Supabase | --auth=supabase |
@supabase/supabase-js client initialization, signInWithPassword, signUp, and OAuth redirects. |
| Clerk | --auth=clerk |
@clerk/react or @clerk/nextjs hooks, auto-created /sso-callback redirect route. |
| Next-Auth | --auth=next-auth |
signIn("credentials") and provider mapping for Auth.js. |
| WebAuthn starter | --auth=webauthn |
Adds passkey sign-in/registration browser calls; requires your own verified server endpoints and credential storage. |
These features do not change the default npx authica generation path:
npx authica --ast-inject --yes
npx authica --auth=clerk --middleware --yes
npx authica --scan-security --yes
npx authica audit
npx authica preview--ast-injectenables Recast/Babel route edits for Vite + React Router. If parsing fails, Authica tries its legacy injector; if it cannot place the route safely, it prints manual steps and leaves the router untouched. Next.js uses file-system routes, so there is no entry file to edit.--middlewareis Next.js-only and requires--auth=supabase,--auth=clerk, or--auth=next-auth. It protects/dashboard; existing middleware is backed up when--forceis used. Supabase middleware also needs@supabase/ssr; NextAuth config should setpages.signInto/logintoo.--scan-securityandauthica auditperform a read-only heuristic scan for likely auth-token writes tolocalStorage. Findings are advisory and may be incomplete.--auth=webauthninstalls@simplewebauthn/browserin the target app unless--no-installis passed. Implement POST/api/generate-optionsand/api/verifyon the server, including per-session challenge storage, origin/RP validation, credential persistence, and mode-aware registration/authentication verification. This starter is not a complete authentication backend and does not configure OAuth.authica previewserves a local-only visual preview athttp://localhost:4321; it does not install dependencies or write to the project.
The CLI also accepts the existing --layout, --style, --auth, --providers, --css, and --yes options in non-interactive use. The Web Studio reference is authica.dev.
Teams can enforce brand consistency across repositories by placing an .authicarc or .authicarc. file in the project root:
{
"auth": "supabase",
"layout": "split",
"style": "default",
"providers": ["google", "github"],
"css": "src/index.css",
"name": true,
"confirm": true
}
Precedence Order: Command-line flags >
.authicarcconfig file > Interactive CLI prompts.
Distributed under the MIT License. See LICENSE for more information.
Made with ❤️ by Sachin Mehta