{"id":23769495,"url":"https://github.com/mohsen104/session-based-authentication","last_synced_at":"2025-09-05T13:32:35.608Z","repository":{"id":266739945,"uuid":"899091015","full_name":"mohsen104/Session-Based-Authentication","owner":"mohsen104","description":"This is a session-based authentication system built using Express.js and MongoDB. It includes secure authentication, user management, and developer utilities.","archived":false,"fork":false,"pushed_at":"2024-12-21T10:39:50.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-21T11:19:55.674Z","etag":null,"topics":["authentication","backend","express-js","mongodb","node-js","session"],"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/mohsen104.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-12-05T15:51:51.000Z","updated_at":"2024-12-21T10:39:53.000Z","dependencies_parsed_at":"2024-12-05T21:31:06.379Z","dependency_job_id":"82115550-3ba9-49f8-b632-49a1eb67c23d","html_url":"https://github.com/mohsen104/Session-Based-Authentication","commit_stats":null,"previous_names":["mohsen104/session-based-authentication"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2FSession-Based-Authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2FSession-Based-Authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2FSession-Based-Authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2FSession-Based-Authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohsen104","download_url":"https://codeload.github.com/mohsen104/Session-Based-Authentication/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232043212,"owners_count":18464434,"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":["authentication","backend","express-js","mongodb","node-js","session"],"created_at":"2025-01-01T02:21:27.268Z","updated_at":"2025-01-01T02:21:28.357Z","avatar_url":"https://github.com/mohsen104.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Session Based Authentication\n\nThis is a **session-based authentication system** built using Express.js and MongoDB. It includes secure authentication, user management, and developer utilities.\n\n## Features\n\n- User authentication (via password or OTP)\n- Secure session management with `express-session` and Redis\n- User email and password update\n- Developer tools for testing login methods and OTP generation\n- Swagger documentation for API exploration\n\n## Prerequisites\n\n1. **Redis**: This project requires Redis for session storage. Make sure Redis is installed and running on your system.\n   - [Install Redis](https://redis.io/docs/getting-started/installation/)\n\n2. **Node.js**: Install Node.js (version 14 or higher).\n\n3. **MongoDB**: Ensure MongoDB is installed and running.\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/mohsen104/Session-Based-Authentication.git\n   cd Session-Based-Authentication\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file in the root directory and configure the following environment variables:\n\n   ```env\n   NODE_ENV\n   PORT\n   MONGO_URI\n   COOKIE_PARSER_SECRET_KEY\n   JWT_SECRET_KEY\n   SESSION_SECRET_KEY\n   ```\n\n4. Start the application:\n\n   - Development mode:\n\n     ```bash\n     npm run dev\n     ```\n\n   - Production mode:\n\n     ```bash\n     npm start\n     ```\n\n## API Documentation\n\nThe API is documented using Swagger and can be accessed at:\n\n```\nhttp://localhost:3000/api-docs\n```\n\n### Swagger Overview\n\n- **Base URL**: `http://localhost:3000/api`\n- **Tags**:\n  - `User`: Routes for user authentication and management\n  - `Dev`: Developer utilities\n\n## Scripts\n\n- `npm run dev`: Run the app in development mode using `nodemon`.\n- `npm start`: Run the app in production mode.\n\n## Dependencies\n\n- **Production**:\n  - `express`: Web framework\n  - `express-session`: Session management\n  - `connect-redis`: Redis session store\n  - `mongoose`: MongoDB object modeling\n  - `bcryptjs`: Password hashing\n  - `helmet`: Security headers\n  - `cors`: Cross-origin resource sharing\n\n- **Development**:\n  - `dotenv`: Environment variable management\n  - `nodemon`: Development server reloader\n  - `swagger-jsdoc`: API documentation generator\n  - `swagger-ui-express`: Swagger UI for documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohsen104%2Fsession-based-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohsen104%2Fsession-based-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohsen104%2Fsession-based-authentication/lists"}