zzy/actix-web-async-graphql-rbatis

actix-web-async-graphql-rbatis

Clean boilerplate for graphql services using actix-web, rhai, async-graphql, surf, rbatis, graphql-client, handlebars-rust, jsonwebtoken, and mysql / postgresql

actix-web-async-graphql-rbatis

Clean boilerplate for graphql services using actix-web, rhai, async-graphql, surf, rbatis, graphql-client, handlebars-rust, jsonwebtoken, and mysql / postgresql.

See also: tide-async-graphql-mongodb

Features

  • Graphql Services
    • User register
    • Salt and hash a password with PBKDF2 - 使用 PBKDF2 对密码进行加密(salt)和散列(hash)运算
    • Sign in
    • JSON web token authentication - JWT 鉴权整合
    • Change password
    • Profile Update
    • User: query & mutation
    • Project: query & mutation
  • Web Application
    • Client request, bring & parse GraphQL data
    • Render data to template engine
    • Define custom helper with Rhai scripting language

Stacks

  • Rust - 中文资料集萃
  • actix-web - 中文文档
  • rhai - Embedded Scripting for Rust
  • async-graphql - 中文文档
  • rbatis
  • Surf
  • graphql_client
  • handlebars-rust
  • jsonwebtoken
  • cookie-rs

How to run?

Frontend - actix-web server

Rename file .env.example to .env, or put the environment variables into a .env file:

Build & Run:

Then connect to http://127.0.0.1:3000 with browser.

Backend - Graphql Server

Rename file .env.example to .env, or put the environment variables into a .env file:

Build & Run:

GraphiQL: connect to http://127.0.0.1:8080/graphiql with browser.

Queries

  • getUserByEmail(...): User!
  • getUserByUsername(...): User!
  • userSignIn(...): SignInfo!
  • allUsers(...): [User!]!
  • allProjects: [Project!]!
  • allProjectsByUser(...): [Project!]!

MUTATIONS

  • userRegister(...): User!
  • userChangePassword(...): User!
  • userUpdateProfile(...): User!
  • addProject(...): Project!

Sample Usage

Sample mutation for user register:

Sample query for user sign in:

When submit method userSignIn, a token would be generated, use this token for query all users and every user's projects:

Sample query and mutation for projects was similar to users.

Contributing

You are welcome in contributing to this project.

Information - Updated May 28, 2022

Stars: 25
Forks: 5
Issues: 0

Rust bindings for libinjection

Add libinjection to dependencies of Cargo

Rust bindings for libinjection

Rhai - Embedded Scripting for Rust

An eval scripting lang for safe and easy scripting in any application

Rhai - Embedded Scripting for Rust

Rust bindings for the C++ api of PyTorch

LIghtweight wrapper for pytorch eg libtorch in rust

Rust bindings for the C++ api of PyTorch

Rust leveldb bindings

Almost-complete bindings for leveldb for Rust

Rust leveldb bindings

rust-analyzer is a modular compiler frontend for the Rust language

It also contains some tips & tricks to help you be more productive when using rust-analyzer

rust-analyzer is a modular compiler frontend for the Rust language

Rust-Lightning is a Bitcoin Lightning library written in Rust

lightning, does not handle networking, persistence, or any other I/O

Rust-Lightning is a Bitcoin Lightning library written in Rust

Rust FUSE - Filesystem in Userspace

Rust library crate for easy implementation of Crate documentation

Rust FUSE - Filesystem in Userspace

Rust crate to implement a counterpart to the PBRT book's (3rd edition) C++ code:

Some images of the test scenes are shown below, but you can find more

Rust crate to implement a counterpart to the PBRT book's (3rd edition) C++ code:

Rust Persian Calendar

1** provides functionality for conversion among Persian (Solar Hijri) and Gregorian calendars

Rust Persian Calendar

Rust DjangoHashers

A Rust port of the password primitives used in alternatice implementation: the package library that requires OpenSSL

Rust DjangoHashers

actix-web-async-graphql-rbatis

Clean boilerplate for graphql services using actix-web, rhai, async-graphql, surf, rbatis, graphql-client, handlebars-rust, jsonwebtoken, and mysql / postgresql

actix-web-async-graphql-rbatis
Facebook Instagram Twitter GitHub Dribbble
Privacy