No description
  • TypeScript 98.5%
  • CSS 1.3%
  • Dockerfile 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-16 22:58:55 +02:00
src Updated bedwars prestige progress 2026-08-16 22:58:55 +02:00
.dockerignore Added docker files 2025-09-04 23:33:26 +02:00
.envrc Updated gitignore 2025-08-29 12:29:24 +02:00
.gitignore Updated gitignore 2025-08-29 12:29:24 +02:00
.gitlab-ci.yml Added gitlab ci file 2025-09-04 23:34:44 +02:00
.npmrc Finished sidebar 2025-08-17 13:19:14 +02:00
AGENTS.md Updated naming 2026-04-17 20:00:05 +02:00
bun.lock Updated to patch cve 2026-05-12 12:13:36 +02:00
components.json Cleaned up template 2025-07-28 11:17:53 +02:00
docker-compose.yml Updated naming 2026-04-17 20:00:05 +02:00
Dockerfile Fixed bug with container building 2026-04-17 22:51:14 +02:00
dprint.json Cleaned up template 2025-07-28 11:17:53 +02:00
eslint.config.mjs Updated to nextjs v16 2025-10-29 18:21:09 +01:00
next.config.ts Updated deps 2026-04-23 18:09:30 +02:00
package.json Updated to patch cve 2026-05-12 12:13:36 +02:00
postcss.config.mjs Cleaned up template 2025-07-28 11:17:53 +02:00
README.md Updated naming 2026-04-17 20:00:05 +02:00
tsconfig.json Updating padding 2026-05-09 01:33:18 +02:00

AetherPixel

AetherPixel is a Next.js App Router application that looks up Minecraft players and guilds, then displays Hypixel network and game statistics.

It consumes Mojang and Hypixel APIs on the server, validates responses with Zod, and applies cache profiles to reduce upstream load and repeated calls.

Request/Data Flow

Player stats page (/player/[ign])

  1. Resolve IGN to UUID through Mojang API (getUuid)
  2. Fetch Hypixel player profile (getPlayer)
  3. Fetch current online status (getSession)
  4. Fetch guild data (getGuild)
  5. Render server components with validated data

Relevant files:

  • src/app/(stats)/player/[ign]/page.tsx
  • src/lib/hypixel/api/mojang.ts
  • src/lib/hypixel/api/player.ts
  • src/lib/hypixel/api/online.ts
  • src/lib/hypixel/api/guild.ts

Guild member enrichment route (/api/guildmembers)

  1. Validate uuid query param
  2. Fetch minimal player payload through getPlayerForGuild
  3. Return normalized JSON response

Relevant file:

  • src/app/(stats)/api/guildmembers/route.ts

External API Usage

Mojang

  • Endpoint: GET https://api.mojang.com/users/profiles/minecraft/{ign}
  • Purpose: convert player IGN to Mojang UUID
  • Implementation: src/lib/hypixel/api/mojang.ts

Hypixel

All Hypixel calls include server-side header:

API-Key: <HYPIXEL_API_KEY>
  • GET https://api.hypixel.net/v2/player?uuid={uuid}
    • Used by getPlayer and getPlayerForGuild
  • GET https://api.hypixel.net/v2/status?uuid={uuid}
    • Used by getSession
  • GET https://api.hypixel.net/v2/guild?player={uuid} (or id/name)
    • Used by getGuild

Implementation files:

  • src/lib/hypixel/api/player.ts
  • src/lib/hypixel/api/online.ts
  • src/lib/hypixel/api/guild.ts

Caching Strategy

This project uses Next.js "use cache" + named cacheLife(...) profiles.

Global profiles are configured in next.config.ts:

Profile stale revalidate expire Intended use
hypixelApi 60s 30s 5m Player, status, guild reads
mojangApi 60s 30s 5m IGN -> UUID lookups
playerWithGuild 24h 24h 7d Guild member helper lookups

Where profiles are applied:

  • getPlayer, getSession, getGuild: apply hypixelApi in production
  • getUuid: applies mojangApi in production
  • getPlayerForGuild: applies playerWithGuild for guild helper route

Key files:

  • next.config.ts
  • src/lib/hypixel/api/player.ts
  • src/lib/hypixel/api/mojang.ts
  • src/lib/hypixel/api/online.ts
  • src/lib/hypixel/api/guild.ts

Reliability and Safety Controls

  • Server-only secret usage through validated env access (@t3-oss/env-nextjs)
  • Zod parsing for API payloads before rendering
  • Null-safe return paths for upstream failures and invalid payloads
  • Maintenance mode gate (MAINTENANCE_MODE) for temporary disablement

Relevant files:

  • src/lib/env/server.ts
  • src/lib/schema/player.ts
  • src/lib/schema/guild.ts
  • src/lib/schema/status.ts

Environment Variables

Required server env values:

  • HYPIXEL_API_KEY (required, non-empty)
  • MAINTENANCE_MODE (optional, defaults to false)

Defined in:

  • src/lib/env/server.ts

Run Locally

bun install
bun run dev

Optional checks:

bun run typecheck
bun run lint
bun run fmt