flowra

module
v0.0.0-...-c7d4cb4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT

README ΒΆ

Flowra

A comprehensive chat system with integrated task tracker, help desk functionality, and team support.

πŸ“Š Current Project Status

Version: 1.0.0-beta Last Updated: 2026-03-05 Overall Progress: ~98% to MVP Status: March 2026 Release Candidate

Progress by Layer
Layer Status Progress Files Coverage
Domain βœ… Complete 100% 48 90%+
Application βœ… Complete 100% 139 85%+
Infrastructure βœ… Complete 100% 50 85%+
Handlers βœ… Complete 100% 28 80%+
Middleware βœ… Complete 100% 14 80%+
Services βœ… Complete 100% 13 80%+
Frontend πŸ”„ Mostly Complete 85% ~70 -
Entry Points βœ… Complete 100% 6 75%+
What Works βœ…
  • βœ… Domain Layer: 6 Event-Sourced aggregates, 30+ domain events
  • βœ… Application Layer: 40+ use cases with 85% average coverage
  • βœ… MongoDB Repositories: All 6 repositories with integration tests
  • βœ… Event Store: MongoDB Event Store with optimistic locking
  • βœ… Event Bus: Redis pub/sub for cross-service events
  • βœ… HTTP Handlers: Full REST API with 40+ endpoints
  • βœ… WebSocket: Real-time communication with Hub pattern
  • βœ… Middleware: Auth, CORS, Logging, Recovery, Rate Limiting, Workspace Access
  • βœ… Services: Workspace Access Checker, Chat, Member, Auth services
  • βœ… Keycloak Integration: Full SSO integration (JWT, OAuth, User Sync)
  • βœ… Entry Points: API server, Worker (with User Sync)
  • βœ… E2E Tests: Full coverage of critical flows
  • βœ… API Documentation: OpenAPI 3.1, Postman collection
  • βœ… Tag System Frontend: Human-readable messages, visual grouping, sidebar integration
  • βœ… Tag Processing Test Coverage: Concurrent integration tests + bot-response E2E scenarios
  • βœ… Tag System Load Testing: k6 script/profiles for tag-heavy message flows (tests/load/tag-system)
  • βœ… Landing Page: Redesigned with distinctive typography, scroll animations, responsive feature grid
  • βœ… Chat=SoT Stabilization: projection-safe typed mutations, strict assignee validation, frontend smoke regression coverage
In Development πŸ”„
  • πŸ”„ Frontend: HTMX + Pico CSS (~85% complete β€” all core features, settings, enhancements, dark mode, search, file uploads done)

πŸš€ Quick Start (5 minutes)

Prerequisites
  • Go 1.26+
  • Docker & Docker Compose
  • Make
1. Clone & Setup
git clone https://github.com/lllypuk/flowra.git
cd flowra
make deps
2. Start Full-Stack Runtime
# Starts infra (MongoDB, Redis, Keycloak) + worker + API
make dev
3. Verify
# Health check
curl http://localhost:8080/health
# Expected: {"status":"healthy"}

# API documentation
# Linux
xdg-open http://localhost:8080/docs

# macOS
open http://localhost:8080/docs
4. Test Authentication

Access Keycloak at http://localhost:8090 (admin/admin123) to configure OAuth.

Test user for app login: testuser / test123.


πŸ”§ Development Commands

make help               # Show all available commands
make dev                # Run full-stack development mode (infra + worker + API)
make dev-lite           # Run API-only development mode (limited: no worker)
make build              # Build binaries
make test               # Run all tests
make test-unit          # Run unit tests only
make test-integration   # Run integration tests (Docker/testcontainers)
make test-e2e           # Run E2E API tests
make test-e2e-frontend  # Run frontend browser E2E tests (requires running server)
make test-e2e-frontend-smoke # Run focused board+sidebar smoke regression
make test-load-tags     # Run k6 tag-system load test (requires k6 + AUTH_TOKEN)
make lint               # Run linter and format code
make docker-up          # Start Docker services
make docker-down        # Stop Docker services
make docker-build       # Build production image (flowra:latest)
make docker-prod-up     # Start self-hosted production compose stack
make docker-prod-logs   # Tail production compose logs
make docker-prod-down   # Stop production compose stack
make test-coverage      # Generate coverage report
make playwright-install # Install Playwright browsers for frontend tests
make reset-data         # Reset local/dev Chat=SoT data collections and recreate indexes

Runtime mode toggles for ./bin/api:

  • FLOWRA_WORKER=true enables unified API + worker loops in the API process.
  • FLOWRA_WORKER=false runs API-only mode.
  • --with-worker / --with-worker=false CLI flag overrides FLOWRA_WORKER.

When switching between branches around the Chat=SoT refactor, run: make docker-up && make reset-data before make dev to avoid stale event/read-model shape mismatches.


πŸ—οΈ Key Features

  • Real-time chat with group and direct message support
  • Command system for managing tasks directly from chat
  • Task management with state machine for statuses
  • Help Desk functionality with SLA tracking
  • Keycloak integration for SSO and user management
  • HTMX + vanilla JS modules for dynamic UI behavior
  • WebSocket for real-time updates
  • Event Sourcing for complete change history
  • Tag Processing - command processing system via message tags
  • Human-readable system messages - "John changed status to In Progress" format
  • Real-time UI updates - sidebar actions create visible system messages in chat

🎯 Domain Models

Chat Aggregate
  • Types: Direct message, Group chat, Help Desk ticket
  • Operations: Create, AddParticipant, RemoveParticipant, Rename, SetSeverity, SetPriority
Message Aggregate
  • Capabilities: Content, attachments, reactions, threading
  • Operations: Create, Edit, Delete, AddAttachment, AddReaction
Typed Entities (Chat = SoT)
  • Types: Task, Bug, Epic (as typed chat variants)
  • State Ownership: status/priority/assignee/due date are written through Chat commands
  • Events: business writes emit chat.* events only
Notification Aggregate
  • Types: Task, Chat, Mention, System
  • Operations: Create, MarkAsRead, MarkAllAsRead, Delete
User & Workspace Entities
  • User: Registration, Profile updates, Admin promotion
  • Workspace: Create, Update, Member management

πŸ“‹ Documentation

API Documentation
Guides
Architecture & Design

πŸ›  Technology Stack

Backend
Technology Purpose Version
Go Primary language 1.26+
Echo HTTP framework v4
gorilla/websocket WebSocket Latest
MongoDB Primary database 6+
Redis Cache/Pub-Sub 7+
Keycloak Authentication 23+
Frontend
Technology Purpose Version
HTMX Dynamic updates 2+
Pico CSS Styling v2
Vanilla JS (ES Modules) Client interactions Built-in

πŸ“ Project Structure

.
β”œβ”€β”€ cmd/                        # Application entry points
β”‚   β”œβ”€β”€ api/                   # HTTP API server (main, container, routes)
β”‚   └── worker/                # Background worker (user sync)
β”‚
β”œβ”€β”€ internal/                  # Private application code (296 files)
β”‚   β”œβ”€β”€ application/           # Use cases (139 files, 40+ use cases)
β”‚   β”‚   β”œβ”€β”€ appcore/          # Shared interfaces
β”‚   β”‚   β”œβ”€β”€ chat/             # Chat use cases
β”‚   β”‚   β”œβ”€β”€ message/          # Message use cases
β”‚   β”‚   β”œβ”€β”€ task/             # Task use cases
β”‚   β”‚   β”œβ”€β”€ notification/     # Notification use cases
β”‚   β”‚   β”œβ”€β”€ workspace/        # Workspace use cases
β”‚   β”‚   └── user/             # User use cases
β”‚   β”œβ”€β”€ domain/               # Domain models (48 files, 6 aggregates)
β”‚   β”‚   β”œβ”€β”€ chat/             # Chat aggregate
β”‚   β”‚   β”œβ”€β”€ message/          # Message aggregate
β”‚   β”‚   β”œβ”€β”€ task/             # Shared task entity state/event contracts (query-side support)
β”‚   β”‚   β”œβ”€β”€ user/             # User aggregate
β”‚   β”‚   β”œβ”€β”€ workspace/        # Workspace aggregate
β”‚   β”‚   β”œβ”€β”€ notification/     # Notification aggregate
β”‚   β”‚   └── tag/              # Tag/command system
β”‚   β”œβ”€β”€ infrastructure/        # External dependencies (50 files)
β”‚   β”‚   β”œβ”€β”€ repository/       # MongoDB repositories
β”‚   β”‚   β”œβ”€β”€ eventstore/       # Event store
β”‚   β”‚   β”œβ”€β”€ eventbus/         # Redis event bus
β”‚   β”‚   β”œβ”€β”€ websocket/        # WebSocket hub
β”‚   β”‚   └── keycloak/         # Keycloak integration
β”‚   β”œβ”€β”€ handler/              # HTTP/WS handlers (28 files)
β”‚   β”œβ”€β”€ middleware/           # HTTP middleware (14 files)
β”‚   └── service/              # Business services (13 files)
β”‚   └── config/               # Configuration
β”‚
β”œβ”€β”€ web/                       # Frontend (~70 files, HTMX + Pico CSS)
β”‚   β”œβ”€β”€ templates/            # HTML templates
β”‚   β”œβ”€β”€ components/           # Reusable components
β”‚   └── static/               # CSS, JS assets
β”‚
β”œβ”€β”€ tests/                     # Test suites
β”‚   β”œβ”€β”€ e2e/                  # End-to-end tests (incl. bot response/tag flow scenarios)
β”‚   β”œβ”€β”€ integration/          # Integration tests (incl. concurrent tag processing)
β”‚   β”œβ”€β”€ load/                 # Manual load tests (k6 scripts and docs)
β”‚   β”œβ”€β”€ testutil/             # Test utilities (shared Mongo/Keycloak containers)
β”‚   └── mocks/                # Mock implementations
β”‚
β”œβ”€β”€ docs/                      # Documentation
β”‚   β”œβ”€β”€ api/                  # API documentation
β”‚   β”œβ”€β”€ deployment/           # Deployment guides
β”‚   └── development/          # Development guides
β”‚
β”œβ”€β”€ configs/                   # Configuration files
└── docker-compose.yml         # Local development services

πŸ” Security

  • Authentication: Keycloak SSO with JWT tokens
  • Authorization: Role-based access control (RBAC)
  • Workspace Access: Access verification middleware
  • Input Validation: Validation at all levels
  • Secure Defaults: Secure default configuration

πŸ§ͺ Testing

# Run all tests
make test

# Run with coverage
make test-coverage

# Run E2E tests
make test-e2e

# Run frontend browser E2E tests
make test-e2e-frontend

# Run focused board+sidebar smoke regression
make test-e2e-frontend-smoke
Test Coverage Targets
Layer Target Current
Domain 90% βœ… 90%+
Application 80% βœ… 85%+
Infrastructure 80% βœ… 85%+
Handlers 75% βœ… 80%+

πŸ“Š Application Access

Service URL Credentials
Web App (SSO) http://localhost:8080 testuser / test123
API Server http://localhost:8080 Bearer JWT token
API Docs http://localhost:8080/docs -
Keycloak http://localhost:8090 admin/admin123
MongoDB localhost:27017 admin/admin123
Redis localhost:6379 -

πŸ“ˆ Roadmap

βœ… Completed (March 2026)
  • Full domain layer with event sourcing (6 aggregates, 30+ events)
  • Complete application layer with use cases (40+ use cases)
  • MongoDB repositories with integration tests (6 repositories)
  • HTTP handlers for all endpoints (40+ REST endpoints)
  • WebSocket real-time communication (Hub pattern)
  • Authentication & authorization middleware (7 middleware components)
  • Keycloak SSO integration (JWT, OAuth, User Sync)
  • Business services (Workspace Access, Chat, Member, Auth)
  • E2E test coverage (all critical flows)
  • API documentation (OpenAPI 3.1, Postman collection)
  • Deployment and development documentation
  • Frontend framework setup (HTMX + Pico CSS)
  • Landing page with distinctive design (Playfair Display + DM Sans, scroll animations)
  • Authentication UI (login, logout, callback)
  • Workspace management UI (CRUD + full admin settings)
  • Chat UI with real-time messaging, typing indicators, tag autocomplete, mention autocomplete, message editing, reactions
  • Board UI with drag-and-drop Kanban, filters, bulk operations, real-time updates
  • Notifications UI with real-time updates, improved UX
  • User profile & settings page
  • Task detail improvements (inline editing, activity timeline)
  • Dark mode toggle UI
  • Workspace-wide global search
  • File uploads (attachments for messages and tasks)
  • Chat=SoT hardening for board/sidebar flows:
    • projection-safe task chat creation and post-action sync
    • unified task action execution path with consistent system messages
    • mandatory assignee existence validation in chat write path
    • startup warning for legacy read-model collections (chat_read_model, task_read_model)
    • HTMX WebSocket close workaround and chat empty-state first-message fix
πŸ”„ In Progress (March 2026)
  • Mobile-responsive polish
  • Remaining frontend edge cases
πŸ”œ Coming (March 2026)
  • Email notifications
  • Performance optimizations
πŸ“… Future
  • Mobile-friendly PWA
  • Slack/Teams integration
  • AI-powered features
  • Analytics dashboard

πŸ“„ License

MIT License - see LICENSE


Last updated: March 5, 2026

Directories ΒΆ

Path Synopsis
cmd
api command
Package main provides the API server entry point.
Package main provides the API server entry point.
tools command
worker command
Package main provides the worker service entry point.
Package main provides the worker service entry point.
internal
application/appcore
Package appcore provides core application interfaces and shared utilities.
Package appcore provides core application interfaces and shared utilities.
config
Package config provides configuration loading and validation for the application.
Package config provides configuration loading and validation for the application.
handler/websocket
Package websocket provides HTTP handlers for WebSocket connections.
Package websocket provides HTTP handlers for WebSocket connections.
infrastructure/eventbus
Package eventbus provides event bus implementations for asynchronous event delivery.
Package eventbus provides event bus implementations for asynchronous event delivery.
infrastructure/filestorage
Package filestorage provides file storage implementations.
Package filestorage provides file storage implementations.
infrastructure/healthcheck
Package healthcheck provides health check implementations for monitoring system consistency.
Package healthcheck provides health check implementations for monitoring system consistency.
infrastructure/httpserver
Package httpserver provides HTTP server infrastructure components.
Package httpserver provides HTTP server infrastructure components.
infrastructure/mongodb
Package mongodb provides MongoDB infrastructure components including index management.
Package mongodb provides MongoDB infrastructure components including index management.
infrastructure/outbox
Package outbox provides the transactional outbox pattern implementation.
Package outbox provides the transactional outbox pattern implementation.
infrastructure/websocket
Package websocket provides WebSocket server implementation for real-time updates.
Package websocket provides WebSocket server implementation for real-time updates.
service
Package service provides business logic services that orchestrate use cases.
Package service provides business logic services that orchestrate use cases.
tests
Package web provides embedded static files and templates for the Flowra frontend.
Package web provides embedded static files and templates for the Flowra frontend.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL