feat: add dark mode UI and SQLite as alternate database backend
Release Please / release-please (push) Has been cancelled
Docker Build and Push (Development) / build-and-push-dev (push) Has been cancelled

Dark mode: CSS custom properties + .dark class toggled via Redux/localStorage,
with a theme toggle in the Header and Settings page. Foundation didn't exist
yet despite prior assumption, so it was built from scratch.

SQLite: new DB_ENGINE=mongo|sqlite env var selects the metadata backend at
runtime (Mongo stays default, no behavior change unless opted in). File/thumbnail
bytes continue to use the existing fs/S3 storage path. Implemented via a shared
DB interface (dbTypes.ts) with parallel mongoDB/ and sqliteDB/ implementations,
selected through dbFactory.ts, with JWT/encryption logic extracted into
userCrypto.ts so both engines share it.
This commit is contained in:
2026-07-05 04:18:33 -07:00
parent bae5dbbd53
commit ecc340e7b1
74 changed files with 2233 additions and 487 deletions
+6 -11
View File
@@ -1,17 +1,12 @@
import User, { UserInterface } from "../models/user-model";
import mongoose from "mongoose";
import { Request, Response, NextFunction } from "express";
import { Response } from "express";
import NotFoundError from "./NotFoundError";
import { createLoginCookie } from "../cookies/create-cookies";
import { getUserDB } from "../db/dbFactory";
// interface RequestType extends Request {
// user?: userAccessType,
// token?: string,
// encryptedToken?: string,
// }
const userDB = getUserDB();
type userAccessType = {
_id: mongoose.Types.ObjectId;
_id: any;
emailVerified: boolean;
email: string;
botChecked: boolean;
@@ -19,10 +14,10 @@ type userAccessType = {
const userUpdateCheck = async (
res: Response,
id: mongoose.Types.ObjectId,
id: string,
uuid: string | undefined
) => {
const updatedUser = await User.findById(id);
const updatedUser = await userDB.getUserInfo(id);
if (!updatedUser) throw new NotFoundError("Cannot find updated user auth");