{"id":20592846,"url":"https://github.com/adrocodes/nextjs-kinde-mongodb-template","last_synced_at":"2025-09-26T05:31:43.221Z","repository":{"id":240513559,"uuid":"802735472","full_name":"adrocodes/nextjs-kinde-mongodb-template","owner":"adrocodes","description":"Template configured for Next.js with Kinde Auth, MongoDB Atlas with Prisma, and Tailwind \u0026 shadcn/ui","archived":false,"fork":false,"pushed_at":"2024-05-19T11:09:39.000Z","size":78,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-16T07:46:28.389Z","etag":null,"topics":["kinde-auth","mongodb-atlas","nextjs-template","nextjs14","prisma","shadcn-ui","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/adrocodes.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}},"created_at":"2024-05-19T05:51:55.000Z","updated_at":"2024-10-06T17:33:14.000Z","dependencies_parsed_at":"2024-05-19T13:40:07.857Z","dependency_job_id":null,"html_url":"https://github.com/adrocodes/nextjs-kinde-mongodb-template","commit_stats":null,"previous_names":["adrocodes/nextjs-kinde-mongodb-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrocodes%2Fnextjs-kinde-mongodb-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrocodes%2Fnextjs-kinde-mongodb-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrocodes%2Fnextjs-kinde-mongodb-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrocodes%2Fnextjs-kinde-mongodb-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrocodes","download_url":"https://codeload.github.com/adrocodes/nextjs-kinde-mongodb-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234291854,"owners_count":18809250,"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","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":["kinde-auth","mongodb-atlas","nextjs-template","nextjs14","prisma","shadcn-ui","tailwindcss"],"created_at":"2024-11-16T07:46:33.673Z","updated_at":"2025-09-26T05:31:37.919Z","avatar_url":"https://github.com/adrocodes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js + Kinde + MongoDB Template\n\nThis 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## Features\n\n1. Tailwind \u0026 shadcn/ui configured.\n2. Kinde integration.\n3. Prisma configured with MongoDB provider.\n4. Kinde `user.created` webhook configured to create a user in the database.\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\nThis project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Nunito, a custom Google Font.\n\n## Environment Variables\n\nCopy the `.env.example` to a `.env` file. Your values will be found on the Kinde \u0026 MongoDB platforms. More information below.\n\n## Next.js\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/deployment) for more details.\n\n## Kinde\n\n### Learn more\n\nTo learn more about Kinde, take a look at the following resources:\n\n- [Kinde Documentation](https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/)\n- [Kinde Webhooks](https://docs.kinde.com/integrate/webhooks/webhooks-nextjs/)\n\n## How to configure\n\nWhen creating your project, you'll be presented with your environment values, copy \u0026 paste them into your `.env` file.\n\nThe only \"private\" route set up is `/app`, Kinde will default the `KINDE_POST_LOGIN_REDIRECT_URL` to point to `/dashboards`, you will need to change that to `/app` OR change the folder name to `dashboards`.\n\n## Webhooks\n\nFor the `user.created` webhook, you'll need to set up [ngrok](https://ngrok.com/) to tunnel your localhost to the internet. You can then use the ngrok URL to set up the webhook on the Kinde platform.\n\n- URL: `{Ngrok URL}/api/webhook/kinde/user.created`\n- Event: `user.created`\n\nIf you update your `User` schema, you might have to update the webhook to populate the data correctly.\n\n## Route protection\n\nYou _can_ configure the `middleware.ts` to protect routes, instead a `(private)` route group has been set up with a `layout.tsx` to protect that group of routes instead. You can configure the `middleware.ts` to protect individual routes if you wanted to, Kinde has docs for that as well.\n\n## `getAppUser` helper\n\nThis custom helper combines the `getUser` method from Kinde and the `findUnique` method from Prisma to get the user from the database. This will add a `mongo` object to the user object that will continue MongoDB user data. Currently only the `_id` is added, but you can add more fields if you want.\n\n## MongoDB Altas\n\n### Learn more\n\nTo learn more about MongoDB, take a look at the following resources:\n\n- [MongoDB Atlas](https://www.mongodb.com/atlas)\n- [Prisma MongoDB](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch/mongodb-typescript-mongodb)\n\n### Connection string\n\nPrisma has a _slightly_ different way for structuring the connection string to what MongoDB Atlas provides. If you grab the connection string it'll look like this:\n\n```\nmongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@\u003ccluster\u003e.mongodb.net/?retryWrites=true\u0026w=majority\u0026appName=\u003cappName\u003e\n```\n\nChange it to the following:\n\n```\nmongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@\u003ccluster\u003e.mongodb.net/\u003cappName\u003e\n```\n\n**IMPORTANT**: Try to avoid `#` or `@` in your username \u0026 password, and wrap your connection string in quotes in your `.env` file.\n\n```\nDATABASE_URL=\"mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@\u003ccluster\u003e.mongodb.net/\u003cappName\u003e\"\n```\n\n## Styling \u0026 Components\n\nThe project is set up with [Tailwind CSS](https://tailwindcss.com/) and [shadcn/ui](https://ui.shadcn.com/). A default theme has been set up but you can configure the theme [here](https://ui.shadcn.com/themes).\n\nA `shadcn` command is configured in the `package.json` to pull components into the `modules/design-system/ui` folder.\n\n```bash\npnpm shadcn add \u003cname\u003e\n```\n\n## Project structure\n\nThe project follows [Module Driven Development](https://papers.adro.codes/module-driven-development) for the project structure, with a couple of modules already set up for the various parts of the template.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrocodes%2Fnextjs-kinde-mongodb-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrocodes%2Fnextjs-kinde-mongodb-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrocodes%2Fnextjs-kinde-mongodb-template/lists"}