Skip to content

judeVector/hyperforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyperforge

A lightweight Rust HTTP API built with Hyper, Tower, and SQLx.
This project demonstrates how to build a production-style async server without high-level frameworks.

Features

  • Async HTTP/1 server using Hyper
  • Middleware with Tower (CORS, timeout, concurrency limits, tracing)
  • PostgreSQL integration via SQLx
  • Basic User CRUD API
  • Health check with DB validation
  • In-memory metrics endpoint
  • Graceful shutdown (CTRL+C)

Tech Stack

  • Rust + Tokio
  • Hyper & Tower
  • SQLx (PostgreSQL)
  • Tracing

Getting Started

Prerequisites

  • Rust (stable)
  • PostgreSQL

Setup

git clone https://github.com/judevector/hyperforge.git
cd hyperforge

Create a .env file:

DATABASE_URL=postgresql://postgres:password@localhost:5432/postgres

Run the server:

cargo run

Server runs on:

http://127.0.0.1:3000

API Endpoints

  • GET /health – Service & database health
  • GET /users – Fetch all users
  • GET /users/{id} – Fetch user by ID
  • POST /users – Create a new user
  • DELETE /users/{id} – Delete a user
  • GET /metrics – Request & error counts

Notes

Request timeout: 30s

Max concurrency: 100

Payload limit: 64KB

Database schema is created automatically on startup

License

MIT

About

A lightweight Rust HTTP API built with Hyper, Tower, and SQLx.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published