{"id":35101271,"url":"https://github.com/devxoshakya/karuna-backend","last_synced_at":"2026-05-21T06:07:28.092Z","repository":{"id":285185087,"uuid":"954665105","full_name":"devxoshakya/karuna-backend","owner":"devxoshakya","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-08T07:46:49.000Z","size":279,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-08T09:15:49.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devxoshakya.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-25T12:36:00.000Z","updated_at":"2025-11-08T07:46:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"67a80295-e075-4eb2-92c4-e2055c679233","html_url":"https://github.com/devxoshakya/karuna-backend","commit_stats":null,"previous_names":["devxoshakya/karuna-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devxoshakya/karuna-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoshakya%2Fkaruna-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoshakya%2Fkaruna-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoshakya%2Fkaruna-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoshakya%2Fkaruna-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devxoshakya","download_url":"https://codeload.github.com/devxoshakya/karuna-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoshakya%2Fkaruna-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33290928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-12-27T16:58:17.151Z","updated_at":"2026-05-21T06:07:28.084Z","avatar_url":"https://github.com/devxoshakya.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# karuna-backend\n\nTo install dependencies:\n\n```bash\nbun install\n```\n\nTo run:\n\n```bash\nbun dev\n```\n\n## API Guide\n\n### Diagnosis Endpoint\n- **Endpoint**: `api/diagnosis`\n- **Method**: `POST`\n- **Description**: Analyzes symptoms provided by the user and returns a diagnosis, recommended medications, specialist consultation, dietary suggestions, and a disclaimer.\n- **Request Body**:\n  ```json\n  {\n    \"symptoms\": \"string\"\n  }\n  ```\n- **Response**:\n  - **Success**: Returns a JSON object with keys `diagnosis`, `medications`, `prescription`, `specialist`, `dietary_suggestions`, and `disclaimer`.\n  - **Error**: Returns a 400 status with an error message if symptoms are invalid, or a 500 status if there's a failure in generating a diagnosis.\n\n### Medicine Endpoints\n- **Search Medicine by Name**\n  - **Endpoint**: `api/medicine`\n  - **Method**: `POST`\n  - **Description**: Searches for medicines based on a prescription array.\n  - **Request Body**:\n    ```json\n    {\n      \"prescription\": [\"medicine1\", \"medicine2\"]\n    }\n    ```\n  - **Response**:\n    - **Success**: Returns a list of found medicines with their details.\n    - **Error**: Returns a 400 status if the prescription array is invalid, a 404 status if no medicines are found, or a 500 status for internal errors.\n\n- **Get All Medicines**\n  - **Endpoint**: `api/medicine`\n  - **Method**: `GET`\n  - **Description**: Retrieves all medicines from the database.\n  - **Response**:\n    - **Success**: Returns a list of all medicines.\n    - **Error**: Returns a 404 status if no medicines are found, or a 500 status for internal errors.\n\n### Chat Endpoints\n-*Ek baar check the templates/chat.html phir sahi se smjh aayega*\n- **Start Chat**\n  - **Endpoint**: `api/chat/start`\n  - **Method**: `POST`\n  - **Description**: Initiates a new chat session and returns a session ID.\n  - **Response**:\n    - **Success**: Returns a session ID for the chat.\n    - **Error**: Not applicable as per the current implementation.\n\n- **Send Message**\n  - **Endpoint**: `api/chat/message`\n  - **Method**: `POST`\n  - **Description**: Sends a message in an existing chat session and receives a reply.\n  - **Request Body**:\n    ```json\n    {\n      \"sessionId\": \"string\",\n      \"message\": \"string\"\n    }\n    ```\n  - **Response**:\n    - **Success**: Returns a reply from the AI model.\n    - **Error**: Returns a 400 status if fields are missing, a 404 status if the session is not found, or a 500 status for processing errors.\n\n### Report Endpoint\n- **Endpoint**: `api/report`\n- **Method**: `POST`\n- **Description**: Processes an uploaded PDF report, analyzes it using Gemini AI, and returns a diagnosis, recommended medications, specialist consultation, dietary suggestions, and a disclaimer.\n- **Request**:\n  - **File**: A PDF file uploaded as part of the request.\n- **Response**:\n  - **Success**: Returns a JSON object with keys `diagnosis`, `medications`, `prescription`, `specialist`, `dietary_suggestions`, and `disclaimer`.\n  - **Error**: Returns a 400 status if no file is uploaded, or a 500 status if there's a failure in processing the PDF report.\n\n### Data Endpoints\n\n- **Fetch All Doctors**\n  - **Endpoint**: `api/data/docs`\n  - **Method**: `GET`\n  - **Description**: Retrieves all doctors from the database.\n  - **Response**:\n    - **Success**: Returns a list of all doctors.\n    - **Error**: Returns a 500 status if there's a failure in fetching doctors.\n\n- **Fetch All Hospitals**\n  - **Endpoint**: `api/data/hospitals`\n  - **Method**: `GET`\n  - **Description**: Retrieves all hospitals from the database.\n  - **Response**:\n    - **Success**: Returns a list of all hospitals.\n    - **Error**: Returns a 500 status if there's a failure in fetching hospitals.\n\n- **Search Doctors by Name**\n  - **Endpoint**: `api/data/docs`\n  - **Method**: `POST`\n  - **Description**: Searches for doctors by name using a case-insensitive regex.\n  - **Request Body**:\n    ```json\n    {\n      \"name\": \"doctor name\"\n    }\n    ```\n  - **Response**:\n    - **Success**: Returns a list of doctors matching the search criteria.\n    - **Error**: Returns a 500 status if there's a failure in searching doctors.\n\n- **Search Hospitals by Name**\n  - **Endpoint**: `api/data/hospitals`\n  - **Method**: `POST`\n  - **Description**: Searches for hospitals by name using a case-insensitive regex.\n  - **Request Body**:\n    ```json\n    {\n      \"name\": \"hospital name\"\n    }\n    ```\n  - **Response**:\n    - **Success**: Returns a list of hospitals matching the search criteria.\n    - **Error**: Returns a 500 status if there's a failure in searching hospitals.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxoshakya%2Fkaruna-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevxoshakya%2Fkaruna-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxoshakya%2Fkaruna-backend/lists"}