actix-graphql-react icon indicating copy to clipboard operation
actix-graphql-react copied to clipboard

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

actix-graphql-react

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

  • Backend Demo (WIP): https://api.budshome.com/gql
  • Frontend Demo (WIP): https://cms.budshome.com

Features

  • [x] DB migration with Diesel
  • [x] User: query & mutation
  • [x] Project: query & mutation
  • [x] 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