Svelte + gRPC Stream
2023-07-22.16-44-34.mp4
Infrastructure
This project consists of 5 infrastructure components
- Traefik: ingress controller and gRPC-Web proxy
- NATS: for queueing notifications that need to be relayed
- Redis: caches messages
- Relay (golang): Picks up messages from the queue and forwards them to a gRPC stream to the frontend
- Pocketbase: For user authentication
- Frontend (svelte & typecript): For sending notifications via the API and recieving notifications via the Relay.
Documentation
Requirements
- node 20.3.0 to run svelte app
- golang 1.20 to run the golang server
- buf 1.21.0 to generate code from protobuffers
- docker 24.0.2 to run services in docker compose
Dev
Ingress
In your hosts file set:
127.0.0.1 frontend.docker.localhost
After running docker compose up
, http://frontend.docker.localhost should now be available via Traefik.
Quickstart
docker compose up --build