Skip to content
Clean boilerplate for GraphQL server & react-app built with Rust & TypeScript. Backend: actix-web + juniper(GraphQL server) + diesel(ORM); Frontend: react + apollo(GraphQL client).
Rust
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
backend - Mar 28, 2020
frontend - Mar 28, 2020
.gitattributes - Sep 4, 2019
LICENSE-APACHE 💯 Mar 13, 2020
LICENSE-MIT 💯 Mar 13, 2020
README.md - Mar 25, 2020

README.md

actix-graphql-react

NOT complete - Clean boilerplate for GraphQL server & react-app built with Rust & TypeScript.

Features

  • DB migration with Diesel
  • User: query & mutation
  • Project: query & mutation
  • User register
  • Sign up & Sign in
  • Encrypt password & Change password
  • Profile Update
  • JSON web token authentication

Stacks

Backend

Frontend

How to run?

Backend

git clone https://github.com/zzy/actix-graphql-react.git
cd actix-graphql-react/backend/

Put the DATABASE_URL & port in a .env file.

Configure the database backend in Cargo.toml:

[dependencies]
diesel = { version = "<version>", features = ["<postgres|mysql>"] }

Then, run at the bash:

cargo install diesel_cli --no-default-features --features <postgres|mysql>
echo DATABASE_URL=<postgres|mysql>://username:password@localhost/actix_graphql > .env
echo GRAPHQL_PORT=5000 >> .env

Build & Release

  • Build
diesel setup
diesel migration run
cargo build
cargo run
  • Release
cargo build --release
cd target/release
./actix-graphql-react

GraphiQL: connect to http://localhost:5000/gql with browser.

Frontend

git clone https://github.com/zzy/actix-graphql-react.git
cd actix-graphql-react/frontend/
# npm or yarn
<npm|yarn> install
<npm|yarn> start

Then go to http://localhost:5001

You can’t perform that action at this time.