docs: update all documentation with pagination and fixes

- Update CHANGELOG.md with pagination metadata and bug fixes
- Update README.md with pagination documentation and project structure
- Update docs/endpoints.md with pagination section
- Update docs/index.md with pagination feature
- Update docs/architecture.md with pagination helper
This commit is contained in:
Shinei Nouzen
2026-07-04 16:25:48 +05:30
parent e8b63b5d16
commit 46448ff217
5 changed files with 76 additions and 4 deletions
+5 -2
View File
@@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [2.0.0] - 2026-07-04
### Added
- **Creator Info Middleware**: Injects creator attribution (name, GitHub, Telegram, timestamp) into every JSON response
- **Pagination Metadata**: All list endpoints now include `pagination` object with `currentPage`, `totalPages`, `totalItems`, `itemsPerPage`, `hasNext`, `hasPrev`
- **Creator Info Middleware**: Injects creator attribution (name, GitHub, Telegram, message, timestamp) into every JSON response
- **Multi-Mirror Fallback System**: Automatic failover across 5 mirror domains (anikototv.to, anikoto.cz, anikoto.me, anikoto.net, anikototv.se)
- **LRU Cache with Configurable TTL**: Replaced basic Map cache with LRU cache supporting per-endpoint TTL (3min to 60min)
- **Response Compression**: Added gzip compression middleware (level 6, 1024 byte threshold)
@@ -39,7 +40,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated `test.js` with optional endpoint handling and performance metrics
### Fixed
- **CRITICAL**: Fixed header merging bug in mirror helper (custom headers were ignored)
- **CRITICAL**: Fixed `extractPages` URL handling bug causing doubled URLs in mirror fallback
- **CRITICAL**: Fixed `creatorInfo` middleware not including `message` field in responses
- Fixed header merging bug in mirror helper (custom headers were ignored)
- Fixed mirror URL construction (proper base URL handling)
- Fixed cache key sorting in filter controller
- Fixed trailing slash inconsistency in console output
+34 -1
View File
@@ -337,7 +337,8 @@ AniKotoAPI/
│ │ ├── 📄 cache.helper.js # 💾 In-memory caching
│ │ ├── 📄 countPages.helper.js # 📄 Pagination counter
│ │ ├── 📄 extractPages.helper.js # 📃 Page fetcher
│ │ └── 📄 formatTitle.helper.js # 🔤 Title formatter
│ │ ├── 📄 formatTitle.helper.js # 🔤 Title formatter
│ │ └── 📄 pagination.helper.js # 📊 Pagination metadata generator
│ │
│ ├── 📂 middleware/ # 🔧 Express middleware
│ │ └── 📄 creatorInfo.js # ✍️ Creator attribution injection
@@ -1933,6 +1934,38 @@ console.log(resp.data);
}
```
### Pagination Metadata
All list endpoints include pagination metadata in the response:
```json
{
"success": true,
"results": {
"data": [...],
"pagination": {
"currentPage": 1,
"totalPages": 294,
"totalItems": 8820,
"itemsPerPage": 30,
"hasNext": true,
"hasPrev": false
}
}
}
```
| Field | Type | Description |
|:---|:---|:---|
| `currentPage` | `number` | Current page number (1-indexed) |
| `totalPages` | `number` | Total number of pages available |
| `totalItems` | `number` | Estimated total items across all pages |
| `itemsPerPage` | `number` | Number of items per page (default: 30) |
| `hasNext` | `boolean` | Whether there is a next page |
| `hasPrev` | `boolean` | Whether there is a previous page |
**Endpoints with pagination:** `/api/search`, `/api/most-popular`, `/api/new-release`, `/api/newly-added`, `/api/latest-updated`, `/api/az-list/:letter`, `/api/filter`, `/api/genre/:name`, `/api/type/:name`, `/api/status/:name`
### Anime Item Object
| Field | Type | Description | Example |
+2 -1
View File
@@ -82,7 +82,8 @@ AniKotoAPI/
│ └── helper/
│ ├── cache.helper.js # LRU cache with configurable TTL
│ ├── mirror.helper.js # Multi-mirror fallback (5 domains)
│ └── extractPages.helper.js # Page fetching with mirror fallback
│ ├── extractPages.helper.js # Page fetching with mirror fallback
│ └── pagination.helper.js # Pagination metadata generator
│
│ └── middleware/
│ └── creatorInfo.js # Creator attribution injection
+34
View File
@@ -4,6 +4,40 @@ Base URL: `https://anikototvapi.vercel.app/api`
---
## Pagination
All list endpoints include pagination metadata in the response:
```json
{
"success": true,
"results": {
"data": [...],
"pagination": {
"currentPage": 1,
"totalPages": 294,
"totalItems": 8820,
"itemsPerPage": 30,
"hasNext": true,
"hasPrev": false
}
}
}
```
| Field | Type | Description |
|:---|:---|:---|
| `currentPage` | `number` | Current page number (1-indexed) |
| `totalPages` | `number` | Total number of pages available |
| `totalItems` | `number` | Estimated total items across all pages |
| `itemsPerPage` | `number` | Number of items per page (default: 30) |
| `hasNext` | `boolean` | Whether there is a next page |
| `hasPrev` | `boolean` | Whether there is a previous page |
**Endpoints with pagination:** `/api/search`, `/api/most-popular`, `/api/new-release`, `/api/newly-added`, `/api/latest-updated`, `/api/az-list/:letter`, `/api/filter`, `/api/genre/:name`, `/api/type/:name`, `/api/status/:name`
---
## GET /
Returns homepage data: spotlight anime, trending, top-airing, and genres.
+1
View File
@@ -62,6 +62,7 @@ curl "https://anikototvapi.vercel.app/api/info?id=road-of-naruto-ggjw8"
- **LRU Cache** — Configurable TTL per endpoint type (3min to 60min)
- **Multi-Mirror Fallback** — Automatic failover across 5 mirror domains
- **Response Compression** — Gzip compression for faster responses
- **Pagination Metadata** — All list endpoints include `pagination` object with `currentPage`, `totalPages`, `hasNext`, `hasPrev`
- **CORS Enabled** — Access from any domain
- **JSON Responses** — Standardized `{success, results}` format