Feature 4: Webinterface — React-Frontend, Discord-OAuth2, REST-API

- Discord-OAuth2-Login (identify-Scope, CSRF-State, signierte Session-Cookies, keine Token-Speicherung)
- REST-API: /api/devlogs (öffentlich), /api/commits (nur ADMIN_DISCORD_ID), /api/me
- React + Vite Frontend: Devlog-Archiv mit Mini-Markdown-Renderer, Commit-Tabelle, dunkles EcoGame-Theme
- Fastify liefert frontend/dist mit SPA-Fallback aus; Vite-Dev-Proxy für lokale Entwicklung
- Multi-Stage-Dockerfile (Frontend-Build im Image), neue Env-Vars in Compose + .env.example
- README: OAuth2-Setup (Redirect-URLs, Client Secret) und Frontend-Workflow

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 00:31:39 +02:00
co-authored by Claude Opus 4.8
parent 2f9d548bc8
commit a70eac08d7
23 changed files with 2931 additions and 16 deletions
+161
View File
@@ -0,0 +1,161 @@
/* EcoGame Webinterface — dunkles Theme, EcoGame-Grün als Akzent */
:root {
--bg: #0f1412;
--bg-card: #171e1a;
--bg-header: #131916;
--border: #263129;
--text: #e4ece6;
--text-dim: #93a297;
--accent: #2e8b57;
--accent-bright: #3fae6f;
}
* { box-sizing: border-box; }
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: system-ui, 'Segoe UI', sans-serif;
line-height: 1.6;
}
.app { min-height: 100vh; display: flex; flex-direction: column; }
/* Header */
.header {
background: var(--bg-header);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
}
.header-inner {
max-width: 880px;
margin: 0 auto;
padding: 0.7rem 1rem;
display: flex;
align-items: center;
gap: 1.5rem;
}
.brand {
font-weight: 700;
font-size: 1.15rem;
color: var(--text);
text-decoration: none;
display: flex;
align-items: center;
gap: 0.5rem;
}
.brand-dot {
width: 10px; height: 10px;
border-radius: 50%;
background: var(--accent-bright);
box-shadow: 0 0 8px var(--accent-bright);
}
.nav { display: flex; gap: 1rem; flex: 1; }
.nav a {
color: var(--text-dim);
text-decoration: none;
padding: 0.25rem 0;
border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.auth { display: flex; align-items: center; gap: 0.6rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; }
.username { color: var(--text-dim); font-size: 0.9rem; }
/* Buttons */
.btn {
display: inline-block;
background: var(--accent);
color: #fff;
border: none;
border-radius: 6px;
padding: 0.45rem 0.9rem;
font-size: 0.9rem;
text-decoration: none;
cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--accent-bright); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: transparent; }
/* Inhalt */
.main { flex: 1; max-width: 880px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
h1 { margin: 0.5rem 0 0.2rem; font-size: 1.6rem; }
.subtitle { color: var(--text-dim); margin: 0 0 1.5rem; font-size: 0.95rem; }
.notice { color: var(--text-dim); padding: 2rem 0; }
.notice.center { text-align: center; }
.notice .btn { margin-top: 0.5rem; }
/* Devlog-Karten */
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-left: 3px solid var(--accent);
border-radius: 8px;
padding: 1rem 1.25rem;
margin-bottom: 1.25rem;
}
.card-date {
color: var(--accent-bright);
font-size: 0.85rem;
font-weight: 600;
text-transform: capitalize;
margin-bottom: 0.3rem;
}
.card-body p { margin: 0.5rem 0; }
.card-body a { color: var(--accent-bright); }
.card-body code {
background: #0d1210;
border: 1px solid var(--border);
border-radius: 4px;
padding: 0.05rem 0.35rem;
font-size: 0.85em;
}
/* Commit-Tabelle */
.table-wrap { overflow-x: auto; }
.commits { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.commits th {
text-align: left;
color: var(--text-dim);
font-weight: 600;
padding: 0.5rem 0.75rem;
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.commits td {
padding: 0.5rem 0.75rem;
border-bottom: 1px solid var(--border);
vertical-align: top;
}
.commits .msg { min-width: 240px; }
.commits .time { white-space: nowrap; color: var(--text-dim); }
.commits a { color: var(--accent-bright); text-decoration: none; }
.commits a:hover { text-decoration: underline; }
.commits code { font-size: 0.85em; }
/* Pagination */
.pager {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
margin-top: 1.5rem;
color: var(--text-dim);
font-size: 0.9rem;
}
/* Footer */
.footer {
border-top: 1px solid var(--border);
color: var(--text-dim);
text-align: center;
padding: 1rem;
font-size: 0.85rem;
}
.footer a { color: var(--accent-bright); text-decoration: none; }