Skip to content

rust-dd/rust-axum-async-graphql-postgres-redis-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-axum-async-graphql-postgres-redis-starter

A modern Rust backend starter template using:

  • Axum for HTTP/WebSocket server
  • Async-GraphQL for GraphQL APIs
  • PostgreSQL via tokio-postgres and bb8 async connection pool
  • Redis via bb8-redis async connection pool
  • Firebase Auth integration
  • WebSocket support
  • Jemalloc for improved memory performance

Requirements

  • Rust 1.85+ (2024 edition)
  • PostgreSQL server
  • Redis server

Getting Started

1. Clone the repo

git clone https://github.com/rust-dd/rust-axum-async-graphql-postgres-redis-starter.git
cd rust-axum-async-graphql-postgres-redis-starter

2. Setup environment

Create a .env file in the project root:

POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_DB=postgres

REDIS_HOST=redis://localhost:6379

FIREBASE_PROJECT_ID=firebase_project
ADMIN_SECRET=admin1234

3. Run the project

cargo run

4. Access the GraphQL Playground

Once running, open: http://localhost:8000/graphql

Performance

This project uses jemallocator as the global allocator for improved memory allocation performance in high-throughput environments and simd-json for fast JSON operations.

#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

License

MIT

About

Starter template using Rust with Axum, Async-GraphQL, PostgreSQL, and Redis for building high-performance web APIs.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy