import { json } from "@remix-run/node"; import type { LoaderFunctionArgs } from "@remix-run/node"; import { useLoaderData, Link } from "@remix-run/react"; export async function loader({ request }: LoaderFunctionArgs) { // Check environment variables const envCheck = { GITHUB_APP_ID: { value: process.env.GITHUB_APP_ID || null, required: true, example: "your-app-id", }, GITHUB_APP_NAME: { value: process.env.GITHUB_APP_NAME || null, required: true, example: "your-app-name", }, GITHUB_APP_PRIVATE_KEY: { value: process.env.GITHUB_APP_PRIVATE_KEY ? "✓ Set" : null, required: true, example: "-----BEGIN RSA PRIVATE KEY-----...", }, GITHUB_APP_CLIENT_ID: { value: process.env.GITHUB_APP_CLIENT_ID || null, required: true, example: "your-client-id", }, GITHUB_APP_CLIENT_SECRET: { value: process.env.GITHUB_APP_CLIENT_SECRET ? "✓ Set" : null, required: true, example: "your-client-secret", }, GITHUB_WEBHOOK_SECRET: { value: process.env.GITHUB_WEBHOOK_SECRET ? "✓ Set" : null, required: false, example: "your-webhook-secret", }, GITHUB_CALLBACK_URL: { value: process.env.GITHUB_CALLBACK_URL || null, required: true, example: "http://localhost:3000/auth/github/callback", }, SESSION_SECRET: { value: process.env.SESSION_SECRET ? "✓ Set" : null, required: true, example: "your-session-secret", }, }; const missing = Object.entries(envCheck).filter( ([key, config]) => config.required && !config.value ); const isReady = missing.length === 0; return json({ envCheck, missing, isReady, nodeEnv: process.env.NODE_ENV || "development", }); } export default function Status() { const { envCheck, missing, isReady, nodeEnv } = useLoaderData(); return (

Environment Status

← Back to Home
{/* Status Overview */}
{isReady ? ( ) : ( )}

{isReady ? '✅ Ready to go!' : '⚠️ Configuration needed'}

{isReady ? (

All required environment variables are configured.

) : (

{missing.length} required environment variable{missing.length > 1 ? 's' : ''} missing.

)}
{/* Environment Variables Table */}

Environment Variables

{Object.entries(envCheck).map(([key, config]) => ( ))}
Variable Status Required Example
{key} {config.value ? ( {config.value} ) : ( Not set )} {config.required ? '✅ Yes' : '⚪ Optional'} {config.example}
{/* Missing Variables */} {missing.length > 0 && (

Missing Configuration

Add these to your .env file:

{missing.map(([key, config]) => (
{key}={config.example}
))}
)} {/* Quick Actions */}

Quick Actions

Generate Secrets

Generate random secrets for SESSION_SECRET and GITHUB_WEBHOOK_SECRET:

npm run secrets

Environment

Current environment: {nodeEnv}

{nodeEnv === 'development' ? ( <>✅ Development mode - using .env file ) : ( <>🚀 Production mode - using system environment )}

); }