{"id":25819527,"url":"https://github.com/harshproj/whatbytes","last_synced_at":"2026-05-09T20:41:15.539Z","repository":{"id":278331100,"uuid":"934231199","full_name":"HarshProj/WhatBytes","owner":"HarshProj","description":"Live at:","archived":false,"fork":false,"pushed_at":"2025-02-19T07:46:59.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T08:22:32.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://whatbytes-ebv9.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/HarshProj.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-02-17T13:45:01.000Z","updated_at":"2025-02-19T07:47:03.000Z","dependencies_parsed_at":"2025-02-19T08:22:34.163Z","dependency_job_id":"18258ade-24bb-4268-aef1-f6166ca467a9","html_url":"https://github.com/HarshProj/WhatBytes","commit_stats":null,"previous_names":["harshproj/whatbytes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshProj%2FWhatBytes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshProj%2FWhatBytes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshProj%2FWhatBytes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshProj%2FWhatBytes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarshProj","download_url":"https://codeload.github.com/HarshProj/WhatBytes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241126972,"owners_count":19914117,"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":[],"created_at":"2025-02-28T08:56:22.759Z","updated_at":"2026-05-09T20:41:15.479Z","avatar_url":"https://github.com/HarshProj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Healthcare Backend API\n\n## 🚀 Overview\nThis project is a **backend system** for a healthcare application built using **Node.js, Express.js, and PostgreSQL**. It provides secure authentication and allows managing **patients, doctors, and their assignments**.\n\n## 🏗 Tech Stack\n- **Backend**: Node.js, Express.js\n- **Database**: PostgreSQL (via Sequelize ORM)\n- **Authentication**: JWT (JSON Web Token)\n- **Environment Management**: dotenv\n\n## 📌 Features\n✅ **User Authentication** (Register/Login)  \n✅ **Secure JWT-based API access**  \n✅ **CRUD operations for Patients \u0026 Doctors**  \n✅ **Patient-Doctor Mapping**  \n✅ **Error Handling \u0026 Validation**  \n\n## ⚙️ Setup Instructions\n\n### 1️⃣ Clone the Repository\n```sh\ngit clone [https://github.com/your-username/healthcare-backend.git](https://github.com/HarshProj/WhatBytes.git)\n```\n\n### 2️⃣ Install Dependencies\n```sh\nnpm install\n```\n\n### 4️⃣ Run Database Migrations\n```sh\nnpx sequelize db:migrate\n```\n\n### 5️⃣ Start the Server\n```sh\nnpm run dev\n```\n\n## 📌 API Endpoints\n\n### 🔐 Authentication APIs\n| Method | Endpoint | Description |\n|--------|---------|-------------|\n| POST | `/api/auth/register` | Register a new user |\n| POST | `/api/auth/login` | Login and get JWT token |\n\n### 🏥 Patient Management APIs\n| Method | Endpoint | Description |\n|--------|---------|-------------|\n| POST | `/api/patients` | Add a new patient (Auth required) |\n| GET | `/api/patients` | Get all patients of the authenticated user |\n| GET | `/api/patients/:id` | Get details of a specific patient |\n| PUT | `/api/patients/:id` | Update patient details |\n| DELETE | `/api/patients/:id` | Delete a patient record |\n\n![image](https://github.com/user-attachments/assets/597e2975-1d99-43f2-9515-5ed9ed1c2b07)\n\n### 👨‍⚕️ Doctor Management APIs\n| Method | Endpoint | Description |\n|--------|---------|-------------|\n| POST | `/api/doctors` | Add a new doctor (Auth required) |\n| GET | `/api/doctors` | Retrieve all doctors |\n| GET | `/api/doctors/:id` | Get details of a specific doctor |\n| PUT | `/api/doctors/:id` | Update doctor details |\n| DELETE | `/api/doctors/:id` | Delete a doctor record |\n\n![image](https://github.com/user-attachments/assets/98014ae3-4798-4adb-8e8c-af80923d5c0c)\n\n\n### 🔗 Patient-Doctor Mapping APIs\n| Method | Endpoint | Description |\n|--------|---------|-------------|\n| POST | `/api/mappings` | Assign a doctor to a patient |\n| GET | `/api/mappings` | Get all patient-doctor mappings |\n| GET | `/api/mappings/:patientId` | Get doctors assigned to a patient |\n| DELETE | `/api/mappings/:id` | Remove a doctor from a patient |\n\n## 🔥 Usage Example\n### **1️⃣ Register a User**\n```http\nPOST /api/auth/register\n```\n#### Request Body\n```json\n{\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"password\": \"securepassword\"\n}\n```\n#### Response\n```json\n{\n  \"message\": \"User registered successfully\",\n  \"token\": \"your_jwt_token_here\"\n}\n```\n\n### **2️⃣ Add a New Doctor**\n```http\nPOST /api/doctors\nAuthorization: Bearer \u003ctoken\u003e\n```\n#### Request Body\n```json\n{\n  \"name\": \"Dr. Smith\",\n  \"specialization\": \"Cardiology\",\n  \"experience\": 15\n}\n```\n#### Response\n```json\n{\n  \"id\": 1,\n  \"name\": \"Dr. Smith\",\n  \"specialization\": \"Cardiology\",\n  \"experience\": 15,\n  \"createdAt\": \"2025-02-17T12:00:00Z\",\n  \"updatedAt\": \"2025-02-17T12:00:00Z\"\n}\n```\n\n## 🛠 Troubleshooting\n**Issue:** `Missing script: \"dev\"`\n- Ensure `package.json` contains:\n```json\n\"scripts\": {\n  \"dev\": \"nodemon index.js\",\n  \"start\": \"node index.js\"\n}\n```\n\n**Issue:** `Error: secretOrPrivateKey must have a value`\n- Add `JWT_SECRET` in `.env` file.\n\n## 📜 License\nThis project is **open-source** under the MIT License.\n\n---\n\n**🚀 Happy Coding!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshproj%2Fwhatbytes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshproj%2Fwhatbytes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshproj%2Fwhatbytes/lists"}