{"id":28230579,"url":"https://github.com/amarmuric04/auth_template","last_synced_at":"2026-04-16T04:01:13.247Z","repository":{"id":292450785,"uuid":"975875524","full_name":"AmarMuric04/auth_template","owner":"AmarMuric04","description":"🔐 A secure, production-ready auth starter with passwordless login (OTP) using custom JWT, plus OAuth via NextAuth (Google \u0026 GitHub). Built on Next.js with Prisma ORM and Supabase as the backend. Includes a modern UI, full responsiveness, and a built-in AI chatbot integration — ready to drop into any SaaS or app project.","archived":false,"fork":false,"pushed_at":"2025-05-10T15:27:36.000Z","size":1482,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-18T17:17:26.422Z","etag":null,"topics":["ai-chatbot","auth","fullstack","jwt","nextauth","nextjs","oauth","otp","passwordless","postgresql","prisma","secure-login","supabase"],"latest_commit_sha":null,"homepage":"https://auth-starting-template.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmarMuric04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-01T04:12:36.000Z","updated_at":"2025-05-10T15:27:39.000Z","dependencies_parsed_at":"2025-05-10T03:52:03.443Z","dependency_job_id":null,"html_url":"https://github.com/AmarMuric04/auth_template","commit_stats":null,"previous_names":["amarmuric04/auth_template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AmarMuric04/auth_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmarMuric04%2Fauth_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmarMuric04%2Fauth_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmarMuric04%2Fauth_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmarMuric04%2Fauth_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmarMuric04","download_url":"https://codeload.github.com/AmarMuric04/auth_template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmarMuric04%2Fauth_template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31870516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-chatbot","auth","fullstack","jwt","nextauth","nextjs","oauth","otp","passwordless","postgresql","prisma","secure-login","supabase"],"created_at":"2025-05-18T17:15:12.177Z","updated_at":"2026-04-16T04:01:13.241Z","avatar_url":"https://github.com/AmarMuric04.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 Full Auth Template – Custom JWT + OTP + OAuth (Next.js + Prisma + Supabase)\n\nA modern and secure **authentication template** built with **Next.js**, featuring:\n\n- 🔑 **Custom credentials auth** using **passwordless OTP** (no passwords stored!)\n- 🔐 **OAuth support** with **GitHub** and **Google** (via NextAuth)\n- ⚙️ **Custom JWT-based system** for credentials auth\n- 🧠 A custom-built **AI chatbot** integrated and ready to go\n- 🎨 Fully responsive, modern UI\n- 🧩 **Supabase** PostgreSQL database with **Prisma ORM**\n\nDesigned for scalability and security, this starter gives you everything you need to bootstrap a real-world auth system.\n\n---\n\n## 🚀 Features\n\n- ✅ Passwordless authentication via OTP codes (email-based)\n- 🔐 OAuth support with GitHub and Google via NextAuth\n- 🔑 Custom credentials login with stateless JWT handling\n- 🧠 Integrated AI chatbot (drop-in use or extendable)\n- 📱 Fully responsive and mobile-friendly\n- 💽 PostgreSQL + Supabase backend with Prisma ORM\n- 🧰 Built with **Next.js App Router** and modular component design\n\n---\n\n## 🧱 Tech Stack\n\n| Layer        | Tech            |\n|--------------|-----------------|\n| Frontend     | Next.js         |\n| Backend      | Next.js (API)   |\n| Auth (OAuth) | NextAuth        |\n| Auth (OTP)   | Custom JWT + OTP |\n| DB           | PostgreSQL via Supabase |\n| ORM          | Prisma          |\n| AI Chatbot   | Custom-built (plug-and-play) |\n\n---\n\n## 🔧 Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/amarmuric04/auth-template.git\ncd auth-template\n```\n\n### 2. Install Dependencies\n\n```bash\nnpm install\n# or\nyarn\n```\n\n### 3. Configure Environment Variables\n\nCopy `.env.example` to `.env.local`:\n\n```env\nDATABASE_URL=postgresql://user:password@host:port/dbname\n\n# JWT Secrets\nJWT_SECRET=your_jwt_secret\n\n# Supabase\nSUPABASE_URL=https://your-project.supabase.co\nSUPABASE_SERVICE_ROLE_KEY=your_service_role\n\n# NextAuth (for OAuth)\nNEXTAUTH_SECRET=nextauth_secret_here\nNEXTAUTH_URL=http://localhost:3000\nGITHUB_ID=your_github_id\nGITHUB_SECRET=your_github_secret\nGOOGLE_CLIENT_ID=your_google_client_id\nGOOGLE_CLIENT_SECRET=your_google_client_secret\n```\n\n### 4. Set Up the Database\n\n```bash\nnpx prisma generate\nnpx prisma db push\n```\n\n\u003e ✅ Schema already included for user, OTP verification, sessions, and chatbot data.\n\n### 5. Seed the Database (Optional)\n\nUse mock data or your own:\n\n```bash\nnpm run seed\n```\n\n### 6. Start the App\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000)\n\n---\n\n## 🧬 How Authentication Works\n\n### 🔑 OTP-based Credentials (Passwordless)\n\n- Users login with email\n- An OTP code is emailed (or mocked in dev)\n- OTP is verified and a **JWT** is issued\n- Stateless auth: sessions are stored client-side via JWT\n\n### 🧷 OAuth Login\n\n- Handles GitHub and Google using **NextAuth**\n- Session strategy can be configured (JWT or DB-based)\n\n---\n\n## 🤖 AI Chatbot\n\nA smart, extendable chatbot built directly into the UI.\n\n- Custom hook/API integration\n- Chat log stored in Supabase\n- UI is mobile-ready and responsive\n- Great for onboarding or user help center\n\n---\n\n## 📁 Project Structure\n\n``\n/app                → Next.js App Router pages\n/components         → UI and shared components\n/lib                → Utilities (auth, jwt, helpers)\n/prisma             → Prisma schema and client\n/pages/api/auth     → Custom API for OTP + NextAuth\n/styles             → Global CSS / Tailwind\n/chatbot            → AI bot logic and UI\n``\n\n---\n\n## 🔐 Security Notes\n\n- Passwordless auth = more secure and lower friction\n- OTP expires after X minutes (configurable)\n- JWT is signed with server-only secret\n- OAuth tokens never touch your DB directly\n- Fully stateless login path with fallback to OAuth\n\n---\n\n## 🧪 Testing\n\nComing soon:\n- Jest for unit tests\n- Playwright for E2E\n- Auth flow test harness\n\n---\n\n## 📦 Deployment\n\n- One-click deploy to **Vercel**\n- Add env variables in Vercel dashboard\n- Works with Docker (optional)\n\n---\n\n## 📜 License\n\nMIT\n\n---\n\nBuilt for modern apps that need secure, scalable, and flexible authentication + AI support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarmuric04%2Fauth_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famarmuric04%2Fauth_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarmuric04%2Fauth_template/lists"}