https://github.com/shiroyk/cowork
Cowork is an online real-time collaborative editing system
https://github.com/shiroyk/cowork
collaborative-editor crdt echo-framework gin k8s kubernetes spring
Last synced: 14 days ago
JSON representation
Cowork is an online real-time collaborative editing system
- Host: GitHub
- URL: https://github.com/shiroyk/cowork
- Owner: shiroyk
- Created: 2021-04-12T12:07:45.000Z (almost 5 years ago)
- Default Branch: k8s
- Last Pushed: 2024-12-17T14:57:09.000Z (about 1 year ago)
- Last Synced: 2024-12-17T15:45:14.744Z (about 1 year ago)
- Topics: collaborative-editor, crdt, echo-framework, gin, k8s, kubernetes, spring
- Language: Go
- Homepage:
- Size: 5.12 MB
- Stars: 29
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cowork
**Cowork** is an online real-time collaborative editing system, internal use of [Yjs CRDT](https://github.com/yjs/yjs) algorithm.
## Architecture
```mermaid
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
```
## Usage
Install dependencies `docker`, [docker-buildx](https://github.com/docker/buildx), [minikube](https://minikube.sigs.k8s.io/docs/), `kubectl`, `make` and start the `minikube`
- build the image
```shell
chmod +x ./scripts/*
make
```
- start
```shell
./scripts/start.sh
```
- update hosts, need permission to modify the hosts file.
```shell
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
```shell
kubectl get pods -n cowork
```
open the page
- [app.cowork.local](http://app.cowork.local)
- [dashboard.cowork.local](https://dashboard.cowork.local)
## Reference
- [Yjs](https://github.com/yjs/yjs)