Skip to content

dreamymc/FocusFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

155 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FocusFlow Logo

FocusFlow

A high-performance, multi-tenant team productivity SaaS built with Laravel 11.

Build Status Coverage PHPStan Laravel 11 Vue 3


🚀 Overview

FocusFlow is a modern project management platform designed for teams. It features deep multi-tenancy, real-time collaboration via WebSockets, and a robust API-driven architecture.

It was built as a comprehensive portfolio project demonstrating senior-level Laravel architecture, test-driven development (TDD), and modern SaaS best practices.

🎥 Watch the Demo

(Placeholder for 2-minute Loom Video URL)

🌍 Live Preview

(Placeholder for Production Deployment URL)


✨ Features

  • Multi-Tenant Architecture: Complete data isolation using scoped pivot tables (workspace_user) and dynamic Eloquent Global Scopes.
  • Real-Time Collaboration: Live task updates (assigned, moved, commented) and presence channels using Laravel Reverb.
  • Role-Based Access Control (RBAC): Fine-grained permissions using Policies and Gates (Admin, Member, Viewer).
  • Stripe Billing Integration: Pro vs Free tiers using Laravel Cashier with webhook processing.
  • Background Processing: Redis-backed queues managed by Laravel Horizon for email digests and Slack webhook notifications.
  • 100% Test Coverage: Developed using Strict TDD with Pest PHP. Fully automated CI pipeline.

🏗 Architecture

FocusFlow follows the Action-Domain-Responder (ADR) pattern over traditional MVC to keep controllers thin and logic highly testable.

graph TD
    Client[Vue 3 SPA] -->|REST API| Router[Laravel Router]
    Client <-->|WebSockets| Reverb[Laravel Reverb]
    Router --> Middleware[WorkspaceScope / Auth / Rate Limits]
    Middleware --> Controller[API Controllers]
    Controller --> Actions[Action Classes e.g. CreateTaskAction]
    Actions --> DB[(PostgreSQL)]
    Actions --> Events[Domain Events]
    Events --> Listener[Event Listeners]
    Events --> Broadcaster[BroadcastManager]
    Listener --> Queue[Redis / Horizon]
    Queue --> External[Slack / Stripe / SMTP]
Loading

👉 Read the full Architecture Decision Record (ADR) for a deep dive into the design patterns.
👉 Review the complete API Documentation for endpoint details.


💻 Quick Start (Docker)

To get FocusFlow running locally in under 5 minutes, you only need Docker and PHP installed.

1. Clone & Setup

git clone https://github.com/dreamymc/focusflow.git
cd focusflow
composer install
cp .env.example .env
php artisan key:generate

2. Boot Services

Start the required external services (PostgreSQL, Redis) via Docker Compose:

docker-compose up -d

3. Migrate & Seed

Run migrations and populate the database with realistic sample data:

php artisan migrate:fresh --seed --seeder=DemoSeeder

4. Start the Application

Run the local development servers:

# Terminal 1: Laravel API
php artisan serve

# Terminal 2: Reverb WebSockets
php artisan reverb:start

# Terminal 3: Vite Frontend
pnpm install && pnpm run dev

5. Test the Real-Time WebSockets

Open your browser to http://localhost:8000 to access the Interactive WebSocket Demo. Since FocusFlow is primarily a headless API, we included a lightweight Vue 3 harness to demonstrate Reverb WebSockets in real-time.

  • Import the Postman collection located at docs/postman/FocusFlow.postman_collection.json.
  • Trigger the "Move Task" API endpoint or fire an event via Tinker.
  • Watch the Notification Bell on the dashboard light up instantly!

🧪 Testing

The codebase maintains 100% test coverage using Pest PHP. The test suite includes full feature testing for WebSockets and Stripe Webhooks without requiring external services.

# Run the test suite
php artisan test

# Run with coverage report
php artisan test --coverage

📄 License

This project is open-sourced software licensed under the MIT license.

About

A modern, multi-tenant team productivity SaaS built with Laravel 11, Inertia.js, and Vue 3, featuring real-time collaboration via WebSockets (Reverb) and Stripe billing integration.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors