Skip to content

desonglll/ax

Repository files navigation

title
ax system

!!! This README is not updated for sqlx.

!!! This README is not updated for distribute system.

Apps

An Chat And Post System based on Rust and Postgres.

AX

The previous project was Crab Rocket

🧩 Project Dependencies

  • Rust
  • Postgresql16
  • Redis
  • Actix-Web

Demo

Post Page

⚙️ Requirements

Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Postgres

brew install postgresql@16

Redis

brew install redis

diesel

cargo install diesel_cli --no-default-features --features postgres

🎃 Quick Start

git clone git@github.com:desonglll/ax.git && cd ax
cargo install
cd backend/query
export DATABASE_URL=postgres://localhost:5432/hello_rocket
diesel setup && diesel database reset
cd ../..
cargo run

Migrations

Create a .env file

export DATABASE_URL=postgres://localhost:5432/hello_rocket

Run sqlx-cli

brew install sqlx-cli
source .env

cd tweet_server

sqlx database create
sqlx database drop

# Creates a new file in `migrations/<timestamp>-<name>.sql`.
# Add your database schema changes to this new file.
sqlx migrate add -r <name>

sqlx migrate run

sqlx migrate info --source ../relative/migrations

sqlx migrate revert

Run server

# Run the server
cd ax
cargo run --bin tweet_service

🔧 Compile Release Version

cargo build --release

Installation

cargo install --path .

🚀 Running the Binary

Set the environment variable:

export DATABASE_URL=postgres://@localhost/hello_rocket

Alternatively, update the .env file in the project root.

Reset Database

diesel database reset

Run

ax

Design

Technical

Technical