feat: initial elysium idle game prototype

Sets up the full monorepo with pnpm workspaces. Includes shared types
package, Hono API with Discord OAuth/JWT auth, Prisma v6 + MongoDB
Atlas, and React + Vite frontend with game loop, five tabs, and
Discord-linked save/load.
This commit is contained in:
2026-03-06 11:26:19 -08:00
committed by Naomi Carrigan
parent c69e155de3
commit a3daed1683
64 changed files with 9011 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import type { GameState } from "@elysium/types";
import { Hono } from "hono";
import { prisma } from "../db/client.js";
export const profileRouter = new Hono();
profileRouter.get("/:discordId", async (context) => {
const { discordId } = context.req.param();
const [player, gameStateRecord] = await Promise.all([
prisma.player.findUnique({ where: { discordId } }),
prisma.gameState.findUnique({ where: { discordId } }),
]);
if (!player) {
return context.json({ error: "Player not found" }, 404);
}
const state = gameStateRecord?.state as unknown as GameState | undefined;
const prestigeCount = state?.prestige.count ?? 0;
return context.json({
characterName: player.characterName,
username: player.username,
avatar: player.avatar ?? null,
prestigeCount,
totalGoldEarned: player.totalGoldEarned,
totalClicks: player.totalClicks,
createdAt: player.createdAt,
});
});