Skip to content

Repository files navigation

Blog Platform

A multi-component blog system written in Rust: HTTP + gRPC backend, WebAssembly frontend, CLI tool, and a shared client library — all in a single Cargo workspace.

Highlights:

  • Dual-protocol backend: REST (Actix-web) and gRPC (Tonic) serving the same domain logic
  • Frontend in Rust compiled to WebAssembly (Yew) — no JavaScript framework involved
  • JWT-based authentication
  • PostgreSQL with compile-time checked queries (sqlx) and migrations
  • Shared client crate reused by both the CLI and the WASM frontend

Stack: Rust · Actix-web · Tonic (gRPC) · Yew (WASM) · PostgreSQL · sqlx · Docker

Project Structure

This repository is a Rust workspace containing the following projects:

  • blog-server: The backend API server supporting both HTTP (Actix-web) and gRPC (Tonic).
  • blog-wasm: A modern frontend built with Yew, compiled to WebAssembly.
  • blog-cli: A command-line interface tool to interact with the blog system.
  • blog-client: A shared library providing HTTP and gRPC client implementations for the blog system.

Prerequisites

  • Rust (latest stable version)
  • Trunk (for building the WASM frontend)
  • Docker (for running the database)
  • sqlx-cli (for database migrations)

Getting Started

1. Database Setup

The server requires a PostgreSQL database. You can start one using Docker and the init script:

chmod +x scripts/init_db.sh
./scripts/init_db.sh

2. Running the Server

APP_JWT__SECRET=<secret> cargo run -p blog-server

The server will start an HTTP API on port 3000 and a gRPC server on port 50051 (defaults).

3. Running the WASM Frontend

cd blog-wasm
trunk serve

The app will be available at http://localhost:8080.

4. Using the CLI

cargo run -p blog-cli -- --help

License

MIT or Apache-2.0

About

Multi-component blog system in Rust: REST API (Actix-web), gRPC (Tonic), WebAssembly frontend (Yew), CLI tool, and PostgreSQL

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages