{"id":19798493,"url":"https://github.com/alwinsimon/nodejs-express-authentication-server","last_synced_at":"2025-09-18T03:30:40.462Z","repository":{"id":207905382,"uuid":"720352250","full_name":"alwinsimon/Nodejs-Express-Authentication-Server","owner":"alwinsimon","description":"This repository contains a simple authentication server built with Node.js and Express.","archived":false,"fork":false,"pushed_at":"2023-12-01T17:15:03.000Z","size":259,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T09:51:21.046Z","etag":null,"topics":["api-rate-limiter","auth","authentication","authorization","custom-npm-package","expressjs","jwt","learning-by-doing","mongodb","morgan","nodejs","npm-module","winston"],"latest_commit_sha":null,"homepage":"https://auth.alwinsimon.com/api-docs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alwinsimon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-11-18T08:00:50.000Z","updated_at":"2025-01-25T04:12:03.000Z","dependencies_parsed_at":"2023-11-23T09:26:16.646Z","dependency_job_id":"dbff7928-3441-416b-bce4-d9c068f31c91","html_url":"https://github.com/alwinsimon/Nodejs-Express-Authentication-Server","commit_stats":null,"previous_names":["alwinsimon/npm-modules-sample-implementation","alwinsimon/nodejs-express-authentication-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alwinsimon/Nodejs-Express-Authentication-Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwinsimon%2FNodejs-Express-Authentication-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwinsimon%2FNodejs-Express-Authentication-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwinsimon%2FNodejs-Express-Authentication-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwinsimon%2FNodejs-Express-Authentication-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alwinsimon","download_url":"https://codeload.github.com/alwinsimon/Nodejs-Express-Authentication-Server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwinsimon%2FNodejs-Express-Authentication-Server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275702501,"owners_count":25512558,"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","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api-rate-limiter","auth","authentication","authorization","custom-npm-package","expressjs","jwt","learning-by-doing","mongodb","morgan","nodejs","npm-module","winston"],"created_at":"2024-11-12T07:29:34.178Z","updated_at":"2025-09-18T03:30:40.108Z","avatar_url":"https://github.com/alwinsimon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Express Authentication Server\n\n![Node.js](https://img.shields.io/badge/Node.js-v14.17.0-green)\n![Express](https://img.shields.io/badge/Express-v4.17.1-blue)\n![JWT](https://img.shields.io/badge/JSON%20Web%20Token-v8.5.1-orange)\n\nThis repository contains a production-ready authentication server built with Node.js and Express. It leverages two custom npm modules, [base-auth-handler](https://www.npmjs.com/package/base-auth-handler) for authentication handling and [base-error-handler](https://www.npmjs.com/package/base-error-handler) for error management.\n\n## Features\n\n- **Authentication Handling:** Uses [base-auth-handler](https://www.npmjs.com/package/base-auth-handler) for robust authentication with JWT sent in cookies.\n- **Error Management:** Utilizes [base-error-handler](https://www.npmjs.com/package/base-error-handler) for effective error handling.\n- **Logger:** Implements a production-level logger created with Winston and Morgan, saving logs into a remote MongoDB instance.\n- **TypeScript:** The entire package is created using TypeScript for improved type safety and maintainability.\n\n## API Documentation\n\n**Note:** The detailed API documentation is available on Postman. \nPlease refer to [API Documentation on Postman](https://documenter.getpostman.com/view/27773540/2s9YeBeZLV).\n\nAdditionally, Swagger is integrated for convenient exploration of the API:\n\n- Swagger UI: [http://localhost:3000/api-docs](http://localhost:3000/api-docs)\n\nYou can also access the API documentation in JSON format:\n\n- API Docs JSON: [http://localhost:3000/api-docs.json](http://localhost:3000/api-docs.json)\n\n### Dev Server\n- Base URL: [http://localhost:3000](http://localhost:3000)\n\n### Prod Server\n- Base URL: [https://auth.alwinsimon.com](https://auth.alwinsimon.com)\n\n## Prerequisites\n\n- Node.js v14.17.0 or higher\n- Express v4.17.1\n- JSON Web Token (JWT) v8.5.1\n- MongoDB (for production-level logging)\n\n## Environment Variables\n\nAPPLICATION_NAME=AUTH SERVER  \n\nNODE_ENV=development  \n(Use development for dev environment and production for prod environment)\n\nPORT=3000  \nJWT_KEY=your_jwt_key_here  \nJWT_TOKEN_DURATION=30d  \nMONGO_DB_URI=mongodburi_here\n\n## Getting Started\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/alwinsimon/Nodejs-Express-Authentication-Server.git\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   cd Nodejs-Express-Authentication-Server\n   ```\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables:**\n\n   Create a `.env` file in the root of the project and add the environment variables listed above.\n\n4. **Run the server:**\n\n   ```bash\n   npm run server\n   ```\n\n   The server will be running at [http://localhost:3000](http://localhost:3000) or the specified port in your `.env` file.\n\n\n## Scripts\n\n- **Start - For Dev:** `npm start`\n- **Test:** `npm test`\n- **Clean:** `npm run clean`\n- **Build:** `npm run build`\n- **Server - For Prod:** `npm run server`\n\n## Dependencies\n\n- See [package.json](https://github.com/alwinsimon/Nodejs-Express-Authentication-Server/blob/main/package.json) for a detailed list of dependencies.\n\n## Contributing\n\nFeel free to contribute and provide feedback! Create issues for bug reports or feature requests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/alwinsimon/Nodejs-Express-Authentication-Server/blob/main/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwinsimon%2Fnodejs-express-authentication-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falwinsimon%2Fnodejs-express-authentication-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwinsimon%2Fnodejs-express-authentication-server/lists"}