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:
2026-01-30 13:41:32 +01:00
commit a606292aaa
290 changed files with 70691 additions and 0 deletions

6
src/lib/trpc/client.ts Normal file
View File

@@ -0,0 +1,6 @@
'use client'
import { createTRPCReact } from '@trpc/react-query'
import type { AppRouter } from '@/server/routers/_app'
export const trpc = createTRPCReact<AppRouter>()

20
src/lib/trpc/server.ts Normal file
View File

@@ -0,0 +1,20 @@
import 'server-only'
import { cache } from 'react'
import { createCallerFactory } from '@/server/trpc'
import { createContext } from '@/server/context'
import { appRouter } from '@/server/routers/_app'
/**
* Create a server-side tRPC caller that can be used in Server Components
*/
const createCaller = createCallerFactory(appRouter)
/**
* Cached tRPC caller for use in Server Components
* Uses React's cache() to deduplicate context creation
*/
export const api = cache(async () => {
const context = await createContext()
return createCaller(context)
})