{"id":27160226,"url":"https://github.com/ashishpathak2/cactro-backend-crud","last_synced_at":"2026-04-10T13:31:10.461Z","repository":{"id":286893295,"uuid":"962822194","full_name":"ashishpathak2/Cactro-backend-crud","owner":"ashishpathak2","description":"API Development and Deployment for a Task Management Backend","archived":false,"fork":false,"pushed_at":"2025-04-08T21:25:23.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T22:24:43.630Z","etag":null,"topics":["authentication","crud-application","deployed","express-js","jwt-authentication","mongodb","mongoose","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"https://cactro-backend-crud.onrender.com","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/ashishpathak2.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":"2025-04-08T18:14:50.000Z","updated_at":"2025-04-08T21:27:28.000Z","dependencies_parsed_at":"2025-04-08T22:24:46.399Z","dependency_job_id":"0e4eeac3-b9ff-4b10-b7d3-6dc0f2eae182","html_url":"https://github.com/ashishpathak2/Cactro-backend-crud","commit_stats":null,"previous_names":["ashishpathak2/cactro-backend-crud"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2FCactro-backend-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2FCactro-backend-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2FCactro-backend-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2FCactro-backend-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashishpathak2","download_url":"https://codeload.github.com/ashishpathak2/Cactro-backend-crud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947823,"owners_count":21023058,"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","crud-application","deployed","express-js","jwt-authentication","mongodb","mongoose","nodejs","rest-api"],"created_at":"2025-04-08T23:40:40.473Z","updated_at":"2025-12-30T20:22:09.694Z","avatar_url":"https://github.com/ashishpathak2.png","language":"JavaScript","readme":"# 🚀 Cactro Backend CRUD – \n---\n\n## 🧠 Project Structure\n\n```\nsrc/\n├── config/         # All configuration setups (e.g., dotenv)\n├── controllers/    # Receives HTTP data, handles request/response flow.\n├── middlewares/    # Interceptors for auth.\n├── models/         # Mongoose models.\n├── routes/         # API routing layer\n├── utils/          # Helper functions.\n└── index.js        # Entry point\n```\n\n### Folder Breakdown\n\n- **`config/`**  \n  Contains setup for environment variables, logging, and other configuration needs.  \n  Example: `server-config.js` for dotenv setup, Winston logger setup.\n\n- **`routes/`**  \n  Handles all route declarations and connects them to controllers and middleware.\n\n- **`middlewares/`**  \n  Custom middlewares like authenticators, validators, etc., that run before the controller.\n\n- **`controllers/`**  \n  The last middleware before the business logic. Handles request data and response formatting.\n\n- **`utils/`**  \n  Utility functions, constants, and custom error classes.\n\n---\n\n## 🛠️ Getting Started\n\n### 📦 Install Dependencies\n\n```bash\nnpm install\n```\n\n### ⚙️ Environment Variables\n\nCreate a `.env` file in the root directory and add the following:\n\n```env\nPORT=3000\nMONGO_URI=\u003cyour-mongodb-connection-string\u003e\nJWT_SECRET=\u003cyour-jwt-secret\u003e\n```\n\n---\n\n## 🚀 Running the Server\n\n### Development Mode\n\n```bash\nnpm run dev\n```\n\n\u003e This uses `nodemon` for hot reloading.\n\n---\n\n## 📡 Base API URL\n\n```\nBASE_URL = http://localhost:3000/api/v1\n```\n\n---\n\n## 🔐 Auth Routes\n\n### ✅ Register a New User\n\n**Endpoint:** `POST /api/v1/auth/register`\n\n#### Request Body\n\n```json\n{\n  \"email\": \"test@example.com\",\n  \"password\": \"yourPassword\"\n}\n```\n\n#### Response\n\n```json\n{\n  \"success\": true,\n  \"message\": \"User created successfully\",\n  \"user\": {\n    \"email\": \"test@example.com\"\n  },\n  \"token\": \"\u003cjwt_token\u003e\"\n}\n```\n\n---\n\n### ✅ Login a User\n\n**Endpoint:** `POST /api/v1/auth/login`\n\n#### Request Body\n\n```json\n{\n  \"email\": \"test@example.com\",\n  \"password\": \"yourPassword\"\n}\n```\n\n#### Response\n\n```json\n{\n  \"success\": true,\n  \"message\": \"Login successful\",\n  \"user\": {\n    \"email\": \"test@example.com\"\n  },\n  \"token\": \"\u003cjwt_token\u003e\"\n}\n```\n\n---\n\n## 📋 Task Routes\n\n\u003e All task routes require a valid JWT token in the Authorization header.\n\n**Header:**\n\n```\nauthorization: Bearer \u003cjwt_token\u003e\n```\n\n### 🔨 Create Task\n\n**POST** `/api/v1/task/`\n\n#### Body:\n```json\n{\n  \"title\": \"Sample Task\",\n  \"description\": \"Task description\",\n  \"status\":\"Anyone:- ['pending', 'in-progress', 'completed'],\" \n}\n```\n\n### 📥 Get All Tasks\n\n**GET** `/api/v1/task/`\n\n### 📝 Update Task\n\n**PUT** `/api/v1/task/:id`\n\n#### Body:\n```json\n{\n  \"title\": \"Updated Title\"\n}w\n```\n\n### ❌ Delete Task\n\n**DELETE** `/api/v1/task/:id`\n\n---\n\n## 📄 API Testing Tools\n\nUse [Postman](https://www.postman.com/) to test the API endpoints.\n\n---\n\n## 📄 Postman Collection Link\n\nUse this - ( https://.postman.co/workspace/My-Workspace~abe6bad2-4e2e-488b-8896-ca2a0ee13ab1/collection/33665598-1ada8d7e-447e-4960-87f0-4eb6ca47599e?action=share\u0026creator=33665598 )\n\n---\n\n## 📄 Deployment details \n\nDeployed on Render.com, free tier instance.\n\n---\n\n## 📄 Deployment Link :- (https://cactro-backend-crud.onrender.com)\n\n---\n\n\n## 📬 Contributions\n\nFeel free to open issues or submit pull requests if you find bugs or want to improve the project.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashishpathak2%2Fcactro-backend-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashishpathak2%2Fcactro-backend-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashishpathak2%2Fcactro-backend-crud/lists"}