Skip to content

Phase 2: Migrate core infrastructure (DB, session, server, API) to TypeScript #2

Description

@jessefreeman

Scope:
Convert foundational backend CoffeeScript modules to TypeScript: database layer, session management, main server bootstrap, and API layer.

Priority Order:

  1. server/db/*.coffee
  2. server/session/*.coffee
  3. server/server.coffee & server/webapp.coffee
  4. server/api.coffee

Key Actions per file:

  • Copy existing compiled .js → .ts
  • Introduce interfaces/types for data models and records
  • Replace var with const/let, remove CoffeeScript IIFE/binding patterns
  • Add explicit return types and error handling
  • Remove .coffee version after verification

Acceptance Criteria:

  • All targeted core files exist as .ts with no TypeScript errors
  • Unit / smoke tests pass for startup & one sample API call
  • CoffeeScript originals removed for migrated subset

Deliverables:

  • Type definitions for DB records & session objects
  • Updated build script using tsc (no coffee step) for these modules

Risks:

  • Implicit dynamic structures → mitigate with incremental typing (any → interfaces)
  • Circular dependencies revealed by ES module resolution

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions