Rust Fullstack Template

A production-ready fullstack application template with Rust backend and React frontend.

Views0
PublishedJan 14, 2026

Loading actions...

5 minBeginnerpromptSingle file

Skill content

Main instructions and any bundled files for this skill.

markdown

Rust Fullstack Template

A production-ready fullstack application template with Rust backend and React frontend.

Tech Stack

Backend

  • Rust 2024 Edition with stable toolchain
  • Axum - Web framework
  • SeaORM - Async ORM with migrations
  • async-graphql - GraphQL server
  • Keycloak - Authentication (JWT/OIDC)
  • tracing + OpenTelemetry - Observability

Frontend

  • React 19 with TypeScript
  • Vite - Build tool
  • Apollo Client - GraphQL client
  • React Router - Navigation
  • React Hook Form + Zod - Forms & validation
  • GraphQL Codegen - Type generation

Project Structure

.
├── crates/                    # Rust workspace
│   ├── app/                   # Main application binary
│   ├── auth/                  # Authentication (reusable)
│   ├── common/                # Shared types (reusable)
│   ├── config/                # Configuration (reusable)
│   ├── database/              # SeaORM entities & repos (reusable)
│   ├── graphql/               # GraphQL schema & resolvers
│   └── telemetry/             # Logging & tracing (reusable)
├── web/                       # React frontend
│   ├── src/
│   │   ├── components/
│   │   ├── generated/         # GraphQL codegen output
│   │   ├── hooks/
│   │   ├── lib/               # Apollo, Auth setup
│   │   └── pages/
│   └── ...
├── config/                    # Backend configuration
├── justfile                   # Task runner
├── docker-compose.yml
└── .gitlab-ci.yml

Prerequisites

  • Rust 1.85+ (stable)
  • Node.js 22+
  • Docker & Docker Compose
  • Just command runner

Quick Start

# Install just (if not installed)
cargo install just

# Start development services
just dev-services

# Install dependencies
just install

# Run migrations
just db-migrate

# Start development (backend + frontend)
just dev

Available Commands

just              # List all commands
just dev          # Start full dev environment
just test         # Run all tests
just lint         # Run all linters
just build        # Build everything
just ci           # Run CI checks locally

Configuration

Configuration is loaded from (in order):

  1. config/default.toml
  2. config/{environment}.toml
  3. config/local.toml (gitignored)
  4. Environment variables with APP__ prefix

Environment Variables

# Backend
APP_ENVIRONMENT=development
APP__DATABASE__URL=postgres://postgres:postgres@localhost:5432/myapp
APP__AUTH__KEYCLOAK_URL=http://localhost:8180
APP__AUTH__REALM=master
APP__AUTH__CLIENT_ID=my-app

# Frontend (in web/.env)
VITE_GRAPHQL_URL=http://localhost:8080/graphql
VITE_AUTH_URL=http://localhost:8180
VITE_AUTH_REALM=master
VITE_AUTH_CLIENT_ID=my-app-frontend

Development

Backend

just backend-watch  # Watch mode with auto-reload
just backend-run    # Run once

Frontend

just frontend-dev   # Vite dev server on :3000
just gql-codegen    # Generate TypeScript types

Database

just db-migrate     # Run migrations
just db-rollback    # Rollback last migration
just db-reset       # Drop & recreate database

Testing

just test                    # All tests
just test-backend            # Backend only
just test-frontend           # Frontend only
just test-backend-coverage   # With coverage

CI/CD

GitLab CI pipeline includes:

  • Check: rustfmt, clippy, eslint, prettier
  • Test: Backend & frontend with coverage
  • Security: cargo-audit, npm audit, SAST, secret detection
  • Build: Binary, frontend, Docker image
  • Deploy: Staging (auto), Production (manual)

License

MIT

Share: