https://github.com/navin-jethwani-76/nextjs-auth-cli
A CLI tool to scaffold authentication backend routes into any Next.js project with support for MySQL, PostgreSQL, and libSQL (Turso) using Drizzle ORM
https://github.com/navin-jethwani-76/nextjs-auth-cli
cli cli-app libsql mysql ne nextjs nextjs-template nodejs postgresql
Last synced: about 1 month ago
JSON representation
A CLI tool to scaffold authentication backend routes into any Next.js project with support for MySQL, PostgreSQL, and libSQL (Turso) using Drizzle ORM
- Host: GitHub
- URL: https://github.com/navin-jethwani-76/nextjs-auth-cli
- Owner: Navin-Jethwani-76
- License: gpl-3.0
- Created: 2025-04-23T15:46:20.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-04-23T17:24:52.000Z (about 1 month ago)
- Last Synced: 2025-04-24T04:59:39.452Z (about 1 month ago)
- Topics: cli, cli-app, libsql, mysql, ne, nextjs, nextjs-template, nodejs, postgresql
- Language: TypeScript
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Auth CLI for Next.js
## A CLI tool to scaffold authentication backend routes into any Next.js project with support for MySQL, PostgreSQL, and libSQL (Turso) using Drizzle ORM.
### 🚀 Features
- Adds authentication API routes (/api/auth) to your project
- Installs required dependencies and configures scripts
- Sets up environment variables in a `.auth.env` file
- Supports Drizzle ORM with MySQL, PostgreSQL, and libSQL
- Easily extendable for other ORMs in future### 📦 Installation
You can run the CLI directly via npx:
```bash
npx nextjs-auth-cli
```### ✅ Benefits
- No Boilerplate Needed: Quickly set up backend logic without rewriting auth from scratch
- Fully Customizable: You own the code — modify anything to suit your needs
- Faster Prototyping: Start building features instead of auth plumbing
- No Vendor Lock-In: Unlike 3rd-party auth or BaaS tools, you control data and logic### 🔍 Comparison: Custom Auth vs. Third-party Auth
| Feature | Custom Backend (this CLI) | Third-Party Auth/BaaS |
| --------------------------- | ------------------------------ | ---------------------------- |
| Code Ownership | ✅ Full control | ❌ Vendor controlled |
| Customization | ✅ Fully customizable | ⚠️ Limited customization |
| Security | ✅ Your own policies | ❌ Must trust external vendor |
| Pricing | ✅ No ongoing costs | ❌ May include usage fees |
| Flexibility | ✅ Adapt to any app requirement | ❌ Limited by service |
| DB Knowledge | ✅ Useful but required | ❌ Not needed initially |
| Data Residency & Compliance | ✅ Full control | ❌ Bound by provider rules |### ⚠️ Current Limitations
- Only works in Next.js projects
- Assumes you already have DB connection
- Only Drizzle ORM supported for now
- lib/auth.ts and DB logic assumes .env.local is being used to store the secrets
- For libSQL, only Turso connections are supported
- No frontend scaffolding — backend only for now### 🛠️ To-Do (Planned Improvements)
- [ ] Add support for other ORMs (e.g., Prisma, Kysely)
- [ ] Add support to choose the env file you want to use (or use the one already created)
- [ ] Add support for non-Next.js frameworks (Make it compatible with all Node.Js projects)
- [ ] Rollback installed npm packages on error/exit### 🤝 Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a new branch (git checkout -b feature/your-feature-name)
- Make your changes and commit (git commit -m 'Add some feature')
- Push to the branch (git push origin feature/your-feature-name)
- Create a Pull RequestFeel free to open issues for feature suggestions or bug reports.
### 📄 License
MIT License. See LICENSE file for more details.