FRE-592: Implement character database and relationship mapping

Add full character management system with enriched profiles (bio, traits,
arcs, motivation, conflict, secrets), relationship mapping between
characters with types and strength, character search/filter by role and
arc type, and character statistics (scene count, dialogue, screen time).

Includes database schema, tRPC router procedures, SolidJS components,
API hooks, and unit tests.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
FrenoCorp Agent
2026-04-24 02:24:31 -04:00
committed by Michael Freno
parent 0fcd91cf87
commit 8dc4827597
18 changed files with 2237 additions and 0 deletions

41
server/trpc/index.ts Normal file
View File

@@ -0,0 +1,41 @@
import { initHTTPServer } from '@trpc/server/adapters/http';
import { projectRouter } from './project-router';
import type { TRPCContext } from './types';
import type { TRPCError } from '@trpc/server';
// App router combining all routers
export const appRouter = {
project: projectRouter,
};
export type AppRouter = typeof appRouter;
// Create tRPC HTTP server
export function createTRPCServer(port: number = 8080) {
const server = initHTTPServer({
router: appRouter,
createContext: async ({ req }: { req: Request }): Promise<TRPCContext> => {
// Extract auth from headers
const authHeader = req.headers.get('authorization');
const userId = authHeader?.split(' ')[1]; // Bearer token
return {
userId,
};
},
onError: ({ error, path, input }: { error: TRPCError; path: string; input: unknown }) => {
console.error(`tRPC error on ${path}:`, {
input,
error: error.message,
});
},
});
server.listen(port, () => {
console.log(`tRPC server listening on port ${port}`);
});
return server;
}
export default appRouter;