feat: auth middleware, brain data layer, Valkey queue (P1-002/003/004) (#71)

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #71.
This commit is contained in:
2026-03-13 02:37:56 +00:00
committed by jason.woltje
parent cbac5902db
commit 38897fe423
20 changed files with 2043 additions and 4290 deletions

View File

@@ -0,0 +1,26 @@
import { Global, Module } from '@nestjs/common';
import { createAuth, type Auth } from '@mosaic/auth';
import type { Db } from '@mosaic/db';
import { DB } from '../database/database.module.js';
import { AuthController } from './auth.controller.js';
export const AUTH = 'AUTH';
@Global()
@Module({
providers: [
{
provide: AUTH,
useFactory: (db: Db): Auth =>
createAuth({
db,
baseURL: process.env['BETTER_AUTH_URL'] ?? 'http://localhost:4000',
secret: process.env['BETTER_AUTH_SECRET'],
}),
inject: [DB],
},
],
controllers: [AuthController],
exports: [AUTH],
})
export class AuthModule {}