Skip to content

Rust Hack and Learn in Berlin Challenge to implement a Site in as many Frameworks as possible. This implementation is : Leptos - Axum - SurrealDB - GraphQL

License

Notifications You must be signed in to change notification settings

oxide-byte/rust-berlin-leptos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust - Berlin Hack and Learn Challenge

Purpose

This implementation is a adaptation of the Rust UserGroup Rust Hack and Learn Berlin challenge: https://github.com/andreasklostermaier/halreslib in different Frameworks.

My choice Leptos as Frontend.

Link to the meetup group: https://berline.rs/

Even whe most of features are implemented and functional, there is still room for progress...

Implementation

SALT = (S)urrealDB (A)xum (L)eptos (T)ailwind + GraphQL

The Frameworks in use:

Frontend:

  • Leptos 0.8.2
  • Thaw 0.5.0-Beta
  • Tailwind 4.0
  • GraphQL Query + Mutation + Subscription

Backend:

  • Axum 0.8.3
  • Tower 0.5.2 (Static Page Server)
  • Juniper Axum (GraphQL)

Database:

  • SurrealDB

Installation / Preparation

PS: For TailwindCss I use the Mac Brew option:

brew update
brew install tailwindcss

Running

The implementation uses Trunk to generate and run the Client Side Pages. It includes Hot Reloading

trunk serve --open

Build

trunk build --release

The files generated in the client folder /dist can be moved on the Server side to the folder /static. To access to the files from Axum you need to manually adapt in the index.html file the relative path for the links as the wasm file:

Example:

href="rust-berlin-leptos-7a6a9f219c87d073.js" --> href="/web/rust-berlin-leptos-7a6a9f219c87d073.js"

Starting the Backend:

cd server
cargo run

The different links on the Backend side:

Server on:        http://127.0.0.1:8080
Leptos client on: http://127.0.0.1:8080/web
Graphiql on:      http://127.0.0.1:8080/graphiql
Playground on:    http://127.0.0.1:8080/playground

Improvements

  • Review SurrealDB specially for SQL Injection and Query Builder
  • Review and Optimize code for removing .clone()
  • Review and Optimize Signals
  • Review and Optimize Component Communication
  • Fixing bugs ;-)
  • ...

Features to plan:

  • Add a Security Layer

Links

Leptos Documentation:

https://book.leptos.dev/

For playing with Tailwind:

https://play.tailwindcss.com/

alt text

About

Rust Hack and Learn in Berlin Challenge to implement a Site in as many Frameworks as possible. This implementation is : Leptos - Axum - SurrealDB - GraphQL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages