diff --git a/.phase7-state.json b/.phase7-state.json index 55e8bb7..404f450 100644 --- a/.phase7-state.json +++ b/.phase7-state.json @@ -1,11 +1,12 @@ { "completed_features": [], - "current_feature": "api-client-phase7", + "current_feature": "router-phase7", "started_at": "2026-05-23T05:40:09.997191", "attempted_features": [ "documents-upload", "search-everywhere", "email-notification-stub", - "mobile-responsive-polish" + "mobile-responsive-polish", + "api-client-phase7" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index a0b4591..416fb57 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -846,3 +846,24 @@ src/routes/documents.ts(36,25): error TS2339: Property 'size' does not exist on src/routes/documents.ts(46,32): error TS2339: Property 'file' does not exist on type 'FastifyRequest>'. src/routes/documents.ts(56,9): error TS2769: No overload matches this call. Overload 1 of 2, '(value: { filename: string | SQL | Placeholder; contentType: string | SQL | Placeholder; sizeBytes: number | SQL<...> | Placeholder<...>; id?: string | ... 2 more ... | undefined; createdAt?: SQL<...> | ... 2 more ... | undefined; userId?: string | ... 3 more ... | undefined; c +- `05:45:00` **INFO** Committed feature api-client-phase7 +- `05:45:00` **INFO** Pushed: rc=0 + +## Phase-3 Feature: router-phase7 (2026-05-23 05:45:00) + +- `05:45:00` **INFO** Description: App + routes/index für phase7 Routes +- `05:45:00` **INFO** Generating apps/api/src/routes/index.ts (ERWEITERT — behalte alle. Füge documentsRoutes ('/api/documents'), sea…) +- `05:45:08` **INFO** wrote 1010 chars in 8.1s (attempt 1) +- `05:45:08` **INFO** Generating apps/api/src/index.ts (ERWEITERT — behalte alles. Registriere @fastify/multipart Plugin: `awa…) +- `05:45:18` **INFO** wrote 963 chars in 9.7s (attempt 1) +- `05:45:18` **INFO** Generating apps/web/src/App.tsx (ERWEITERT — füge /documents (Documents Page) Route hinzu. Auth-Check.…) +- `05:45:52` **INFO** wrote 4100 chars in 34.6s (attempt 1) +- `05:45:52` **INFO** Running tsc --noEmit on api… +- `05:45:54` **WARN** tsc errors: +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'. + Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 17c5337..9e3c488 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -24,6 +24,10 @@ async function start() { cookie: { cookieName: "token", signed: false } }) + await server.register(import('@fastify/multipart').then(m => m.default), { + limits: { fileSize: 20 * 1024 * 1024 } + }) + server.get("/health", async () => { return { status: "ok" } }) diff --git a/apps/api/src/routes/index.ts b/apps/api/src/routes/index.ts index c51c2a2..63b5b22 100644 --- a/apps/api/src/routes/index.ts +++ b/apps/api/src/routes/index.ts @@ -6,6 +6,8 @@ import timeEntryRoutes from "./time-entries" import userRoutes from "./users" import settingsRoutes from "./settings" import auditLogRoutes from "./audit-log" +import documentsRoutes from "./documents" +import searchRoutes from "./search" export async function setupRoutes(server: FastifyInstance) { server.register(authRoutes, { prefix: "/api/auth" }) @@ -15,4 +17,6 @@ export async function setupRoutes(server: FastifyInstance) { server.register(userRoutes, { prefix: "/api/users" }) server.register(settingsRoutes, { prefix: "/api/settings" }) server.register(auditLogRoutes, { prefix: "/api/audit-log" }) + server.register(documentsRoutes, { prefix: "/api/documents" }) + server.register(searchRoutes, { prefix: "/api/search" }) } \ No newline at end of file diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index f7a6d3c..b28cbe7 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -11,6 +11,7 @@ import AdminUsers from "./pages/AdminUsers" import Settings from "./pages/Settings" import Calendar from "./pages/Calendar" import AuditLog from "./pages/AuditLog" +import Documents from "./pages/Documents" import Nav from "./components/Nav" import CommandPalette from "./components/CommandPalette" import { ToastProvider } from "./components/Toast" @@ -108,6 +109,13 @@ const projectDetailRoute = createRoute({ component: ProjectDetail }) +const documentsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: "/documents", + beforeLoad: authCheck, + component: Documents +}) + const profileRoute = createRoute({ getParentRoute: () => rootRoute, path: "/profile", @@ -145,6 +153,7 @@ const routeTree = rootRoute.addChildren([ customerDetailRoute, projectsRoute, projectDetailRoute, + documentsRoute, profileRoute, adminRoute, auditLogRoute,