Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xxidbr9/rust-react-ssr-example

SSR React app using Rust as a Backend
https://github.com/xxidbr9/rust-react-ssr-example

react rust ssr

Last synced: about 1 month ago
JSON representation

SSR React app using Rust as a Backend

Awesome Lists containing this project

README

        

# Rust + React = SSR
Simple example running React in SSR using Rust as a backend

Learn V8 from [here](https://github.com/denoland/rusty_v8/blob/main/examples/hello_world.rs)

## Preparation
- First make sure you install [Rust](https://www.rust-lang.org/)
- And install LLVM & Clang

## How To Run

Before running the server, it required to build the frontend project

```bash
# Go to target directory
cd examples/source

# Install using yarn
yarn

# Build all required files
yarn build:all

# Back to root project
cd ../../
```

```bash
# serve with actix web server
# Using V8
cargo build --example=actix-v8 --release

# Using JSC
cargo build --example=actix-jsc --release
```

```bash
# Serve the example
# V8
cargo run --example=actix-v8 --release

# JSC
cargo build --example=actix-jsc --release
```

See the serve in JSC : [http://localhost:8081](http://localhost:8081)

See the serve in V8 : [http://localhost:8082](http://localhost:8082)

## TODO
- [ ] Babel transformer => using same api in Next.js
- [ ] Benchmarking and compare with Next.js
- [ ] Using [JSC](https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore)
- [ ] Fix JSC ```[Object Module]```