Initial push of Plunk Next

This commit is contained in:
Dries Augustyns
2025-12-01 09:56:56 +01:00
parent 07cea20262
commit ff1876d580
566 changed files with 89036 additions and 28423 deletions
+7
View File
@@ -0,0 +1,7 @@
'use client';
import {defineClientConfig} from 'fumadocs-openapi/ui/client';
export default defineClientConfig({
// Client configuration options
});
+7
View File
@@ -0,0 +1,7 @@
import {createAPIPage} from 'fumadocs-openapi/ui';
import {openapi} from '@/lib/openapi';
import client from './api-page.client';
export const APIPage = createAPIPage(openapi, {
client,
});
+50
View File
@@ -0,0 +1,50 @@
// Simple components that render the base URLs
// Runtime environment configuration
// Reads from window.__ENV__ (set by /__env.js at runtime in Docker)
// Falls back to process.env.NEXT_PUBLIC_* (for development)
'use client';
declare global {
interface Window {
__ENV__?: {
API_URI?: string;
DASHBOARD_URI?: string;
LANDING_URI?: string;
WIKI_URI?: string;
};
}
}
const getRuntimeEnv = (key: keyof NonNullable<typeof window.__ENV__>) => {
// Client-side: read from window.__ENV__
if (typeof window !== 'undefined' && window.__ENV__) {
return window.__ENV__[key];
}
// Server-side: read from process.env (loaded from .env file in standalone mode)
if (typeof window === 'undefined') {
return process.env[key];
}
return undefined;
};
export function ApiUrl({path = ''}: {path?: string}) {
const baseUrl = getRuntimeEnv('API_URI') || process.env.NEXT_PUBLIC_API_URI || 'https://api.useplunk.com';
return (
<code>
{baseUrl}
{path}
</code>
);
}
export function DashboardUrl({path = ''}: {path?: string}) {
const baseUrl =
getRuntimeEnv('DASHBOARD_URI') || process.env.NEXT_PUBLIC_DASHBOARD_URI || 'https://app.useplunk.com';
return (
<code>
{baseUrl}
{path}
</code>
);
}