mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 20:17:43 +02:00
refactor(infra): remove zitare + clock NestJS backends, add shared-hono package
Both apps are fully local-first via Dexie.js + mana-sync. Their NestJS backends were pure CRUD wrappers (20 + 31 source files) that are no longer needed. Changes: - Add packages/shared-hono: JWT auth via JWKS (jose), Drizzle DB factory, health route, generic GDPR admin handler, error middleware - Migrate zitare lists page from fetch() to listsStore (local-first) - Rewrite clock timers store from API-based to timerCollection (Dexie) - Update clock +layout.svelte CommandBar search to use local collections - Remove zitare-backend + clock-backend from docker-compose, CI/CD, Prometheus, env generation, setup scripts - Add docs/TECHNOLOGY_AUDIT_2026_03.md with full repo analysis Net result: -2 Docker containers, -2 ports, -2728 lines of code Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
82de69476f
commit
32939fbfb5
81 changed files with 1236 additions and 2727 deletions
41
packages/shared-hono/src/index.ts
Normal file
41
packages/shared-hono/src/index.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* @manacore/shared-hono — Shared infrastructure for Hono + Bun compute servers.
|
||||
*
|
||||
* Replaces NestJS boilerplate (Module, Controller, Guard, HealthModule, MetricsModule)
|
||||
* with lightweight Hono equivalents.
|
||||
*
|
||||
* Usage:
|
||||
* ```ts
|
||||
* import { Hono } from 'hono';
|
||||
* import { cors } from 'hono/cors';
|
||||
* import { logger } from 'hono/logger';
|
||||
* import { authMiddleware, serviceAuthMiddleware } from '@manacore/shared-hono/auth';
|
||||
* import { createDb } from '@manacore/shared-hono/db';
|
||||
* import { healthRoute } from '@manacore/shared-hono/health';
|
||||
* import { adminRoutes } from '@manacore/shared-hono/admin';
|
||||
* import { errorHandler, notFoundHandler } from '@manacore/shared-hono/error';
|
||||
*
|
||||
* const app = new Hono();
|
||||
* app.onError(errorHandler);
|
||||
* app.notFound(notFoundHandler);
|
||||
* app.use('*', logger());
|
||||
* app.use('*', cors({ origin: process.env.CORS_ORIGINS?.split(',') ?? ['http://localhost:5173'] }));
|
||||
*
|
||||
* app.route('/health', healthRoute('my-server'));
|
||||
* app.use('/api/*', authMiddleware());
|
||||
* app.route('/api/v1/admin', adminRoutes(db, userTables));
|
||||
*
|
||||
* // App-specific compute routes
|
||||
* app.route('/api/v1/compute', myRoutes);
|
||||
*
|
||||
* export default { port: Number(process.env.PORT ?? 3019), fetch: app.fetch };
|
||||
* ```
|
||||
*/
|
||||
|
||||
export { authMiddleware, serviceAuthMiddleware } from './auth';
|
||||
export { createDb } from './db';
|
||||
export type { DbOptions } from './db';
|
||||
export { healthRoute } from './health';
|
||||
export { adminRoutes } from './admin';
|
||||
export { errorHandler, notFoundHandler } from './error';
|
||||
export type { CurrentUserData, AuthVariables } from './types';
|
||||
Loading…
Add table
Add a link
Reference in a new issue