# chonwai/axpep_backend architecture

> Architecture diagram of the GitHub repository chonwai/axpep_backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chonwai/axpep_backend
- Repository: https://github.com/chonwai/axpep_backend

## Overview

This Laravel backend exposes peptide, codon, and toxicity-prediction features alongside task lookup, result downloads, and usage statistics. The visible request workflow is API controller to service, with task validation and persistence used for task operations; prediction services also dispatch background jobs. Source excerpts show one SSL-GCN client communicating with an external prediction service. Routes and most prediction implementations were not sampled, so their detailed wiring is not asserted.

Main entry points: [`app/Services/TasksServices.php`](https://github.com/chonwai/axpep_backend/blob/main/app/Services/TasksServices.php) (Task services), [`app/Services/AcPEPServices.php`](https://github.com/chonwai/axpep_backend/blob/main/app/Services/AcPEPServices.php) (AcPEP services), [`app/Http/Controllers/Apis/TaskController.php`](https://github.com/chonwai/axpep_backend/blob/main/app/Http/Controllers/Apis/TaskController.php) (Task API), [`app/Models/Tasks.php`](https://github.com/chonwai/axpep_backend/blob/main/app/Models/Tasks.php) (Task records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API layer"]
  node_task_controller["Task API<br/>[TaskController.php]"]
  node_acpep_controller["AcPEP API"]
end

subgraph group_work["Prediction workflows"]
  node_acpep_service["AcPEP services<br/>[AcPEPServices.php]"]
  node_acpep_job["AcPEP job<br/>[AcPEPJob.php]"]
  node_codon_job["Codon job<br/>[CodonJob.php]"]
  node_prediction_services["Prediction services"]
  node_prediction_jobs["Prediction jobs"]
  node_ssl_gcn["SSL-GCN client"]
  node_tox_service["Toxicology service"]
end

subgraph group_data["Tasks and persistence"]
  node_task_service["Task services<br/>[TasksServices.php]"]
  node_task_dao["Task data access"]
  node_method_dao["Method data access"]
  node_tasks_model[("Task records<br/>[Tasks.php]")]
  node_methods_model[("Method results<br/>[TasksMethods.php]")]
  node_dao_factory["DAO factory"]
end

subgraph group_support["Shared support"]
  node_task_rules["Task validation<br/>[TasksRules.php]"]
  node_request_utils["Request helpers<br/>[RequestUtils.php]"]
  node_files["File utilities<br/>[FileUtils.php]"]
  node_formats["Format utilities<br/>[FormatUtils.php]"]
  node_task_utils["Task utilities<br/>[TaskUtils.php]"]
  node_responses["Response utilities<br/>[ResponseUtils.php]"]
  node_response_factory["Response factory"]
  node_services_interface["Service interface"]
end

node_user(("API caller"))
node_microservice{{"SSL-GCN service"}}

node_user -.->|"requests"| node_task_controller
node_user -.->|"requests"| node_acpep_controller
node_task_controller -->|"calls"| node_task_service
node_task_controller -->|"prepares request"| node_request_utils
node_acpep_controller -->|"calls"| node_acpep_service
node_task_service -->|"uses"| node_task_dao
node_task_service -->|"uses"| node_tasks_model
node_task_service -->|"validates with"| node_task_rules
node_task_service -->|"uses"| node_files
node_task_service -->|"formats responses"| node_response_factory
node_acpep_service -->|"dispatches"| node_acpep_job
node_acpep_service -->|"dispatches"| node_codon_job
node_acpep_service -->|"uses"| node_dao_factory
node_acpep_service -->|"uses"| node_tasks_model
node_tasks_model -->|"has details"| node_methods_model
node_ssl_gcn -->|"sends predictions"| node_microservice
node_tox_service -.->|"uses"| node_ssl_gcn
node_prediction_services -.->|"dispatches"| node_prediction_jobs
node_task_rules -->|"validates format"| node_formats
node_task_service -->|"implements"| node_services_interface

click node_task_controller "https://github.com/chonwai/axpep_backend/blob/main/app/Http/Controllers/Apis/TaskController.php"
click node_acpep_controller "https://github.com/chonwai/axpep_backend/blob/main/app/Http/Controllers/Apis/AcPEPController.php"
click node_task_service "https://github.com/chonwai/axpep_backend/blob/main/app/Services/TasksServices.php"
click node_acpep_service "https://github.com/chonwai/axpep_backend/blob/main/app/Services/AcPEPServices.php"
click node_task_rules "https://github.com/chonwai/axpep_backend/blob/main/app/Http/Requests/TasksRules.php"
click node_request_utils "https://github.com/chonwai/axpep_backend/blob/main/app/Utils/RequestUtils.php"
click node_task_dao "https://github.com/chonwai/axpep_backend/blob/main/app/DAO/Ingredient/TasksDAOFactory.php"
click node_method_dao "https://github.com/chonwai/axpep_backend/blob/main/app/DAO/Ingredient/TasksMethodsDAOFactory.php"
click node_tasks_model "https://github.com/chonwai/axpep_backend/blob/main/app/Models/Tasks.php"
click node_methods_model "https://github.com/chonwai/axpep_backend/blob/main/app/Models/TasksMethods.php"
click node_acpep_job "https://github.com/chonwai/axpep_backend/blob/main/app/Jobs/AcPEPJob.php"
click node_codon_job "https://github.com/chonwai/axpep_backend/blob/main/app/Jobs/CodonJob.php"
click node_prediction_services "https://github.com/chonwai/axpep_backend/tree/main/app/Services"
click node_prediction_jobs "https://github.com/chonwai/axpep_backend/tree/main/app/Jobs"
click node_ssl_gcn "https://github.com/chonwai/axpep_backend/blob/main/app/Services/SSLGCNMicroserviceClient.php"
click node_tox_service "https://github.com/chonwai/axpep_backend/blob/main/app/Services/SSLBESToxServices.php"
click node_files "https://github.com/chonwai/axpep_backend/blob/main/app/Utils/FileUtils.php"
click node_formats "https://github.com/chonwai/axpep_backend/blob/main/app/Utils/FormatUtils.php"
click node_task_utils "https://github.com/chonwai/axpep_backend/blob/main/app/Utils/TaskUtils.php"
click node_responses "https://github.com/chonwai/axpep_backend/blob/main/app/Utils/ResponseUtils.php"
click node_response_factory "https://github.com/chonwai/axpep_backend/blob/main/app/Utils/Res/ResFactoryUtils.php"
click node_services_interface "https://github.com/chonwai/axpep_backend/blob/main/app/Services/BaseServicesInterface.php"
click node_dao_factory "https://github.com/chonwai/axpep_backend/blob/main/app/DAO/DAOSimpleFactory.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_task_controller,node_acpep_controller toneBlue
class node_acpep_service,node_acpep_job,node_codon_job,node_prediction_services,node_prediction_jobs,node_ssl_gcn,node_tox_service toneAmber
class node_task_service,node_task_dao,node_method_dao,node_tasks_model,node_methods_model,node_dao_factory,node_user toneMint
class node_task_rules,node_request_utils,node_files,node_formats,node_task_utils,node_responses,node_response_factory,node_services_interface toneRose
class node_microservice toneIndigo
```

## Components

### API layer

- [Task API](https://github.com/chonwai/axpep_backend/blob/main/app/Http/Controllers/Apis/TaskController.php): `app/Http/Controllers/Apis/TaskController.php`
- [AcPEP API](https://github.com/chonwai/axpep_backend/blob/main/app/Http/Controllers/Apis/AcPEPController.php): `app/Http/Controllers/Apis/AcPEPController.php`

### Prediction workflows

- [AcPEP services](https://github.com/chonwai/axpep_backend/blob/main/app/Services/AcPEPServices.php): `app/Services/AcPEPServices.php`
- [AcPEP job](https://github.com/chonwai/axpep_backend/blob/main/app/Jobs/AcPEPJob.php): `app/Jobs/AcPEPJob.php`
- [Codon job](https://github.com/chonwai/axpep_backend/blob/main/app/Jobs/CodonJob.php): `app/Jobs/CodonJob.php`
- [Prediction services](https://github.com/chonwai/axpep_backend/tree/main/app/Services): `app/Services`
- [Prediction jobs](https://github.com/chonwai/axpep_backend/tree/main/app/Jobs): `app/Jobs`
- [SSL-GCN client](https://github.com/chonwai/axpep_backend/blob/main/app/Services/SSLGCNMicroserviceClient.php): `app/Services/SSLGCNMicroserviceClient.php`
- [Toxicology service](https://github.com/chonwai/axpep_backend/blob/main/app/Services/SSLBESToxServices.php): `app/Services/SSLBESToxServices.php`

### Tasks and persistence

- [Task services](https://github.com/chonwai/axpep_backend/blob/main/app/Services/TasksServices.php): `app/Services/TasksServices.php`
- [Task data access](https://github.com/chonwai/axpep_backend/blob/main/app/DAO/Ingredient/TasksDAOFactory.php): `app/DAO/Ingredient/TasksDAOFactory.php`
- [Method data access](https://github.com/chonwai/axpep_backend/blob/main/app/DAO/Ingredient/TasksMethodsDAOFactory.php): `app/DAO/Ingredient/TasksMethodsDAOFactory.php`
- [Task records](https://github.com/chonwai/axpep_backend/blob/main/app/Models/Tasks.php): `app/Models/Tasks.php`
- [Method results](https://github.com/chonwai/axpep_backend/blob/main/app/Models/TasksMethods.php): `app/Models/TasksMethods.php`
- [DAO factory](https://github.com/chonwai/axpep_backend/blob/main/app/DAO/DAOSimpleFactory.php): `app/DAO/DAOSimpleFactory.php`

### Shared support

- [Task validation](https://github.com/chonwai/axpep_backend/blob/main/app/Http/Requests/TasksRules.php): `app/Http/Requests/TasksRules.php`
- [Request helpers](https://github.com/chonwai/axpep_backend/blob/main/app/Utils/RequestUtils.php): `app/Utils/RequestUtils.php`
- [File utilities](https://github.com/chonwai/axpep_backend/blob/main/app/Utils/FileUtils.php): `app/Utils/FileUtils.php`
- [Format utilities](https://github.com/chonwai/axpep_backend/blob/main/app/Utils/FormatUtils.php): `app/Utils/FormatUtils.php`
- [Task utilities](https://github.com/chonwai/axpep_backend/blob/main/app/Utils/TaskUtils.php): `app/Utils/TaskUtils.php`
- [Response utilities](https://github.com/chonwai/axpep_backend/blob/main/app/Utils/ResponseUtils.php): `app/Utils/ResponseUtils.php`
- [Response factory](https://github.com/chonwai/axpep_backend/blob/main/app/Utils/Res/ResFactoryUtils.php): `app/Utils/Res/ResFactoryUtils.php`
- [Service interface](https://github.com/chonwai/axpep_backend/blob/main/app/Services/BaseServicesInterface.php): `app/Services/BaseServicesInterface.php`

### Other components

- **API caller**
- **SSL-GCN service**

## Connections

- API caller → Task API: requests
- API caller → AcPEP API: requests
- Task API → Task services: calls (evidence: `app/Http/Controllers/Apis/TaskController.php`)
- Task API → Request helpers: prepares request (evidence: `app/Http/Controllers/Apis/TaskController.php`)
- AcPEP API → AcPEP services: calls (evidence: `app/Http/Controllers/Apis/AcPEPController.php`)
- Task services → Task data access: uses (evidence: `app/Services/TasksServices.php`)
- Task services → Task records: uses (evidence: `app/Services/TasksServices.php`)
- Task services → Task validation: validates with (evidence: `app/Services/TasksServices.php`)
- Task services → File utilities: uses (evidence: `app/Services/TasksServices.php`)
- Task services → Response factory: formats responses (evidence: `app/Services/TasksServices.php`)
- AcPEP services → AcPEP job: dispatches (evidence: `app/Services/AcPEPServices.php`)
- AcPEP services → Codon job: dispatches (evidence: `app/Services/AcPEPServices.php`)
- AcPEP services → DAO factory: uses (evidence: `app/Services/AcPEPServices.php`)
- AcPEP services → Task records: uses (evidence: `app/Services/AcPEPServices.php`)
- Task records → Method results: has details (evidence: `app/Models/Tasks.php`)
- SSL-GCN client → SSL-GCN service: sends predictions (evidence: `app/Services/SSLGCNMicroserviceClient.php`)
- Toxicology service → SSL-GCN client: uses
- Prediction services → Prediction jobs: dispatches (evidence: `app/Services/AcPEPServices.php`)
- Task validation → Format utilities: validates format (evidence: `app/Http/Requests/TasksRules.php`)
- Task services → Service interface: implements (evidence: `app/Services/TasksServices.php`)
