Initial commit: Port Nimara CRM (Layers 0-4)
Some checks failed
Build & Push Docker Images / build-and-push (push) Has been cancelled
Build & Push Docker Images / deploy (push) Has been cancelled
Build & Push Docker Images / lint (push) Has been cancelled

Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 11:52:51 +01:00
commit 67d7e6e3d5
572 changed files with 86496 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { NextResponse } from 'next/server';
import { withAuth } from '@/lib/api/helpers';
import { errorResponse, NotFoundError } from '@/lib/errors';
import * as notificationsService from '@/lib/services/notifications.service';
export const PATCH = withAuth(async (_req, ctx, params) => {
try {
const { notificationId } = params;
if (!notificationId) throw new NotFoundError('Notification');
await notificationsService.markRead(notificationId, ctx.userId);
return NextResponse.json({ success: true });
} catch (error) {
return errorResponse(error);
}
});

View File

@@ -0,0 +1,26 @@
import { NextResponse } from 'next/server';
import { withAuth } from '@/lib/api/helpers';
import { parseBody } from '@/lib/api/route-helpers';
import { errorResponse } from '@/lib/errors';
import { updatePreferencesSchema } from '@/lib/validators/notifications';
import * as notificationsService from '@/lib/services/notifications.service';
export const GET = withAuth(async (_req, ctx) => {
try {
const prefs = await notificationsService.getPreferences(ctx.userId, ctx.portId);
return NextResponse.json({ data: prefs });
} catch (error) {
return errorResponse(error);
}
});
export const PUT = withAuth(async (req, ctx) => {
try {
const body = await parseBody(req, updatePreferencesSchema);
const prefs = await notificationsService.updatePreferences(ctx.userId, ctx.portId, body);
return NextResponse.json({ data: prefs });
} catch (error) {
return errorResponse(error);
}
});

View File

@@ -0,0 +1,14 @@
import { NextResponse } from 'next/server';
import { withAuth } from '@/lib/api/helpers';
import { errorResponse } from '@/lib/errors';
import * as notificationsService from '@/lib/services/notifications.service';
export const POST = withAuth(async (_req, ctx) => {
try {
await notificationsService.markAllRead(ctx.userId, ctx.portId);
return NextResponse.json({ success: true });
} catch (error) {
return errorResponse(error);
}
});

View File

@@ -0,0 +1,17 @@
import { NextResponse } from 'next/server';
import { withAuth } from '@/lib/api/helpers';
import { parseQuery } from '@/lib/api/route-helpers';
import { errorResponse } from '@/lib/errors';
import { listNotificationsSchema } from '@/lib/validators/notifications';
import * as notificationsService from '@/lib/services/notifications.service';
export const GET = withAuth(async (req, ctx) => {
try {
const query = parseQuery(req, listNotificationsSchema);
const result = await notificationsService.listNotifications(ctx.userId, ctx.portId, query);
return NextResponse.json(result);
} catch (error) {
return errorResponse(error);
}
});

View File

@@ -0,0 +1,14 @@
import { NextResponse } from 'next/server';
import { withAuth } from '@/lib/api/helpers';
import { errorResponse } from '@/lib/errors';
import * as notificationsService from '@/lib/services/notifications.service';
export const GET = withAuth(async (_req, ctx) => {
try {
const result = await notificationsService.getUnreadCount(ctx.userId, ctx.portId);
return NextResponse.json(result);
} catch (error) {
return errorResponse(error);
}
});