zzy / actix-graphql-react

Clean boilerplate for GraphQL server & react-app built with Rust & TypeScript. Backend: actix-web + juniper(GraphQL server) + diesel(ORM); Frontend: react + apollo(GraphQL client).

Home Page:https://blog.budshome.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Clean boilerplate for GraphQL server & react-app built with Rust & TypeScript. Backend: actix-web + juniper(GraphQL server) + diesel(ORM); Frontend: react + apollo(GraphQL client).

https://blog.budshome.com

License:Apache License 2.0


Languages

Language:Rust 100.0%