Skip to content
/ cowork Public

Cowork is an online real-time collaborative editing system

Notifications You must be signed in to change notification settings

shiroyk/cowork

Repository files navigation

Cowork

Cowork is an online real-time collaborative editing system, internal use of Yjs CRDT algorithm.

Architecture

graph TB
classDef pod fill:#326ce5,stroke:#fff,stroke-width:4px,color:#fff;
client([client]) --> ingress
subgraph ingress
    ingress-pod(ingress-pod):::pod
end
subgraph cowork
    subgraph Deployment
        subgraph auth-service
            auth-pod(user-pod):::pod
        end
        subgraph user-service
            user-pod(user-pod):::pod
        end
        subgraph doc-service
            doc-pod(doc-pod):::pod
        end
        subgraph collab-service
            collab-pod(collab-pod):::pod
        end
        subgraph frontend-service
            frontend-pod(frontend-pod):::pod
        end
    end
    subgraph StatefulSet
        subgraph redis-service
            redis-pod(redis-pod):::pod
        end
        subgraph nats-service
            nats-pod(nats-pod):::pod
        end
        subgraph user-db-service
            user-db-pod(user-db-pod):::pod
        end
        subgraph doc-db-service
            doc-db-pod(doc-db-pod):::pod
        end
    end
    user-service --> user-db-service
    auth-service --> user-service
    collab-service --> user-service
    doc-service --> doc-db-service
    collab-service --> doc-service
    doc-service --> nats-service
    auth-service --> redis-service
    collab-service --> redis-service
    collab-service --> nats-service
end
ingress -- api.cowork.local/auth --> auth-service
ingress -- api.cowork.local/users --> user-service
ingress -- api.cowork.local/docs --> doc-service
ingress -- api.cowork.local/collab --> collab-service
ingress -- app.cowork.local --> frontend-service

Usage

Install dependencies docker, docker-buildx, minikube, kubectl, make and start the minikube

  • build the image
chmod +x ./scripts/*
make
  • deployment
kubectl apply -f ./k8s
  • update hosts, need permission to modify the hosts file.
sudo ./scripts/host.sh
  • waiting all pods start, execute to view the pods status
kubectl get pods -n cowork

open the app.cowork.local

TODO

  • usage
  • document
  • cowork-frontend
  • cowork-group

Reference