# mestretm/anfireapi-anime-player architecture

> Architecture diagram of the GitHub repository mestretm/anfireapi-anime-player, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mestretm/anfireapi-anime-player
- Repository: https://github.com/mestretm/anfireapi-anime-player

## Overview

AnFireAPI is an archived anime-discovery, episode-metadata, and playback project. Users can browse recently updated anime or search, open a player, and request anime details and episode streams through an API. The repository contains both a PHP API and a Node.js API with scraping and caching responsibilities. The sampled excerpts show the Node.js routing/cache wiring and PHP search/player behavior; some API internals and the SQL schema were only partially shown, so uncertain links are omitted.

Main entry points: [`api.php`](https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php) (PHP API endpoint), [`NodeJS/routes/api.js`](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/routes/api.js) (API routing), [`index.php`](https://github.com/mestretm/anfireapi-anime-player/blob/main/index.php) (Anime browser), [`AnFire_Player.php`](https://github.com/mestretm/anfireapi-anime-player/blob/main/AnFire_Player.php) (Anime player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web discovery and playback"]
  node_catalog["Anime browser<br/>[index.php]"]
  node_player["Anime player<br/>[AnFire_Player.php]"]
end

subgraph group_php["PHP API"]
  node_php_api["PHP API endpoint<br/>[api.php]"]
  node_php_details["Anime details<br/>[api.php]"]
  node_php_episodes["Episode streams<br/>[api.php]"]
  node_php_cache[("PHP cache<br/>[api.php]")]
end

subgraph group_node["Node API"]
  node_node_server["Express server<br/>[app.js]"]
  node_node_routes["API routing<br/>[api.js]"]
  node_node_details["Anime scraping<br/>[api.js]"]
  node_node_episodes["Episode scraping<br/>[api.js]"]
  node_node_cache[("API cache model<br/>[api_cache.js]")]
  node_sequelize["Database connection<br/>[sequelize.js]"]
  node_db_config["Database settings<br/>[config.js]"]
end

subgraph group_integrations["External sources"]
  node_animefire["AnimeFire site"]
  node_blogger["Blogger video iframe"]
end

node_browser_user(("Browser user"))

node_browser_user -->|"searches or browses"| node_catalog
node_catalog -->|"fetches catalog"| node_animefire
node_catalog -->|"opens anime"| node_player
node_browser_user -.->|"selects episode"| node_player
node_player -->|"requests anime data"| node_php_api
node_php_api -->|"reads or writes"| node_php_cache
node_php_api -->|"scrapes anime data"| node_animefire
node_php_api -->|"resolves video iframe"| node_blogger
node_node_server -->|"syncs database"| node_sequelize
node_node_server -->|"mounts routes"| node_node_routes
node_node_routes -->|"reads or writes"| node_node_cache
node_node_cache -->|"defines model on"| node_sequelize
node_sequelize -->|"loads settings"| node_db_config
node_node_routes -->|"fetches anime data"| node_animefire
node_node_routes -->|"resolves video iframe"| node_blogger

click node_catalog "https://github.com/mestretm/anfireapi-anime-player/blob/main/index.php"
click node_player "https://github.com/mestretm/anfireapi-anime-player/blob/main/AnFire_Player.php"
click node_php_api "https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php"
click node_php_details "https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php"
click node_php_episodes "https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php"
click node_php_cache "https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php"
click node_node_server "https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/app.js"
click node_node_routes "https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/routes/api.js"
click node_node_details "https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/routes/api.js"
click node_node_episodes "https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/routes/api.js"
click node_node_cache "https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/models/api_cache.js"
click node_sequelize "https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/sequelize.js"
click node_db_config "https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/config/config.js"

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_catalog,node_player,node_browser_user toneBlue
class node_php_api,node_php_details,node_php_episodes,node_php_cache toneAmber
class node_node_server,node_node_routes,node_node_details,node_node_episodes,node_node_cache,node_sequelize,node_db_config toneMint
class node_animefire,node_blogger toneRose
```

## Components

### Web discovery and playback

- [Anime browser](https://github.com/mestretm/anfireapi-anime-player/blob/main/index.php): `index.php`
- [Anime player](https://github.com/mestretm/anfireapi-anime-player/blob/main/AnFire_Player.php): `AnFire_Player.php`

### PHP API

- [PHP API endpoint](https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php): `api.php`
- [Anime details](https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php): `api.php`
- [Episode streams](https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php): `api.php`
- [PHP cache](https://github.com/mestretm/anfireapi-anime-player/blob/main/api.php): `api.php`

### Node API

- [Express server](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/app.js): `NodeJS/app.js`
- [API routing](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/routes/api.js): `NodeJS/routes/api.js`
- [Anime scraping](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/routes/api.js): `NodeJS/routes/api.js`
- [Episode scraping](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/routes/api.js): `NodeJS/routes/api.js`
- [API cache model](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/models/api_cache.js): `NodeJS/models/api_cache.js`
- [Database connection](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/sequelize.js): `NodeJS/sequelize.js`
- [Database settings](https://github.com/mestretm/anfireapi-anime-player/blob/main/NodeJS/config/config.js): `NodeJS/config/config.js`

### External sources

- **AnimeFire site**
- **Blogger video iframe**

### Other components

- **Browser user**

## Connections

- Browser user → Anime browser: searches or browses (evidence: `index.php`)
- Anime browser → AnimeFire site: fetches catalog (evidence: `index.php`)
- Anime browser → Anime player: opens anime (evidence: `index.php`)
- Browser user → Anime player: selects episode
- Anime player → PHP API endpoint: requests anime data
- PHP API endpoint → PHP cache: reads or writes (evidence: `api.php`)
- PHP API endpoint → AnimeFire site: scrapes anime data (evidence: `api.php`)
- PHP API endpoint → Blogger video iframe: resolves video iframe (evidence: `api.php`)
- Express server → Database connection: syncs database (evidence: `NodeJS/app.js`)
- Express server → API routing: mounts routes (evidence: `NodeJS/app.js`)
- API routing → API cache model: reads or writes (evidence: `NodeJS/routes/api.js`)
- API cache model → Database connection: defines model on (evidence: `NodeJS/models/api_cache.js`)
- Database connection → Database settings: loads settings (evidence: `NodeJS/sequelize.js`)
- API routing → AnimeFire site: fetches anime data (evidence: `NodeJS/routes/api.js`)
- API routing → Blogger video iframe: resolves video iframe (evidence: `NodeJS/routes/api.js`)
