Initial commit: MOPC platform with Docker deployment setup
Full Next.js 15 platform with tRPC, Prisma, PostgreSQL, NextAuth. Includes production Dockerfile (multi-stage, port 7600), docker-compose with registry-based image pull, Gitea Actions CI workflow, nginx config for portal.monaco-opc.com, deployment scripts, and DEPLOYMENT.md guide. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
53
src/app/(auth)/layout.tsx
Normal file
53
src/app/(auth)/layout.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import { redirect } from 'next/navigation'
|
||||
import Image from 'next/image'
|
||||
import { auth } from '@/lib/auth'
|
||||
|
||||
export default async function AuthLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const session = await auth()
|
||||
|
||||
// Redirect logged-in users to their dashboard
|
||||
if (session?.user) {
|
||||
const role = session.user.role
|
||||
if (role === 'SUPER_ADMIN' || role === 'PROGRAM_ADMIN') {
|
||||
redirect('/admin')
|
||||
} else if (role === 'JURY_MEMBER') {
|
||||
redirect('/jury')
|
||||
} else if (role === 'OBSERVER') {
|
||||
redirect('/observer')
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
{/* Simple header with logo */}
|
||||
<header className="border-b bg-card">
|
||||
<div className="container-app py-4">
|
||||
<Image
|
||||
src="/images/MOPC-blue-long.png"
|
||||
alt="MOPC - Monaco Ocean Protection Challenge"
|
||||
width={160}
|
||||
height={50}
|
||||
className="h-12 w-auto"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{/* Main content */}
|
||||
<main className="flex-1 flex items-center justify-center p-4">
|
||||
{children}
|
||||
</main>
|
||||
|
||||
{/* Simple footer */}
|
||||
<footer className="border-t bg-card py-4">
|
||||
<div className="container-app text-center text-sm text-muted-foreground">
|
||||
© {new Date().getFullYear()} Monaco Ocean Protection Challenge
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user