Add developer API, Prometheus metrics, and community links

This commit is contained in:
2026-10-12 19:59:37 +05:00
parent 3cc3136762
commit 018be5049e
50 changed files with 4087 additions and 31 deletions

225
app/dev/api/page.module.css Normal file
View File

@@ -0,0 +1,225 @@
.intro {
max-width: 780px;
}
.tabs {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin: 24px 0 36px;
}
.stack {
display: grid;
gap: 32px;
}
.panel {
padding: clamp(20px, 4vw, 32px);
border: 1px solid var(--line);
border-radius: 18px;
background: var(--panel);
min-width: 0;
}
.panel h2 {
font-size: clamp(24px, 3vw, 32px);
}
.heading {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 18px;
}
.heading h2 {
margin: 0;
}
.fields {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(140px, 200px);
gap: 20px;
}
.fieldset {
border: 0;
padding: 0;
margin: 24px 0;
min-width: 0;
}
.fieldset legend {
font-weight: 700;
margin-bottom: 12px;
}
.scopes {
display: grid;
gap: 12px;
}
.scope {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
border: 1px solid var(--line);
border-radius: 10px;
}
.scope input {
margin-top: 5px;
width: 18px;
height: 18px;
flex: 0 0 18px;
accent-color: var(--green);
}
.scope strong,
.scope small {
display: block;
}
.scope small {
color: var(--muted);
line-height: 1.6;
}
.actions {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin: 20px 0 0;
}
.token {
margin-bottom: 24px;
padding: 20px;
border: 1px solid var(--green);
border-radius: 12px;
background: var(--panel2);
}
.token input {
width: 100%;
font-family: monospace;
font-size: 13px;
}
.keyList {
display: grid;
gap: 16px;
padding: 0;
list-style: none;
margin: 24px 0 0;
}
.key {
border: 1px solid var(--line);
border-radius: 12px;
padding: 20px;
min-width: 0;
}
.key h3 {
overflow-wrap: anywhere;
margin: 0;
font-size: 20px;
}
.key dl {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 6px 18px;
margin: 16px 0;
}
.key dt {
color: var(--muted);
}
.key dd {
margin: 0;
overflow-wrap: anywhere;
}
.key code {
overflow-wrap: anywhere;
}
.notice {
padding: 14px 18px;
border-left: 3px solid var(--green);
background: var(--panel2);
margin: 20px 0;
}
.error {
color: var(--text);
border-left-color: #ed7878;
}
.docs {
scroll-margin-top: 120px;
}
.docs h3 {
margin-top: 32px;
}
.docs p,
.docs li {
line-height: 1.8;
}
.docs ul,
.docs ol {
padding-left: 24px;
}
.docs ul {
list-style: disc;
}
.docs ol {
list-style: decimal;
}
.docs a {
color: var(--green);
text-decoration: underline;
text-underline-offset: 3px;
}
.docs code {
overflow-wrap: anywhere;
font-family: monospace;
}
.code {
overflow-x: auto;
padding: 20px;
border-radius: 10px;
border: 1px solid var(--line);
background: var(--bg);
font-family: monospace;
font-size: 13px;
line-height: 1.7;
max-width: 100%;
}
.code code {
overflow-wrap: normal;
}
.tableWrap {
overflow-x: auto;
max-width: 100%;
}
.table {
width: 100%;
border-collapse: collapse;
text-align: left;
}
.table th,
.table td {
padding: 14px 16px;
border-bottom: 1px solid var(--line);
vertical-align: top;
}
.table th {
color: var(--muted);
}
.table td:first-child {
min-width: 150px;
}
.table td:last-child {
min-width: 200px;
}
@media (max-width: 600px) {
.fields {
grid-template-columns: minmax(0, 1fr);
}
.key dl {
grid-template-columns: minmax(0, 1fr);
gap: 2px;
}
.key dd {
margin-bottom: 10px;
}
.code {
padding: 14px;
font-size: 12px;
}
.table th,
.table td {
padding: 12px;
}
}

23
app/dev/api/page.tsx Normal file
View File

@@ -0,0 +1,23 @@
import type { Metadata } from "next";
import { Header, Footer } from "@/components/Shell";
import { DeveloperPanel } from "@/components/DeveloperPanel";
import { user } from "@/lib/supabase";
export const metadata: Metadata = {
title: "Developer API",
description: "Create and manage scoped MineGeo API keys.",
};
export const dynamic = "force-dynamic";
export default async function DeveloperApiPage() {
const account = await user();
return (
<>
<Header />
<main className="section page-content">
<DeveloperPanel signedIn={Boolean(account)} />
</main>
<Footer />
</>
);
}