{"id":28267128,"url":"https://github.com/gaoux/oct-diagnosis-backend","last_synced_at":"2026-04-28T12:02:07.169Z","repository":{"id":281758288,"uuid":"946330569","full_name":"Gaoux/OCT-diagnosis-backend","owner":"Gaoux","description":" is a Django-based backend for an Optical Coherence Tomography (OCT) diagnostic system. It provides API endpoints for image processing, classification, and data management to assist ophthalmologists in diagnosing retinal conditions.","archived":false,"fork":false,"pushed_at":"2025-05-27T04:24:33.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T10:43:35.169Z","etag":null,"topics":["django","oct"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gaoux.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-03-11T01:10:55.000Z","updated_at":"2025-05-27T04:23:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"a949c8e2-c71f-43ae-ac72-0a3b8abf2d10","html_url":"https://github.com/Gaoux/OCT-diagnosis-backend","commit_stats":null,"previous_names":["gaoux/oct-diagnosis-backend"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Gaoux/OCT-diagnosis-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gaoux%2FOCT-diagnosis-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gaoux%2FOCT-diagnosis-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gaoux%2FOCT-diagnosis-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gaoux%2FOCT-diagnosis-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gaoux","download_url":"https://codeload.github.com/Gaoux/OCT-diagnosis-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gaoux%2FOCT-diagnosis-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32379629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["django","oct"],"created_at":"2025-05-20T15:10:10.673Z","updated_at":"2026-04-28T12:02:07.165Z","avatar_url":"https://github.com/Gaoux.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦 OCT-Diagnosis-Backend\n\n## 🧠 Overview\n\nOCT-Diagnosis-Backend is a Django-based backend for an Optical Coherence Tomography (OCT) diagnostic system. This backend provides RESTful API endpoints to handle image uploads, process medical images, and return AI-driven diagnostic insights.\n\n## 🔗 Related Repositories\n\n- **Frontend (React + Vite)**  \n  [https://github.com/Gaoux/OCTsense](https://github.com/Gaoux/OCTsense)\n\n- **AI Model (Hugging Face – OCT Classification)**  \n  [https://huggingface.co/gaoux/OCT_class](https://huggingface.co/gaoux/OCT_class)\n\n## ✨ Features\n\n- Image upload and preprocessing\n- Deep learning model inference for classification\n- User authentication and role-based access\n- Database for storing diagnostic results\n- API endpoints following RESTful architecture\n\n## 🚀 Installation \u0026 Development with Docker Compose\n\nThis project uses Docker Compose for development and deployment.\n\n### 🐳 What Docker Compose Does\n\n- Sets up a Django backend (`web` service)\n- Sets up a PostgreSQL database (`db` service)\n- Links both containers via a shared network\n- Mounts local project files into the container\n- Exposes Django at [http://localhost:8000](http://localhost:8000)\n\n### 📁 How to Set It Up\n\n#### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/gaoux/OCT-diagnosis-backend.git\ncd OCT-diagnosis-backend\n```\n\n#### 2. Create a `.env` file\n\nYou can copy the provided `.env.example`:\n\n```bash\ncp .env.example .env\n```\n\nOr manually create your own `.env` with the structure of the `env.example` file.\n\n#### 3. Build the Docker Images\n\n```bash\ndocker-compose build --no-cache\n```\n\n#### 4. Run the Project\n\n```bash\ndocker-compose up\n```\n\nDjango will be available at:  \n[http://localhost:8000](http://localhost:8000)\n\n### 🧹 Clean Up (Remove Volumes and Containers)\n\nTo stop and clean the environment, including database volumes:\n\n```bash\ndocker-compose down -v\n```\n\n\u003e ⚠️ Warning: This will delete all PostgreSQL data.\n\n---\n\n## 📦 Keeping Dependencies Up to Date\n\nIf you or any team member installs or modifies dependencies inside the environment, they must update the `requirements.txt` file with:\n\n```bash\npip freeze | grep -vE ' @ file://|^-e|pywin32|win32|colorama|pypiwin32|tensorflow-intel' \u003e requirements.txt\n```\n\nThis ensures clean, cross-platform, Docker-friendly dependencies.\n\n---\n\n## 📂 Project Structure\n\n- `docker-compose.yml`: Defines services for Django and PostgreSQL\n- `requirements.txt`: pip dependencies\n- `environment.yml`: Defines the Conda environment (only if working outside Docker)\n- `manage.py`, `settings.py`: Django backend\n- `.env`: Environment variables for DB and Django setup\n\n---\n\n## 🧠 AI Model Integration\n\nThe backend integrates a deep learning model to classify OCT (Optical Coherence Tomography) images into four diagnostic categories. This model is based on a Keras-compatible architecture (e.g., Xception), trained to assist in ophthalmological pre-diagnosis.\n\n## 📬 API Endpoints\n\n### 👤 User Endpoints\n\n| Method | Endpoint                     | Description                  |\n| ------ | ---------------------------- | ---------------------------- |\n| POST   | `/api/users/register/`       | Register a new user          |\n| POST   | `/api/users/login/`          | Log in and obtain JWT token  |\n| POST   | `/api/users/reset-password/` | Reset password using a token |\n\n---\n\n### 🛡️ Admin Endpoints\n\n| Method | Endpoint                 | Description                       |\n| ------ | ------------------------ | --------------------------------- |\n| POST   | `/api/users/register/`   | Register a new user               |\n| GET    | `/api/users/users/`      | List all users                    |\n| GET    | `/api/users/users/\u003cid\u003e/` | Get user details                  |\n| PATCH  | `/api/users/users/\u003cid\u003e/` | Update user information           |\n| DELETE | `/api/users/users/\u003cid\u003e/` | Delete a user                     |\n| POST   | `/api/oct/upload-model/` | Upload or replace the `.h5` model |\n\n---\n\n### 📄 Report Endpoints\n\n| Method | Endpoint                         | Description                             |\n| ------ | -------------------------------- | --------------------------------------- |\n| POST   | `/api/reports/create/`           | Create a new report                     |\n| GET    | `/api/reports/history/`          | List reports for the authenticated user |\n| GET    | `/api/reports/`                  | List all reports (admin only)           |\n| GET    | `/api/reports/\u003cuuid:id\u003e/`        | Get report details                      |\n| PATCH  | `/api/reports/\u003cuuid:id\u003e/update/` | Update report comments                  |\n| DELETE | `/api/reports/\u003cuuid:id\u003e/delete/` | Delete a report                         |\n| GET    | `/api/reports/\u003cuuid:id\u003e/image/`  | Download image associated with a report |\n| GET    | `/api/reports/summary/`          | Get summary of reports (statistics)     |\n\n---\n\n### 🤖 AI Prediction Endpoint\n\n| Method | Endpoint            | Description                    |\n| ------ | ------------------- | ------------------------------ |\n| POST   | `/api/oct/predict/` | Run prediction on an OCT image |\n\n\u003e **Note:** All endpoints (except login, register and reset-password) require JWT authentication.\n\n---\n\n## 📝 License\n\nThis project is licensed under the GPL-3.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaoux%2Foct-diagnosis-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaoux%2Foct-diagnosis-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaoux%2Foct-diagnosis-backend/lists"}