v1.5.0: Complete documentation rewrite - 50+ files with AlisaReactionBot style

- Box-style header comments (Project, Author, License) on every file
- Section headers using double-line box decorators
- Feature markers (// ---- FEATURE: XYZ ----) before every major function
- JSDoc comments for EVERY function with @param, @returns, @example
- Inline notes (NOTE, WARNING, TIP) for non-obvious logic
- Footer END markers on every module
- Matched code style to AlisaReactionBot repository
- All files now searchable by feature name via grep

Author: Shinei Nouzen <157171073+Shineii86@users.noreply.github.com>
This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 16:14:01 +05:30
parent 87d6d4dbf2
commit 0034617c3b
55 changed files with 2965 additions and 108 deletions
+40 -2
View File
@@ -1,6 +1,43 @@
/*
* ======= • ======= • ======= • ======= • =======• =======
* AniKatoAPI — popular.controller.js
* Repository: https://github.com/Shineii86/AniKatoAPI
*
* @description
* Controller for most popular anime list. Returns paginated list
* of the most popular anime from the source site. Supports page
* parameter for pagination.
*
* @exports
* getPopular - Express route handler for GET /api/most-popular
*
* @author Shinei Nouzen
* @license MIT
* ======= • ======= • ======= • ======= • =======• =======
*/
import { extractPopular } from "../extractors/popular.extractor.js";
import { getCache, setCache } from "../helper/cache.helper.js";
// ══════════════════════════════════════════════════════════════
// CONTROLLER: POPULAR
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Most popular anime endpoint ----
/**
* Handles GET /api/most-popular requests. Returns paginated list
* of the most popular anime from the source site.
*
* @param {object} req - Express request object
* @param {number} req.query.page - Page number (default: 1)
* @param {object} res - Express response object
* @param {Function} next - Express next middleware function
* @returns {void} Sends JSON response with popular anime list
*
* @example
* GET /api/most-popular?page=2
* Response: { success: true, results: { anime, pagination, ... } }
*/
const getPopular = async (req, res, next) => {
try {
const { page = 1 } = req.query;
@@ -9,7 +46,6 @@ const getPopular = async (req, res, next) => {
if (cached) {
return res.json({ success: true, results: cached });
}
const data = await extractPopular(page);
setCache(cacheKey, data);
res.json({ success: true, results: data });
@@ -18,4 +54,6 @@ const getPopular = async (req, res, next) => {
}
};
export { getPopular };
export { getPopular };
// ══════════════════════════════════════════════════════════════ END: popular.controller.js