{"id":17516894,"url":"https://github.com/ressuman/next-authentication","last_synced_at":"2026-04-08T18:31:35.619Z","repository":{"id":257956627,"uuid":"872340284","full_name":"ressuman/Next-Authentication","owner":"ressuman","description":"A robust authentication system built with Next.js and NextAuth.js. This application features user registration, login, and password management, all integrated with MongoDB for seamless data handling. The project showcases best practices in user authentication, including secure password hashing and session management.","archived":false,"fork":false,"pushed_at":"2024-10-18T21:27:28.000Z","size":751,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T22:42:44.119Z","etag":null,"topics":["api-client","api-rest","authentication","bcryptjs","css-modules","html-css-javascript","mongodb","next-auth","nextjs","pages-router","reactjs"],"latest_commit_sha":null,"homepage":"","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/ressuman.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-10-14T09:12:49.000Z","updated_at":"2024-10-18T21:27:31.000Z","dependencies_parsed_at":"2024-10-19T14:07:55.659Z","dependency_job_id":null,"html_url":"https://github.com/ressuman/Next-Authentication","commit_stats":null,"previous_names":["ressuman/next-authentication"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FNext-Authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FNext-Authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FNext-Authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FNext-Authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ressuman","download_url":"https://codeload.github.com/ressuman/Next-Authentication/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112638,"owners_count":20725300,"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":["api-client","api-rest","authentication","bcryptjs","css-modules","html-css-javascript","mongodb","next-auth","nextjs","pages-router","reactjs"],"created_at":"2024-10-20T08:10:50.480Z","updated_at":"2025-12-30T23:19:17.272Z","avatar_url":"https://github.com/ressuman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js Authentication\n\nThis project is a Next.js 14 application utilizing NextAuth for authentication. It includes user login, signup, and password change functionalities, integrated with a MongoDB database.\n\n## Table of Contents\n\n- [Next.js Authentication](#nextjs-authentication)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Technologies Used](#technologies-used)\n  - [Folder Structure](#folder-structure)\n  - [Setup](#setup)\n  - [Usage](#usage)\n  - [API Routes](#api-routes)\n  - [Gif](#gif)\n  - [](#)\n  - [Getting Started](#getting-started)\n  - [Learn More](#learn-more)\n  - [Deploy on Vercel](#deploy-on-vercel)\n\n## Features\n\n- User registration with email and password.\n- User login with session management.\n- Password change functionality for logged-in users.\n- Responsive layout with Next.js pages.\n\n## Technologies Used\n\n- **Next.js** - A React framework for server-side rendering and static site generation.\n- **NextAuth.js** - Authentication library for Next.js.\n- **MongoDB** - NoSQL database for storing user data.\n- **bcryptjs** - Library for hashing passwords.\n\n## Folder Structure\n\n```plaintext\ncomponents/\n├── auth/\n│   └── auth-form.js\n│   └── auth-form.module.css\n├── layout/\n│   └── layout.js\n│   └── main-navigation.js\n│   └── main-navigation.module.css\n├── profile/\n│   ├── profile-form/\n│   │   └── profile-form.js\n│   │   └── profile-form.module.css\n│   ├── user-profile/\n│   │   └── user-profile.js\n│   │   └── user-profile.module.css\n└── starting-page/\n    └── starting-page.js\n    └── starting-page.module.css\n\nhelpers/\n├── user/\n│   ├── changePassword.js\n│   ├── createUser.js\n│   └── logInUser.js\n└── hash.js\n\nlib/\n└── db.js\n\npages/\n├── api/\n│   ├── auth/\n│   │   └── [...nextauth].js\n│   │   └── signUp.js\n│   └── user/\n│       └── change-password.js\n├── auth/\n│   └── index.js\n├── profile/\n│   └── index.js\n├── _app.js\n├── _document.js\n└── index.js\n\npublic/\n└── favicon.ico\n\nstyles/\n└── globals.css\n```\n\n## Setup\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd \u003cproject-directory\u003e\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables:**\n\n   Create a `.env` file in the root directory and add the following:\n\n   ```plaintext\n   MONGO_DB_URL=\u003cyour_mongodb_connection_string\u003e\n   NEXTAUTH_URL=http://localhost:3000\n   NEXTAUTH_SECRET=\u003cyour_nextauth_secret\u003e\n   ```\n\n4. **Run the application:**\n\n   ```bash\n   npm run dev\n   ```\n\n   Your app will be available at `http://localhost:3000`.\n\n## Usage\n\n- Navigate to `/auth` to log in or create a new account.\n- After logging in, users will be redirected to their profile page, where they can change their password.\n\n## API Routes\n\n- **POST** `/api/auth/signUp` - Register a new user.\n- **PATCH** `/api/user/change-password` - Change the current user's password.\n- **GET** `/api/auth/[...nextauth]` - Handle authentication using NextAuth.js.\n\n## Gif\n\nHere is an expected gif of the preview of the App(Next Authentication)\n\n## ![Next Authentication gif](./public/next-authentication.gif)\n\n---\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## 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 `pages/index.js`. The page auto-updates as you edit the file.\n\n[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.\n\nThe `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.\n\nThis project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fressuman%2Fnext-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fressuman%2Fnext-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fressuman%2Fnext-authentication/lists"}