{"id":31096635,"url":"https://github.com/arifuddincoder/nexttea","last_synced_at":"2026-05-07T10:31:23.106Z","repository":{"id":311041978,"uuid":"1041999677","full_name":"arifuddincoder/nexttea","owner":"arifuddincoder","description":"Next Tea — modern tea-brand site built with Next.js App Router, Tailwind CSS, DaisyUI, and NextAuth.","archived":false,"fork":false,"pushed_at":"2025-09-10T17:00:56.000Z","size":1121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T21:33:47.149Z","etag":null,"topics":["daisyui","next-auth","next-js","nextjs","tailwindcss"],"latest_commit_sha":null,"homepage":"https://nexttea.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/arifuddincoder.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}},"created_at":"2025-08-21T10:29:33.000Z","updated_at":"2025-09-10T17:00:59.000Z","dependencies_parsed_at":"2025-08-21T21:03:53.392Z","dependency_job_id":"da283931-b564-4211-9ceb-e96587bab942","html_url":"https://github.com/arifuddincoder/nexttea","commit_stats":null,"previous_names":["arifuddincoder/nexttea"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arifuddincoder/nexttea","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifuddincoder%2Fnexttea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifuddincoder%2Fnexttea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifuddincoder%2Fnexttea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifuddincoder%2Fnexttea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arifuddincoder","download_url":"https://codeload.github.com/arifuddincoder/nexttea/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifuddincoder%2Fnexttea/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32733384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["daisyui","next-auth","next-js","nextjs","tailwindcss"],"created_at":"2025-09-16T18:47:04.164Z","updated_at":"2026-05-07T10:31:23.085Z","avatar_url":"https://github.com/arifuddincoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next Tea\n\nA simple e‑commerce demo built with **Next.js 15 (App Router)** and **NextAuth.js**. The app includes public and protected pages: visitors can browse a landing page and product details; signed‑in users can access a protected dashboard page to add new products (saved to MongoDB).\n\n**Live:** https://nexttea.vercel.app/  \n**Repository:** https://github.com/arifuddincoder/nexttea\n\n---\n\n## ✨ Core Features\n\n1. **Landing Page (`/`)**\n   - Sections: **Navbar**, **Hero**, **Product Highlights**, **Footer**\n   - Navigation to **Login** and **Products**\n   - No authentication required\n\n2. **Login with NextAuth (`/login`)**\n   - Social login (Google / GitHub) and/or **Credentials**\n   - Redirects to **`/products`** after successful login\n\n3. **Product List Page (`/products`)**\n   - Publicly accessible\n   - Fetches products from **MongoDB via Route Handler `/api/products`**\n   - Each card shows: **name, description, price**, and **View Details** button\n\n4. **Product Details Page (`/products/[id]`)**\n   - Publicly accessible\n   - Full details of a product\n   - Dynamic **SEO metadata** (title \u0026 description)\n\n5. **Protected Page: Add Product (`/dashboard/add-product`)**\n   - Only accessible when logged in\n   - Form to add a product (name, description, price, **image** via IMGBB upload)\n   - Saves to **MongoDB**\n   - Unauthenticated users are redirected to `/login`\n\n\u003e **Optional Enhancements** (not implemented for this submission): loading spinner/toast, theme toggle.\n\n---\n\n## 🧰 Tech Stack\n\n- **Next.js 15** (App Router)\n- **NextAuth.js**\n- **MongoDB** (Atlas) with the **mongodb** native driver\n- **Tailwind CSS** (+ light DaisyUI usage)\n\n---\n\n## 📁 Key Structure\n\n```\nsrc/\n  app/\n    api/\n      products/\n        route.js                 # GET (list), POST (create - auth required)\n      products/[id]/route.js     # GET by id\n      auth/[...nextauth]/route.js# NextAuth handler\n    dashboard/\n      layout.jsx                 # centered bordered container for dashboard pages\n      add-product/\n        page.jsx                 # server-side session guard + wrapper\n        AddProductForm.jsx       # client form + IMGBB upload\n    products/\n      page.jsx                   # product list (links to details)\n      [id]/page.jsx              # product details + generateMetadata\n    page.jsx                     # landing (hero + highlights)\n  lib/\n    dbConnect.js                 # mongodb connection helper\n```\n\n---\n\n## 🔐 Environment Variables\n\nCreate `.env.local` and add:\n\n```bash\n# Mongo / NextAuth\nMONGODB_URI=your-mongodb-connection-string\nDB_NAME=nexttea\nNEXTAUTH_SECRET=your-strong-secret\n\n# Base URLs\nNEXTAUTH_URL=http://localhost:3000                 # set to your production domain on Vercel\nNEXT_PUBLIC_BASE_URL=http://localhost:3000         # set to your production domain on Vercel\n\n# OAuth (use what you need)\nGOOGLE_CLIENT_ID=...\nGOOGLE_CLIENT_SECRET=...\nGITHUB_ID=...\nGITHUB_SECRET=...\n\n# Image upload\nNEXT_PUBLIC_IMGBB_KEY=...\n```\n\n**OAuth Redirects (Production):**\n- Google: `https://\u003cyour-domain\u003e/api/auth/callback/google`\n- GitHub: `https://\u003cyour-domain\u003e/api/auth/callback/github`\n\n---\n\n## ▶️ Local Development\n\n```bash\nnpm install\nnpm run dev\n# open http://localhost:3000\n```\n\nMongoDB Atlas: ensure your IP/connection is allowed under **Network Access**.\n\n---\n\n## 🧪 Quick Test Plan\n\n- `/` — Hero + Product Highlights\n- `/login` — Login (Google/GitHub/Credentials); success → `/products`\n- `/products` — lists products from MongoDB\n- `/products/[id]` — details page\n- `/dashboard/add-product` — redirects to `/login` if not signed in; otherwise shows form\n- Add a product (with image upload) → verify it appears on `/products`\n\n---\n\n## 🔗 Route Summary\n\n| Route                        | Type       | Description                                   |\n|-----------------------------|------------|-----------------------------------------------|\n| `/`                         | Public     | Navbar, Hero, Product Highlights, Footer      |\n| `/login`                    | Public     | NextAuth login; redirects to `/products`      |\n| `/products`                 | Public     | All products (MongoDB via `/api/products`)    |\n| `/products/[id]`            | Public     | Product details + dynamic metadata            |\n| `/dashboard/add-product`    | Protected  | Add product form (IMGBB upload)               |\n| `/api/products`             | API        | `GET` list, `POST` create (auth required)     |\n| `/api/products/[id]`        | API        | `GET` product by id                           |\n| `/api/auth/*`               | API        | NextAuth handlers                             |\n\n---\n\n## 🧱 Data Model (Product)\n\n```json\n{\n  \"name\": \"Green Tea\",\n  \"description\": \"Delicate, floral aroma...\",\n  \"price\": 8.5,\n  \"image\": \"https://i.ibb.co/.../image.jpg\",\n  \"createdAt\": \"2025-08-22T00:00:00.000Z\",\n  \"createdBy\": \"user@email.com\"\n}\n```\n\nSeed (Mongo shell/Compass):\n```js\ndb.products.insertMany([\n  { name: \"Green Tea\", description: \"Delicate, floral aroma...\", price: 8.5, image: \"https://placehold.co/400x500?text=Green+Tea\", createdAt: new Date() },\n  { name: \"Black Tea\", description: \"Bold and malty body...\", price: 9.0, image: \"https://placehold.co/400x500?text=Black+Tea\", createdAt: new Date() },\n  { name: \"Oolong Tea\", description: \"Smooth semi-oxidized...\", price: 10.5, image: \"https://placehold.co/400x500?text=Oolong+Tea\", createdAt: new Date() }\n]);\n```\n\n---\n\n## 🚀 Deploy to Vercel\n\n1. Import the GitHub repo in **Vercel** → create project  \n2. Add **Environment Variables** for Production/Preview/Development  \n3. Deploy  \n4. Update `NEXTAUTH_URL` and `NEXT_PUBLIC_BASE_URL` to your production domain\n\n\u003e Tip: To avoid BASE URL issues, you can use **relative fetch** in server components: `await fetch(\"/api/products\")`.\n\n---\n\n\n## 👨‍💻 Developer Info\n\n**Md Arif Uddin**  \n📧 arifuddincoder@gmail.com  \n🌐 [https://codebyarif.web.app](https://codebyarif.web.app)  \n🔗 [LinkedIn](https://linkedin.com/in/arifuddincoder) | [GitHub](https://github.com/arifuddincoder)\n\n---\n\n## 📄 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farifuddincoder%2Fnexttea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farifuddincoder%2Fnexttea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farifuddincoder%2Fnexttea/lists"}