How valumane/hypixelapi works
Project type and purpose
• This is a lightweight full-stack “API Utilities” web project.
• Frontend: a static web UI (index.html + styles.css + /script + /texture assets) that visualizes SkyBlock data.
• Backend: a Node.js “hypixel-scraper” service that crawls Hypixel sitemaps, calls the official Hypixel API, and writes JSON data (in /gestion and /sitemap).
Main components
a. Browser / Client
• Loads index.html, CSS, scripts (main.js, profile.js, inventory.js, etc.) and textures.
• Renders player/guild/SkyBlock views and invokes data-fetching calls.
b. Static Assets Host
• Serves index.html, styles.css, JS files from root.
c. Scraper Service (hypixel-scraper)
• sitemap_gestion.js: retrieves sitemap.json → ndjson of all item pages.
• sitemap_process_scrapping.js: sequentially fetches each page via index.js (Hypixel API calls).
• management logic in /gestion/*.json: normalizes and merges endpoint data (e.g., bazaar.json, gemstone.json).
d. Data Store (File System)
• JSON under hypixel-scraper/gestion and sitemap.
• backup_API.json at root as fallback.
e. External Hypixel API
• Public endpoints providing real-time data on players, guilds, SkyBlock.
Relationships & Data Flows
• Scraper Service → External Hypixel API: calls endpoints, retrieves raw JSON.
• Scraper Service → Data Store: writes processed JSON under /gestion and /sitemap.
• Browser Frontend → Scraper Service (or direct to External API / backup_API.json): fetches JSON for display.
• Browser Frontend → Local Static Host: loads JS, CSS, images.
Architectural Patterns & Principles
• Client-Server separation: static SPA vs. scraping microservice.
• File-based cache/database: no traditional RDBMS—JSON files serve as datastore.
• Modular scripting: each feature (profile, inventory, bestiary) lives in its own JS file.
• Single Responsibility in scrapper: sitemap crawling, API calling, data normalization.
Detailed Breakdown to Capture All Elements
• Frontend:
• index.html loads /styles.css + /script/*.js
• /texture/* provides UI images
• Backend (hypixel-scraper):
• index.js is entry point
• sitemap_gestion.js builds sitemap.json → .ndjson
• sitemap_process_scrapping.js loops through URLs, invokes index.js
• /gestion/*.json hold feature-specific metadata
• Data Flow:
1. Scraper boots → reads existing sitemap.json or backup_API.json
2. Crawls new data → writes updated JSON files
3. Frontend fetches these JSONs to display up-to-date stats