Skip to content

DarcyJason/backend

Repository files navigation

Rust backend (Axum)

简体中文 | English

Content

Introduction

Preparations

API Book

Introduction

This is a Rust backend (Axum) with SurrealDB and Redis. It is a fully functional Auth system. Feel free to use it as a starting point for your own projects.

Preparations

1. Install SurrealDB

docker run --name surrealdb \
  -p 10086:8000 \
  -v ~/surrealdb:/data \
  -d surrealdb/surrealdb:latest \
  start \
  --user root \
  --pass root \
  rocksdb:/data/mydatabase.db

You can download the Surrealist to your local machine if you want to use SurrealDB in GUI.

2. Install SurrealDB Migrations

cargo install surrealdb-migrations

3. Run migrations

surrealdb-migrations apply

4. Install Redis

docker run --name redis \
  -p 6379:6379 \
  -v ~/redis:/data \
  -d redis:latest

5. Configure .env

cp .env.example .env

Configure the .env file.

6. Run the backend

cargo run

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages