Welcome to Rusve!
What is Rusve?
It is a attempt to find the best way to build fast and scalable web applications, while not beeing afraid of new technologies. And I think we are getting there.
Feel free to ask questions and throw new ideas! Any contribution is also welcome, especially some ux/ui redesigns :)
Currently working on...
- Markdown
- Telemetry
- Make it more resistanc to no js
- Any other feature You will request :)
Application
CMS
https://directus-cms.fly.dev | Login: [email protected]
| Password: d1r3ctu5
Features
- Backend
- Microservices - Splitted into smaller parts, very easy to scale, and allows using any combination of languages and databases. Project have ready to use both Go and Rust services.
- Go - Very easy to work with while still having an amazing performance. Out of the box support for gRPC. Recommended to start with.
- Rust - For more complex services use Rust, hard but amazing language. Almost impossible to write code that will not start.
- gRPC - Connection between services using gRPC, which is very fast and gives an option for bi-directional streaming. For Rust using great Tonic create, with first class support of async/await.
- Typesafety - Thanks to protobuf, amazing typesafety across the whole project, no matter the language (not only for TS, hi tRPC).
- Sql Pools and Transactions - Using the best practice for the best performance and error handling.
- Dockerized - Every service is dockerized. Local build ready with one command.
- Frontend
- SvelteKit - Once You try it, it's hard to go back to any other framework.
- Typescript - Fully written in typescript with the strict rules enforced. No any or unknown in code.
- Form actions - Forms are handled by server, which force You to seperate view and logic. This is a great pattern and makes the logic unaccesible by the browser.
- Zod validation - Every data if validated. Errors are returned and used by client to view them on forms.
- Streaming - Important data is loaded and rendered first, after that all the rest are returned as promises and rendered when they resolve.
- PWA with service workers - Turn off the internet and check how resiliant the app is.
- Firebase SSR Authentication - Battle-tested OAuth, Magic Link, Phone Number. And by doint it on Svelte server, it's much more secure.
- TailwindCSS - Used for styling, no other UI library needed.
- Minimal external libraries - With Svelte animation and stores builing custom components is very easy. Checkout
Toast
,Drawer
,Modal
,Dropdown
and see for yourself.
- Deployment
- Github Action - Ready to use github actions for deployment, each service is linted and checked. Possible to deploy all services or a single one.
- Google Cloud Platform - Easy to deploy, easy to scale, easy to maintain, and still cheap.
- Google Cloud Run - Thanks to dockerized application, it's very easy to deploy. Scaling done automatically, can set the min. instances to 1 to reduce cold start.
- Google Cloud Storage - Working files upload, download and delete.
- Google PubSub - Asynchronus data sending.
- Additional features
- Stripe - Fully working subscription flow.
- HeadlessCMS - Headless cms via Directus.
- WYSIWYG - Wyswig text editor thanks to TipTap.
Architecture
Authorization
Github action deployment
Release all
Release single
Aria and PWA with offline service workers
Dev deployment
- Client setup
cp client/.env.example client/.env
npm i --prefix client
- Run proto generation
Be sure to have
protoc
installed.
sh proto.sh
- Fill in missing firebase secrets in
client/.env
- STRIPE_API_KEY
- PUBLIC_API_KEY
- PUBLIC_AUTH_DOMAIN
- SERVICE_ACCOUNT
Getting the SERVICE_ACCOUNT
key is a bit tricky.
- Start docker:
docker-compose up --build
- Access:
Application - http://localhost:3000
CMS - http://localhost:8055 | Login: [email protected]
| Password: d1r3ctu5
Production deployment
-
Go through each
deploy-***.yml
and changeenv
acording to Your project. -
Add secrets to github
- GCP_CREDENTIALS
- DB_PASS
- STRIPE_API_KEY
- SENDGRID_API_KEY
- PUBLIC_API_KEY
- PUBLIC_AUTH_DOMAIN
- SERVICE_ACCOUNT
- Add proper IAM permissions
Bonus: Three ways to shows notes. Not implemented in application, but all the code is there to try it.
This project shows how flexible the gRPC + SvelteKit setup is, using the newest SvelteKit streamed
feature. There are three ways to display notes:
svelte server
callsnotes service
->notes service
selects all notes -> for each note it callsusers service
for user -> the note with the user is returned as streamsvelte server
callsnotes service
->notes service
selects all notes and return them -> for each notesvelte server
callsusers service
for user -> not waiting for users to resolve, he dispaly the notes, and after that await users asstreamed
datasvelte server
callsnotes service
->notes service
selects all notes and return them -> for each notesvelte server
add userId to set -> then, in one request he callsusers service
for all users -> not waiting for users to resolve, he displays notes and after that await users asstreamed
data