Skip to content
CAI
Software that uses CAICheck a score

thaitype/thaitype-stack-postgresql-template

43.0

Weak · 21 September 2026

8k

lines of production code

TypeScript

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This is a Todo application that manages user authentication and task tracking. It has been refactored from a MongoDB-based architecture to a PostgreSQL database using the Drizzle ORM. The system provides user registration, login, and role-based access, alongside core functionality for creating and managing to-do items.

Features

Initial database schema for authentication and application data

The Drizzle migration introduces the initial PostgreSQL schema, creating tables for authentication (account, session, verification) and application data (user, role, user\_role, todo). All primary keys and foreign keys use the UUID type, and the schema includes constraints such as unique email and token fields.

drizzle · high confidence

Behavioural changes

Improved navigation and UI structure for the Todo App

The application now features a consistent header component (AppHeader) that provides user profile access and logout functionality, replacing the previous ad-hoc header implementations. The main page and login/register pages have been updated to use a unified AppShell layout, improving the overall structure. Additionally, the login and register forms now include direct links to each other and the home page, and the login form supports a 'redirectTo' query parameter for better navigation flow.

src/app · high confidence

Migrated from MongoDB to PostgreSQL with Drizzle ORM

The project's database layer has been refactored from a MongoDB-based architecture to a PostgreSQL-based one using Drizzle ORM. This change updates the configuration files (drizzle.config.ts, docker-compose.yml, .env.example) to support PostgreSQL and the Drizzle Gateway, and updates documentation (CLAUDE.md, README.md) to reflect the new stack, including Docker setup instructions and architecture diagrams.

(repo-wide) · high confidence

Migrated user and todo repositories from MongoDB to Drizzle ORM

The server's data access layer has been refactored to use Drizzle ORM with PostgreSQL, replacing the previous MongoDB implementation. This change introduces new Drizzle schema definitions for users, todos, roles, and authentication tables, alongside corresponding repository implementations (e.g., DrizzleUserRepository, DrizzleRoleRepository) that handle database-specific type conversions and query conditions. The migration includes removing deprecated MongoDB-specific code, such as the base-mongo-repository and related hooks, and adds a database migration script to apply the new schema. Users will experience improved type safety and consistent database interactions across all entities.

src/server · medium confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 43 → 43 (+0.0)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 64 → 68 (+3.4)
  • Architecture 100 → 86 (-13.9)
  • Maturity 65 → 65 (-0.1)
  • Readiness 12 → 13 (+1.4)
  • Security 71 → 80 (+8.9)

Resolved (28)

  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical vulnerability: [GHSA redacted] (pnpm-lock.yaml)
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • …and 8 more

New (72)

  • ClassTooLong: DrizzleUserRepository (src/server/infrastructure/repositories/drizzle-user-repository.ts)
  • Critical CVE: [CVE redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • FunctionTooLong: AddTodoForm.AddTodoForm (src/app/_components/AddTodoForm.tsx)
  • FunctionTooLong: Header.Header (src/components/layout/Header.tsx)
  • FunctionTooLong: RegisterForm.RegisterForm (src/components/auth/RegisterForm.tsx)
  • FunctionTooLong: TodoItem.TodoItem (src/app/_components/TodoItem.tsx)
  • FunctionTooLong: TodoList.TodoList (src/app/_components/TodoList.tsx)
  • FunctionTooLong: page.ProfileContent (src/app/profile/page.tsx)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • …and 52 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

thaitype/thaitype-stack-postgresql-template was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 38d4f1029a797c5adf5b47e30bca313b16ca9e9d — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b84573e22831.