Cowork is an online real-time collaborative editing system, internal use of Yjs CRDT algorithm.
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(auth-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
Install dependencies docker
, docker-buildx, minikube, kubectl
, make
and start the minikube
- build the image
chmod +x ./scripts/*
make
- start
./scripts/start.sh
- update hosts, need permission to modify the hosts file.
export INGRESS_IP=$(kubectl get svc -n ingress-nginx ingress-nginx-controller -o=jsonpath='{.spec.clusterIP}')
sudo cat << EOF >> /etc/hosts
$INGRESS_IP api.cowork.local
$INGRESS_IP app.cowork.local
$INGRESS_IP dashboard.cowork.local
EOF
- waiting all pods start, execute to view the pods status
kubectl get pods -n cowork
open the page