How kiraaziz/mangahook-api works
Project type and purpose
• This is primarily an API-focused project (“Manga Hook”) that provides manga data endpoints (Express.js server under /server).
• It also includes two adjacent artifacts:
a) A documentation site built with Astro in /docs
b) A Next.js example client (“next exemple”) that demonstrates how to consume the API with React hooks.
File structure
• Top-level:
• /server → Express.js API with controllers, middleware, routes, and environment config
• /docs → Static documentation site (Astro) with its own config, content, assets, public folder
• /next exemple → Next.js client app showcasing ready-to-use hooks
• /types → Shared TypeScript interfaces for manga and mangaList
• The server folder follows an MVC-style pattern:
• controllers/ handle business logic per resource (manga, list, search)
• middleware/ performs request validation, API-key checking, data collection
• routes/ wire endpoints to controllers
• app.js sets up Express, middleware chain, and mounts routers
• The Next.js example app further splits into:
• /app (new App Router pages)
• /components (UI primitives and layout)
• /hooks (custom React hooks calling your API)
• /docs holds Astro’s config, MDX content, public assets, and tsconfig.
Key insights from README
• The core functionality is the Express API exposing endpoints under /api (GET /api/mangaList, /api/manga/:id, /api/search, /api/manga/:id/chapters, etc.)
• Features: listing manga, single manga, chapter list, chapter images, searching
• The Next.js example is there to illustrate usage via React hooks
• The documentation site is deployed separately and describes usage
Final advice
• Be detailed: break the API server into its three main layers
• Endpoints grouped under the manga resource
• Separate static documentation from interactive client
• How the shared TypeScript types tie client and server together