{"id":31838394,"url":"https://github.com/premshaw23/learnova","last_synced_at":"2025-10-12T03:21:03.243Z","repository":{"id":313314025,"uuid":"1050921118","full_name":"Premshaw23/Learnova","owner":"Premshaw23","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-06T14:10:45.000Z","size":10401,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-06T16:14:34.606Z","etag":null,"topics":["aichatbot","emailjs-com","faceapi-js","firebase","framer-motion","lucide-icons","mongodb","nextjs","react","seo-optimization","shadcn","tailwindcss"],"latest_commit_sha":null,"homepage":"https://learnova-web.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Premshaw23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-05T06:44:22.000Z","updated_at":"2025-10-06T14:10:49.000Z","dependencies_parsed_at":"2025-10-06T16:17:36.820Z","dependency_job_id":null,"html_url":"https://github.com/Premshaw23/Learnova","commit_stats":null,"previous_names":["premshaw23/learnova"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Premshaw23/Learnova","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Premshaw23%2FLearnova","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Premshaw23%2FLearnova/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Premshaw23%2FLearnova/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Premshaw23%2FLearnova/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Premshaw23","download_url":"https://codeload.github.com/Premshaw23/Learnova/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Premshaw23%2FLearnova/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010177,"owners_count":26084691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["aichatbot","emailjs-com","faceapi-js","firebase","framer-motion","lucide-icons","mongodb","nextjs","react","seo-optimization","shadcn","tailwindcss"],"created_at":"2025-10-12T03:21:02.188Z","updated_at":"2025-10-12T03:21:03.234Z","avatar_url":"https://github.com/Premshaw23.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).\n\n## Getting Started\n\nFirst, run the development server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n# or\npnpm dev\n# or\nbun dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\nYou can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.\n\nThis project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.\n\n## Learn More\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\nYou can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!\n\n## Deploy on Vercel\n\nThe easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template\u0026filter=next.js\u0026utm_source=create-next-app\u0026utm_campaign=create-next-app-readme) from the creators of Next.js.\n\nCheck out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details\n\n# Premium Authentication System - App Router Version\n\nA modern, role-based authentication system built with Next.js 13+ App Router, Firebase, and Tailwind CSS.\n\n## 📁 App Router File Structure\n\n```\nsrc/\n├── app/\n│   ├── auth/\n│   │   └── page.jsx              # Main authentication page\n│   ├── verify/\n│   │   └── page.jsx              # Email verification page (create as needed)\n│   ├── profile/\n│   │   └── page.jsx              # Profile setup page (create as needed)\n│   ├── student/\n│   │   └── dashboard/\n│   │       └── page.jsx          # Student dashboard\n│   ├── teacher/\n│   │   └── dashboard/\n│   │       └── page.jsx          # Teacher dashboard\n│   ├── institute/\n│   │   └── dashboard/\n│   │       └── page.jsx          # Institute dashboard\n│   ├── admin/\n│   │   └── dashboard/\n│   │       └── page.jsx          # Admin dashboard\n│   ├── layout.jsx                # Root layout\n│   └── page.jsx                  # Home page\n│\n├── components/\n│   ├── AuthForm.jsx              # Main authentication form\n│   ├── RoleSelection.jsx         # Role selection interface\n│   ├── HeroSection.jsx           # Marketing/hero content\n│   ├── ForgotPasswordModal.jsx   # Password reset modal\n│   └── Navbar.jsx                # Navigation component\n│\n├── constants/\n│   └── userRoles.js              # User roles and configurations\n│\n├── services/\n│   └── authService.js            # Firebase authentication services\n│\n├── utils/\n│   └── authUtils.js              # Authentication utility functions\n│\n├── hooks/\n│   └── useAuth.js                # Custom authentication hook\n│\n└── lib/\n    └── firebaseConfig.js         # Firebase configuration\n```\n\n## 🔄 Key Changes for App Router\n\n### 1. **File Locations**\n- **Before (Pages Router)**: `pages/auth.jsx`\n- **After (App Router)**: `app/auth/page.jsx`\n\n### 2. **Navigation Import**\n```javascript\n// App Router uses next/navigation instead of next/router\nimport { useRouter } from \"next/navigation\";\n```\n\n### 3. **Component Export**\n```javascript\n// App Router pages export default function\nexport default function AuthPage() {\n  // Component logic\n}\n```\n\n### 4. **Route Structure**\nThe routing in App Router is based on folder structure:\n- `/auth` → `app/auth/page.jsx`\n- `/verify` → `app/verify/page.jsx`\n- `/student/dashboard` → `app/student/dashboard/page.jsx`\n\n## 🚀 Setup Instructions for App Router\n\n### 1. **Create the Required Pages**\n\n**`app/verify/page.jsx`** (Email Verification):\n```javascript\n\"use client\";\nexport default function VerifyPage() {\n  return (\n    \u003cdiv className=\"min-h-screen flex items-center justify-center\"\u003e\n      \u003cdiv className=\"text-center\"\u003e\n        \u003ch1\u003eCheck Your Email\u003c/h1\u003e\n        \u003cp\u003eWe've sent you a verification link.\u003c/p\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n**`app/profile/page.jsx`** (Profile Setup):\n```javascript\n\"use client\";\nexport default function ProfilePage() {\n  return (\n    \u003cdiv className=\"min-h-screen flex items-center justify-center\"\u003e\n      \u003cdiv className=\"text-center\"\u003e\n        \u003ch1\u003eComplete Your Profile\u003c/h1\u003e\n        {/* Profile setup form */}\n      \u003c/div\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n**Dashboard Pages** (create as needed):\n```javascript\n// app/student/dashboard/page.jsx\n\"use client\";\nexport default function StudentDashboard() {\n  return \u003cdiv\u003eStudent Dashboard\u003c/div\u003e;\n}\n\n// app/teacher/dashboard/page.jsx\n\"use client\";\nexport default function TeacherDashboard() {\n  return \u003cdiv\u003eTeacher Dashboard\u003c/div\u003e;\n}\n\n// app/institute/dashboard/page.jsx\n\"use client\";\nexport default function InstituteDashboard() {\n  return \u003cdiv\u003eInstitute Dashboard\u003c/div\u003e;\n}\n\n// app/admin/dashboard/page.jsx\n\"use client\";\nexport default function AdminDashboard() {\n  return \u003cdiv\u003eAdmin Dashboard\u003c/div\u003e;\n}\n```\n\n### 2. **Root Layout** (`app/layout.jsx`)\n```javascript\nimport './globals.css'\n\nexport const metadata = {\n  title: 'Premium Auth System',\n  description: 'Role-based authentication system',\n}\n\nexport default function RootLayout({ children }) {\n  return (\n    \u003chtml lang=\"en\"\u003e\n      \u003cbody\u003e{children}\u003c/body\u003e\n    \u003c/html\u003e\n  )\n}\n```\n\n### 3. **Updated Auth Utils for App Router**\n\nThe `redirectBasedOnRole` function works the same way since we're using `router.push()` from `next/navigation`.\n\n## 🔧 Implementation Steps\n\n1. **Create the folder structure** as shown above\n2. **Move/create files** in their respective App Router locations\n3. **Update imports** to use `next/navigation`\n4. **Create missing pages** (verify, profile, dashboards)\n5. **Test the routing** to ensure all redirects work properly\n\n## 📋 App Router Benefits\n\n- **Faster navigation** with client-side routing\n- **Better SEO** with server-side rendering support\n- **Simplified routing** based on file system\n- **Improved performance** with automatic code splitting\n- **Better TypeScript support** (when using TypeScript)\n\n## 🚨 Important Notes\n\n1. **All interactive components** must use `\"use client\"` directive\n2. **Server components** can be used for static content (like layouts)\n3. **Metadata** is handled differently in App Router\n4. **Error handling** and loading states work similarly\n5. **Route groups** can be used with `(auth)` folders if needed\n\n## 🔄 Migration Checklist\n\n- [x] Move `pages/auth.jsx` to `app/auth/page.jsx`\n- [x] Update imports from `next/router` to `next/navigation`\n- [x] Add `\"use client\"` to interactive components\n- [ ] Create missing dashboard pages\n- [ ] Create verify and profile pages\n- [ ] Update any API routes (if using)\n- [ ] Test all authentication flows\n- [ ] Test role-based redirections\n\nThis structure follows Next.js 13+ App Router conventions and provides better performance and developer experience!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpremshaw23%2Flearnova","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpremshaw23%2Flearnova","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpremshaw23%2Flearnova/lists"}