Basically, it is a canvas drawing grpc api with persistent storage of scenes.
Current deployment is located here: http://nilserver.dynv6.net:6900
This includes 4 components (or services as per docker-compose config):
Code is located under server/frontend
. As it says in the name, it's the basic nginx static file server. Static files include grpc-web client.
Code (just a config file actually) located under server/grpc_proxy
. Envoy proxy that forwards grpc-web requests to backend service. It is needed to translate http/1.1 traffic to http/2, which is used by grpc. For more info, look here.
Code is located under server/
. Main grpc service with all handlers. For persistence it stores drawings in mongodb.
No code here, just latest mongodb
docker image. Everything is stored in database named Visualization
. Scene info (mainly, authenticator) is stored in scenes
collection. Drawings are stored in drawings
collection (what a surprise).
- Generate grpc and pb files from
.proto
usinggenerate.sh
(it's just a shorthand for 3 calls toprotoc
):
$ ./generate.sh
- Run
docker-compose
with build option:
$ docker-compose up --build
All build operations (frontend packing and main server binary building) are performed during multistage build of the respective images. See their Dockerfile
s for more info on building.
If you want to deploy this for yourself, keep in mind that it requires 2 open (or forwarded) ports to work: 6900 (for static files) and 6901 (for grpc).
There is also a small client that can be used as console util for grpc api. It was used only for testing.
- Create new scene using
Register
method, it returnsSceneId
andAuthenticator
. All scene-modifying requests requireAuthenticator
. - Add drawings using
Draw
method, it returnsDrawingId
. - Remove drawings by
DrawingId
usingRemove
method. - Remove all drawings on a scene using
Clear
method. - Remove scene completely using
Delist
method. - Poll for scene updates using
Poll
method.AfterTimestamp
parameter is used for pagination, it should be updated on client after receiving new batch of drawings. Currently used on website to draw on canvas, but can be used with other drawing software.