{"id":25832874,"url":"https://github.com/art2url/dev-task-flow-auth-server","last_synced_at":"2025-06-26T10:02:47.616Z","repository":{"id":279841965,"uuid":"940118708","full_name":"art2url/dev-task-flow-auth-server","owner":"art2url","description":"🗄️ This DevTaskFlow backend handles user authentication and task management. It's built on Node.js, Express, MongoDB, and uses JWT for auth.","archived":false,"fork":false,"pushed_at":"2025-03-10T16:36:14.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-06-26T10:02:28.792Z","etag":null,"topics":["authentication","authorization","backend","database-storage","devtaskflow","express","jwt","mongodb","mongodb-atlas","nodejs","nodemailer","rest-api","security","task-management"],"latest_commit_sha":null,"homepage":"https://dev-task-flow-auth-server.onrender.com","language":"JavaScript","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/art2url.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,"zenodo":null}},"created_at":"2025-02-27T16:38:32.000Z","updated_at":"2025-03-12T17:03:52.000Z","dependencies_parsed_at":"2025-03-07T08:24:16.944Z","dependency_job_id":null,"html_url":"https://github.com/art2url/dev-task-flow-auth-server","commit_stats":null,"previous_names":["art2url/dev-task-flow-auth-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/art2url/dev-task-flow-auth-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fdev-task-flow-auth-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fdev-task-flow-auth-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fdev-task-flow-auth-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fdev-task-flow-auth-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/art2url","download_url":"https://codeload.github.com/art2url/dev-task-flow-auth-server/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fdev-task-flow-auth-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262044400,"owners_count":23249745,"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","authorization","backend","database-storage","devtaskflow","express","jwt","mongodb","mongodb-atlas","nodejs","nodemailer","rest-api","security","task-management"],"created_at":"2025-02-28T21:49:21.234Z","updated_at":"2025-06-26T10:02:47.607Z","avatar_url":"https://github.com/art2url.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevTaskFlow Auth Server\n\nDevTaskFlow Auth Server is a backend authentication service built with **Node.js**, **Express**, and **MongoDB**. It handles user authentication, authorization, and security using **JWT** tokens for auth. The server provides RESTful API endpoints for user management, login, registration, password recovery, and secure task data access. Integrated with Nodemailer for email-based password resets, it ensures a seamless authentication flow for the DevTaskFlow task management application.\n\n---\n## Features\n- **User Registration and Login** \\- Uses bcrypt to securely store passwords.\n- **Authentication via JWT** \\- Protect routes with `authenticate` middleware.\n- **Password Recovery** \\- Generates a new password and emails it.\n- **Task Management** \\- Create, read, update, and delete tasks linked to a user.\n\n---\n## Setup \u0026 Installation\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/art2url/dev-task-flow-auth-server.git\n   cd dev-task-flow-auth-server\n   ```\n2. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n3. **Create a `.env` file** with your credentials:\n   ```bash\n   MONGO_URI=\"\u003cyour-mongodb-connection-string\u003e\"\n   JWT_SECRET=\"\u003cyour-jwt-secret\u003e\"\n   EMAIL_USER=\"\u003cyour-email-username\u003e\"\n   EMAIL_PASS=\"\u003cyour-email-password\u003e\"\n   PORT=3000 # or your preferred port\n   ```\n4. **Run the server**:\n   ```bash\n   npm start\n   ```\n   The server starts on `http://localhost:3000` by default.\n\n---\n## Project Structure\n```\n├── server.js             # Main server file with routes\n├── package.json          # Node dependencies and scripts\n├── .env                  # Environment variables\n└── ...other configs\n```\n---\n## Routes\n\n### **Auth Routes**\n- **POST** `/register`\n  - Registers a user by hashing the provided password and storing user info.\n  - Request Body:\n    ```json\n    {\n      \"username\": \"string\",\n      \"email\": \"string\",\n      \"password\": \"string\"\n    }\n    ```\n- **POST** `/login`\n  - Authenticates a user using bcrypt, generates a JWT.\n  - Request Body:\n    ```json\n    {\n      \"email\": \"string\",\n      \"password\": \"string\"\n    }\n    ```\n\n### **Forgot Password**\n- **POST** `/forgot-password`\n  - Generates a random password, hashes it, and emails it to the user.\n  - Request Body:\n    ```json\n    {\n      \"email\": \"string\"\n    }\n    ```\n\n### **Task Routes** (Protected)\n\u003e These routes require an `Authorization` header with a valid JWT token:  \n\u003e `Authorization: Bearer \u003ctoken\u003e`\n\n- **GET** `/tasks`\n  - Fetches all tasks for the authenticated user.\n\n- **POST** `/tasks`\n  - Creates a new task for the authenticated user.\n  - Request Body (example):\n    ```json\n    {\n      \"title\": \"string\",\n      \"description\": \"string\",\n      \"priority\": \"Low | Medium | High\",\n      \"deadline\": \"Date\",\n      \"pinned\": \"boolean\",\n      \"completed\": \"boolean\"\n    }\n    ```\n\n- **PUT** `/tasks/:taskId`\n  - Updates an existing task by its `taskId`.\n  - Request Body (fields to update):\n    ```json\n    {\n      \"title\": \"string\",\n      \"description\": \"string\",\n      \"priority\": \"string\",\n      \"deadline\": \"Date\",\n      \"pinned\": \"boolean\",\n      \"completed\": \"boolean\"\n    }\n    ```\n\n- **DELETE** `/tasks/:taskId`\n  - Deletes a single task by `taskId`.\n\n- **DELETE** `/tasks`\n  - Deletes **all** tasks for the authenticated user.\n\n---\n## Usage\n1. **Register** a user via `POST /register`.\n2. **Login** via `POST /login`. A JSON Web Token is returned.\n3. **Attach JWT** in the `Authorization: Bearer \u003ctoken\u003e` header for protected routes.\n\n---\n## Environment Variables\nEnsure you have the following variables in your `.env`:\n```\nMONGO_URI=\u003cyour mongodb uri\u003e\nJWT_SECRET=\u003cyour jwt secret\u003e\nEMAIL_USER=\u003cyour email user\u003e\nEMAIL_PASS=\u003cyour email password\u003e\nPORT=\u003cport to run on\u003e\n```\n\n---\n## Security Considerations\n- **JWT** is used for stateless authentication.\n- **BCrypt** for hashing passwords.\n- **CORS** is enabled with either `origin: '*'` or a specific domain.\n\n---\n## Contributing\n1. Fork the repo.\n2. Create a feature branch.\n3. Commit changes.\n4. Push and open a Pull Request.\n\n---\n## License\nMIT License.\n\n---\n## Contact\nFor questions or issues, please open an issue or reach out to the maintainers. Thank you for using **DevTaskFlow Auth Server**!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart2url%2Fdev-task-flow-auth-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fart2url%2Fdev-task-flow-auth-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart2url%2Fdev-task-flow-auth-server/lists"}