{"id":25303481,"url":"https://github.com/devmukulsingh/jainitriassignment","last_synced_at":"2026-05-02T02:39:31.202Z","repository":{"id":277285854,"uuid":"931400544","full_name":"devMukulSingh/JainitriAssignment","owner":"devMukulSingh","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-13T05:06:57.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T01:53:50.771Z","etag":null,"topics":["honojs","hostpital-management","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/devMukulSingh.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-12T08:04:21.000Z","updated_at":"2025-02-13T05:07:56.000Z","dependencies_parsed_at":"2025-02-13T06:22:22.093Z","dependency_job_id":"76e1979f-5f99-4bfc-8b0c-213fd48e5b6d","html_url":"https://github.com/devMukulSingh/JainitriAssignment","commit_stats":null,"previous_names":["devmukulsingh/jainitriassignment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devMukulSingh%2FJainitriAssignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devMukulSingh%2FJainitriAssignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devMukulSingh%2FJainitriAssignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devMukulSingh%2FJainitriAssignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devMukulSingh","download_url":"https://codeload.github.com/devMukulSingh/JainitriAssignment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247578621,"owners_count":20961270,"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":["honojs","hostpital-management","typescript"],"created_at":"2025-02-13T07:19:52.559Z","updated_at":"2026-05-02T02:39:31.153Z","avatar_url":"https://github.com/devMukulSingh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project built using honojs as framework and nodejs as runtime.\n\n# STEPS to run the project locally-\n\n    STEP1 -\u003e Rename .env.example to .env and enter the `DATABASE_URL` and `JWT_SECRET`\n\n    STEP2 -\u003e Install dependencies using `bun install` or `npm install`\n\n    STEP3 -\u003e Generate prisma client using `bun run generate` or `npx prisma generate`\n\n    STEP4 -\u003e Migrate database schema using `bun run migrate` or `npx prisma migrate`\n\n    STEP5 -\u003e Run `bun run dev` or `npm run dev` to start the server\n\n# API DOCUMENTATION -\n\n    Base path - \"/api/v1\"\n\n    1. Register a New User (Hospital)\n        Endpoint: /auth/register\n        Method: POST\n\n        Description:\n        Creates a new user (hospital) account.\n\n        Request Body Example : {\n            \"email\": \"hospital@example.com\",\n            \"name\": \"City Hospital\",\n            \"password\": \"strongPassword123\"\n        }\n        Response -\u003e status:201, {\n               msg: \"User created successfully\",\n                data: {\n                id: \"1\",\n                name: \"name\",\n                email: \"email\",\n                token\n            }\n        }\n\n        Error Responses:\n\n        1. Status: 400 Bad Request\n            error: [`field` is required]\n        2. Status: 409 Conflict\n            error: \"user already exists\"\n        3. Status: 500\n            error: Internal server error `error messsage`     \n\n    2. User Login\n        Endpoint: /auth/login\n        Method: POST\n\n        Description:\n        Authenticates a user (hospital).\n\n        Request Body Example:\n            {\n            \"email\": \"hospital@example.com\",\n            \"password\": \"strongPassword123\"\n            }\n        Success Response:\n\n        Status: 200 OK\n        {\n        \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n        \"user\": {\n            \"id\": 1,\n            \"email\": \"hospital@example.com\",\n            \"name\": \"City Hospital\"\n            }\n        }\n        Error Responses:\n\n        1. Status:400\n            error:['field' is required]\n        2. Status: 401 Unauthorized\n            error: Invalid credentials.\n        3. Status: 500\n            error: Internal server error `error messsage`        \n\n    3. Post a New Disease\n        Endpoint: /disease/:userId/post-disease\n        Method: POST\n\n        Description:\n            Creates a new disease record for the hospital (user). Optionally, the disease can be linked to a specific patient by providing patientId. (Note: In the current schema, each disease record is associated with one patient at most.)\n\n        Path Parameters:\n            userId (String) – The ID of the user (hospital).\n\n        Request Body Example:\n            {\n                \"name\": \"Influenza\",\n            }\n        Success Response:\n            Status: 201 Created\n            {\n            \"id\": 10,\n            \"name\": \"Influenza\",\n            \"userId\": 1,\n            \"patientId\": 2\n            }\n            \n        Error Responses:\n            1. Status: 400 Bad Request\n                error:[`field` is required]\n            2. Status: 403 Unauthenticated\n                error: Unauthenticated\n            3. Status: 500\n                error: Internal server error `error messsage`\n\n    4. Post a New Patient\n        Endpoint: /patient/:userId/post-patient\n        Method: POST\n\n        Description:\n        Adds a new patient record for the specified user (hospital).\n\n        Path Parameters:\n        userId (String) – The ID of the user (hospital).\n\n        Request Body Example:\n            {\n            \"phone\": \"+1234567890\",\n            \"name\": \"John Doe\",\n            \"diseaseIds\":[{id:\"1\",id:\"2\"}],\n            \"heartRate\":\"40\"\n            }\n\n        Success Response:\n        Status: 201 Created\n            {\n            \"id\": 2,\n            \"phone\": \"+1234567890\",\n            \"name\": \"John Doe\",\n            \"userId\": 1,\n            \"createdAt\": \"2025-02-12T12:00:00.000Z\",\n            \"updatedAt\": \"2025-02-12T12:00:00.000Z\"\n            }\n        Error Responses:\n\n            1. Status: 400 Bad Request\n                error: [`field` is required]\n            2. Status: 409 Conflict\n                error: A patient with the given phone number already exists.\n            3. Status: 500\n                error: Internal server error `error messsage`\n\n    5. Get All Patients for a User\n        Endpoint: /patient/:userId/get-patients\n        Method: GET\n\n        Description:\n        Retrieves a list of all patients associated with the given user (hospital).\n\n        Path Parameters:\n\n        userId (String) – The ID of the user (hospital).\n\n        Success Response:\n            Status: 200 OK\n            [\n            {\n                \"id\": 2,\n                \"phone\": \"+1234567890\",\n                \"name\": \"John Doe\",\n                \"userId\": 1,\n                \"createdAt\": \"2025-02-12T12:00:00.000Z\",\n                \"updatedAt\": \"2025-02-12T12:00:00.000Z\"\n            },\n            {\n                \"id\": 3,\n                \"phone\": \"+1098765432\",\n                \"name\": \"Jane Doe\",\n                \"userId\": 1,\n                \"createdAt\": \"2025-02-12T12:05:00.000Z\",\n                \"updatedAt\": \"2025-02-12T12:05:00.000Z\"\n            }\n            ]\n\n        Error Responses:\n            1. Status: 500\n                error: Internal server error `error messsage`\n    \n    6. Get a Specific Patient by Phone\n\n        Endpoint: /patient/:userId/get-patient/:phone\n        Method: GET\n\n        Description:\n        Retrieves the details of a single patient, identified by their phone number, associated with the specified user (hospital).\n\n        Path Parameters:\n            userId (String) – The ID of the user (hospital).\n            phone (String) – The patient's phone number.\n\n        Success Response:\n            Status: 200 OK\n            {\n            \"id\": 2,\n            \"phone\": \"+1234567890\",\n            \"name\": \"John Doe\",\n            \"userId\": 1,\n            \"createdAt\": \"2025-02-12T12:00:00.000Z\",\n            \"updatedAt\": \"2025-02-12T12:00:00.000Z\"\n            }\n\n        Error Responses:\n            1. Status: 500\n                error: Internal server error `error messsage`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmukulsingh%2Fjainitriassignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevmukulsingh%2Fjainitriassignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmukulsingh%2Fjainitriassignment/lists"}