Skip to content

Epic: Web UI (1/4) - Backend API & Docker Compose Setup #53

Closed

Description

@integry

Epic: GitFix Web Management UI

This is the first of four issues to build a comprehensive web UI for GitFix. The goal of this epic is to create a secure, real-time dashboard for monitoring and managing the system.

This Issue (1/4): Backend API & Docker Compose Setup

This task focuses on creating the foundational backend service for the UI and containerizing the entire application stack for easy development and deployment.

High-Level Goal

  • Create a new Express.js server to act as the API for the frontend.
  • Define all the necessary API endpoints to provide data for the dashboard.
  • Create a docker-compose.yml file to run the entire GitFix system (Redis, Daemon, Worker, API) with a single command.

Implementation Steps

  1. Create the Dashboard API Service:
    • Create a new directory: packages/dashboard.
    • Initialize a Node.js project with express.
    • Implement the API endpoints defined in the feature plan:
      • GET /api/status: Provides health status for all system components.
      • GET /api/queue/stats: Returns job counts from BullMQ.
      • GET /api/activity: Fetches the latest events from the Redis activity log.
      • GET /api/metrics: Returns high-level performance metrics.
      • GET /api/task/:taskId/history: Fetches persisted logs for completed tasks.
  2. Create docker-compose.yml:
    • Define services for redis, daemon, worker, and the new dashboard-api.
    • Use the existing Dockerfile.claude and create new simple Dockerfiles for the daemon, worker, and API if necessary.
    • Ensure all services are on the same network and can communicate.
    • Mount volumes for .env configuration and Git storage paths.
  3. Update Worker/Daemon for Heartbeats:
    • Modify daemon.js and worker.js to write a periodic heartbeat to Redis (e.g., redis.set('system:status:daemon', Date.now(), 'EX', 90)). This allows the API to monitor their status.

Activity

  1. integry commented on Sep 12, 2025

    @integry
    OwnerAuthor

    Suggested Implementation: docker-compose.yml

    This Docker Compose file provides a complete, one-command setup for the entire GitFix application, including the new dashboard API.

    Reasoning:

    • Unified Stack: Simplifies development setup immensely. A developer can run docker-compose up to get the entire system running.
    • Service Discovery: Services can communicate with each other using their service names (e.g., redis, dashboard-api).
    • Isolation: Each component runs in its own container, mirroring a production environment.
    # docker-compose.yml
    version: '3.8'
    
    services:
      redis:
        image: redis:alpine
        ports:
          - '6379:6379'
        volumes:
          - redis_data:/data
    
      daemon:
        build:
          context: .
          dockerfile: Dockerfile.node
        command: npm run daemon
        volumes:
          - .:/usr/src/app
          - /tmp/git-processor:/tmp/git-processor
        env_file: .env
        depends_on:
          - redis
    
      worker:
        build:
          context: .
          dockerfile: Dockerfile.node
        command: npm run worker
        volumes:
          - .:/usr/src/app
          - /tmp/git-processor:/tmp/git-processor
          - ~/.claude:/root/.claude # Mount claude credentials
        env_file: .env
        depends_on:
          - redis
    
      dashboard-api:
        build:
          context: .
          dockerfile: Dockerfile.node
        command: node packages/dashboard/server.js # Assuming the server is here
        ports:
          - '4000:4000'
        volumes:
          - .:/usr/src/app
        env_file: .env
        depends_on:
          - redis
    
    volumes:
      redis_data:

    Note: This assumes a generic Dockerfile.node for the Node.js services. A simple one can be created for this purpose.

  2. propr-dev commented on Sep 12, 2025

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude-opus-4-20250514 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Model: claude-opus-4-20250514
    • Branch: ai-fix/53-epic-web-ui-1-4-backend-a-20250913-0020-claude-opus-4-20250514-4b9
    • Base Branch: main
    • Worktree: issue-53-20250913-0020-claude-opus-4-20250514-4b9
  3. added a commit that references this issue on Sep 12, 2025
  4. added a commit that references this issue on Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions