Skip to content

Phase 1: Modernization Rewrite #102

Description

@Sergo706

Goal: Migrate the legacy Express/Raw-SQL codebase to a high-performance, type-safe stack.

  • Server Migration (Fastify):

    • Replace Express with Fastify to increase throughput and reduce overhead.
    • Integrate fastify-type-provider-zod to leverage existing Zod schemas for automatic serialization and Swagger documentation generation.
  • Database Layer (Drizzle ORM):

    • Migrate from Raw SQL/Knex to Drizzle ORM.
    • Action: Define strict schemas for all existing tables (users, refresh_tokens,
      visitors).
    • Action: Implement the missing security tables required for the TORT flow:
      - totp_secrets (for RFC 6238 secrets).
      - recovery_codes (hashed storage for emergency access).
  • Bundling Strategy:

  • Implement tsup for building the service into a lightweight, tree-shakable Node.js
    executable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions