# mehmeterdogan/nobetci-eczane-api-php architecture

> Architecture diagram of the GitHub repository mehmeterdogan/nobetci-eczane-api-php, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mehmeterdogan/nobetci-eczane-api-php
- Repository: https://github.com/mehmeterdogan/nobetci-eczane-api-php

## Overview

This is a lightweight PHP SDK for querying Eczaneler.ORG’s pharmacy REST API. A consuming application creates EczaneClient and calls methods for on-duty pharmacies (nationwide, city, district, or nearby), location lists, account details, whitelist updates, or the premium all-pharmacies listing. Each method prepares endpoint inputs and delegates HTTP work to the client’s shared request routine, which returns decoded responses or maps failures to typed exceptions. The README advertises smart caching, but the sampled client code shows no cache implementation; relationships are limited to behavior visible in that code.

Main entry points: [`src/EczaneClient.php`](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php) (cURL request), [`src/Exceptions/EczaneApiException.php`](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/EczaneApiException.php) (API exception base), [`src/Exceptions/AuthenticationException.php`](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/AuthenticationException.php) (Authentication error), [`src/Exceptions/ConnectionException.php`](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/ConnectionException.php) (Connection error)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_queries["Pharmacy queries"]
  node_sentry["On-duty listings<br/>[EczaneClient.php]"]
  node_city["City listings<br/>[EczaneClient.php]"]
  node_district["District listings<br/>[EczaneClient.php]"]
  node_nearby["Nearby search<br/>[EczaneClient.php]"]
  node_directories["City and district lists<br/>[EczaneClient.php]"]
  node_allpharmacies["All pharmacies<br/>[EczaneClient.php]"]
end

subgraph group_account["Account services"]
  node_accountinfo["Account information<br/>[EczaneClient.php]"]
  node_whitelist["Whitelist update<br/>[EczaneClient.php]"]
end

subgraph group_transport["HTTP and errors"]
  node_client["EczaneClient<br/>[EczaneClient.php]"]
  node_request["cURL request<br/>[EczaneClient.php]"]
  node_errors["HTTP error mapping<br/>[EczaneClient.php]"]
  node_baseexception["API exception base"]
  node_autherror["Authentication error"]
  node_connectionerror["Connection error"]
  node_forbiddenerror["Forbidden error"]
  node_invaliderror["Invalid request error"]
  node_notfounderror["Not found error"]
  node_rateerror["Rate limit error"]
end

node_app(("PHP application"))
node_api{{"Eczaneler REST API"}}

node_app -->|"creates"| node_client
node_client -->|"calls"| node_sentry
node_client -->|"calls"| node_city
node_client -->|"calls"| node_district
node_client -->|"calls"| node_nearby
node_client -->|"calls"| node_directories
node_client -->|"calls"| node_allpharmacies
node_client -->|"calls"| node_accountinfo
node_client -->|"calls"| node_whitelist
node_sentry -->|"delegates"| node_request
node_city -->|"delegates"| node_request
node_district -->|"delegates"| node_request
node_nearby -->|"delegates"| node_request
node_directories -->|"delegates"| node_request
node_allpharmacies -->|"delegates"| node_request
node_accountinfo -->|"delegates"| node_request
node_whitelist -->|"delegates"| node_request
node_request -->|"sends HTTP"| node_api
node_api -->|"returns JSON"| node_request
node_request -->|"maps failures"| node_errors
node_errors -->|"throws 401"| node_autherror
node_errors -->|"throws 400"| node_invaliderror
node_errors -->|"throws 403"| node_forbiddenerror
node_errors -->|"throws 404"| node_notfounderror
node_errors -->|"throws 429"| node_rateerror
node_errors -->|"throws other"| node_baseexception
node_request -->|"throws network"| node_connectionerror
node_autherror -->|"extends"| node_baseexception
node_connectionerror -->|"extends"| node_baseexception
node_forbiddenerror -->|"extends"| node_baseexception
node_invaliderror -->|"extends"| node_baseexception
node_notfounderror -->|"extends"| node_baseexception
node_rateerror -->|"extends"| node_baseexception

click node_client "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_sentry "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_city "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_district "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_nearby "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_directories "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_allpharmacies "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_accountinfo "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_whitelist "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_request "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_errors "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php"
click node_baseexception "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/EczaneApiException.php"
click node_autherror "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/AuthenticationException.php"
click node_connectionerror "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/ConnectionException.php"
click node_forbiddenerror "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/ForbiddenException.php"
click node_invaliderror "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/InvalidRequestException.php"
click node_notfounderror "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/NotFoundException.php"
click node_rateerror "https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/RateLimitException.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_sentry,node_city,node_district,node_nearby,node_directories,node_allpharmacies toneBlue
class node_accountinfo,node_whitelist toneAmber
class node_client,node_request,node_errors,node_baseexception,node_autherror,node_connectionerror,node_forbiddenerror,node_invaliderror,node_notfounderror,node_rateerror,node_api toneMint
class node_app toneIndigo
```

## Components

### Pharmacy queries

- [On-duty listings](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [City listings](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [District listings](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [Nearby search](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [City and district lists](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [All pharmacies](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`

### Account services

- [Account information](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [Whitelist update](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`

### HTTP and errors

- [EczaneClient](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [cURL request](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [HTTP error mapping](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/EczaneClient.php): `src/EczaneClient.php`
- [API exception base](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/EczaneApiException.php): `src/Exceptions/EczaneApiException.php`
- [Authentication error](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/AuthenticationException.php): `src/Exceptions/AuthenticationException.php`
- [Connection error](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/ConnectionException.php): `src/Exceptions/ConnectionException.php`
- [Forbidden error](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/ForbiddenException.php): `src/Exceptions/ForbiddenException.php`
- [Invalid request error](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/InvalidRequestException.php): `src/Exceptions/InvalidRequestException.php`
- [Not found error](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/NotFoundException.php): `src/Exceptions/NotFoundException.php`
- [Rate limit error](https://github.com/mehmeterdogan/nobetci-eczane-api-php/blob/main/src/Exceptions/RateLimitException.php): `src/Exceptions/RateLimitException.php`

### Other components

- **PHP application**
- **Eczaneler REST API**

## Connections

- PHP application → EczaneClient: creates
- EczaneClient → On-duty listings: calls
- EczaneClient → City listings: calls
- EczaneClient → District listings: calls
- EczaneClient → Nearby search: calls
- EczaneClient → City and district lists: calls
- EczaneClient → All pharmacies: calls
- EczaneClient → Account information: calls
- EczaneClient → Whitelist update: calls
- On-duty listings → cURL request: delegates
- City listings → cURL request: delegates
- District listings → cURL request: delegates
- Nearby search → cURL request: delegates
- City and district lists → cURL request: delegates
- All pharmacies → cURL request: delegates
- Account information → cURL request: delegates
- Whitelist update → cURL request: delegates
- cURL request → Eczaneler REST API: sends HTTP
- Eczaneler REST API → cURL request: returns JSON
- cURL request → HTTP error mapping: maps failures
- HTTP error mapping → Authentication error: throws 401
- HTTP error mapping → Invalid request error: throws 400
- HTTP error mapping → Forbidden error: throws 403
- HTTP error mapping → Not found error: throws 404
- HTTP error mapping → Rate limit error: throws 429
- HTTP error mapping → API exception base: throws other
- cURL request → Connection error: throws network
- Authentication error → API exception base: extends
- Connection error → API exception base: extends
- Forbidden error → API exception base: extends
- Invalid request error → API exception base: extends
- Not found error → API exception base: extends
- Rate limit error → API exception base: extends
