No description
  • TypeScript 98.8%
  • CSS 1%
  • Dockerfile 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-25 01:35:41 +02:00
public Updated metadata for sites 2026-10-24 21:35:47 +02:00
src fixed imports 2026-10-25 01:35:41 +02:00
.dockerignore Updated docker ignore 2026-10-21 17:29:32 +02:00
.fallowrc.json Added achievements page 2026-08-20 00:51:59 +02:00
.gitignore Added fallow 2026-08-17 21:48:04 +02:00
.gitlab-ci.yml Moved to using mise 2026-10-18 23:19:15 +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 Removed unused deps 2026-10-25 00:45:17 +02:00
components.json Moved to base ui 2026-08-18 00:53:11 +02:00
docker-compose.yml Updated naming 2026-04-17 20:00:05 +02:00
Dockerfile Added public folder 2026-10-23 13:51:17 +02:00
dprint.json Small changes 2026-08-17 21:40:54 +02:00
mise.lock Updated docker image 2026-10-18 23:59:58 +02:00
mise.toml Updated mise config 2026-10-18 23:26:00 +02:00
next.config.ts Added og images for all pages 2026-10-24 22:06:43 +02:00
oxlint.config.mts Moved to oxlint 2026-08-20 19:51:03 +02:00
package.json Removed unused deps 2026-10-25 00:45:17 +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