{"id":16222905,"url":"https://github.com/michael/nextjs-auth-mongo","last_synced_at":"2025-09-02T03:33:22.891Z","repository":{"id":66446960,"uuid":"470974397","full_name":"michael/nextjs-auth-mongo","owner":"michael","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-17T11:56:08.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T01:46:00.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/michael.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":"2022-03-17T11:56:06.000Z","updated_at":"2023-07-25T14:55:33.000Z","dependencies_parsed_at":"2023-04-29T19:11:59.119Z","dependency_job_id":null,"html_url":"https://github.com/michael/nextjs-auth-mongo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael%2Fnextjs-auth-mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael%2Fnextjs-auth-mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael%2Fnextjs-auth-mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael%2Fnextjs-auth-mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michael","download_url":"https://codeload.github.com/michael/nextjs-auth-mongo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761052,"owners_count":20991533,"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":[],"created_at":"2024-10-10T12:15:45.671Z","updated_at":"2025-04-08T01:41:46.011Z","avatar_url":"https://github.com/michael.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: NextJS Auth\ndescription: A NextJS app using NextAuth.js for authentication with a MongoDB database\ntags:\n  - next\n  - nextauth.js\n  - mongodb\n  - javascript\n---\n\n# NextJS Auth Example\n\nThe example is a [NextJS](https://nextjs.org/) app with authentication using [NextAuth.js](https://next-auth.js.org/).\n\nIt uses [MongoDB](https://www.mongodb.com/) to persist user accounts and support email sign in. Adding additional providers is as simple as commenting them out from `/pages/api/auth/[...nextauth].js`.\n\n[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Frailwayapp%2Fexamples%2Ftree%2Fmaster%2Fexamples%2Fnextjs-auth-mongo\u0026plugins=mongodb\u0026envs=NEXTAUTH_URL%2CSECRET%2CEMAIL_FROM%2CEMAIL_SERVER\u0026NEXTAUTH_URLDesc=The+canonical+URL+of+your+site\u0026SECRETDesc=A+random+string+used+to+hash+tokens%2C+sign+cookies+and+generate+crytographic+keys\u0026NEXTAUTH_URLDefault=http%3A%2F%2Flocalhost%3A3000\u0026EMAIL_FROMDefault=NextAuth+%3Cnoreply%40example.com%3E)\n\n## ✨ Features\n\n- NextJS\n- NextAuth.js\n- MongoDB\n\n## 💁‍♀️ How to use\n\n- Click the `Deploy on Railway` button above\n- Add the required environment variables (`SECRET`, `EMAIL_SERVER`)\n  - The `EMAIL_SERVER` has to be a connection string in this format - `smtp://username:password@smtp.example.com:587`\n- Clone the project locally\n- Install dependencies - `yarn`\n- Connect to your Railway project - `railway link`\n- Start the development server `railway run yarn dev`\n\n## 📝 Notes\n\n- The value for `NEXTAUTH_URL` is set to `http://localhost:3000` for ease of use. You must update it before deploying to production.\n- You can read more about how the email provider works [here](https://next-auth.js.org/providers/email).\n- You can read more about how objects are stored in the database [here](https://next-auth.js.org/schemas/mongodb).\n- If you want to configure additional providers, you can do so using the information mentioned [here](https://next-auth.js.org/configuration/providers).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael%2Fnextjs-auth-mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichael%2Fnextjs-auth-mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael%2Fnextjs-auth-mongo/lists"}