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
- 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
- Rust,Rust 实例手册,Rust 参考手册,通过例子学 Rust,Rust 程序设计语言(2018)
- actix-web - Web server
- juniper - GraphQL server,juniper 中文文档
- diesel - ORM
- PostgreSQL / MySql - Database
- jsonwebtoken - JSON Web Token
- GraphQL Playground - GraphQL UI
- TypeScript
- react - User Interfaces
- apollo-client - GraphQL client
git clone https://github.com/zzy/actix-graphql-react.git
cd actix-graphql-react/backend/
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
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.
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