Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sentinel

A cloud-native distributed backend platform built with Rust and Go, designed to explore modern backend engineering, microservices, distributed systems, and cloud-native technologies.


Architecture

                    Client / Frontend
                           β”‚
                           β–Ό
                  πŸ¦€ Rust API Gateway
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Generic Reverse Proxy            β”‚
        β”‚ Dynamic Routing                  β”‚
        β”‚ Header Forwarding                β”‚
        β”‚ Request Forwarding               β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                  🐹 Go Auth Service
                           β”‚
                    PostgreSQL Database

Tech Stack

Gateway

  • Rust
  • Axum
  • Tokio
  • Reqwest

Auth Service

  • Go
  • Gin
  • PostgreSQL
  • pgx
  • bcrypt
  • JWT

Database

  • PostgreSQL

Features

Rust API Gateway

  • Generic Reverse Proxy
  • Dynamic Route Forwarding (/auth/*)
  • Request Body Forwarding
  • Header Forwarding
  • Health Endpoint
  • Shared HTTP Client
  • Configuration Management
  • Service-to-Service Communication

Go Authentication Service

  • User Registration
  • User Login
  • Password Hashing (bcrypt)
  • JWT Authentication
  • Protected /me Endpoint
  • PostgreSQL Integration
  • Repository Pattern
  • Service Layer
  • Unit Tests
  • Repository Tests

Project Structure

sentinel/

β”œβ”€β”€ gateway/                 # Rust API Gateway
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ handlers/
β”‚   β”‚   β”œβ”€β”€ routes.rs
β”‚   β”‚   β”œβ”€β”€ config.rs
β”‚   β”‚   β”œβ”€β”€ state.rs
β”‚   β”‚   └── main.rs
β”‚   └── Cargo.toml
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ auth-service/
β”‚   β”‚   β”œβ”€β”€ cmd/
β”‚   β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”‚   β”œβ”€β”€ handler/
β”‚   β”‚   β”‚   β”œβ”€β”€ repository/
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ service/
β”‚   β”‚   β”‚   └── models/
β”‚   β”‚   └── migrations/
β”‚   β”‚
β”‚   └── shared/
β”‚       β”œβ”€β”€ auth/
β”‚       β”œβ”€β”€ config/
β”‚       β”œβ”€β”€ database/
β”‚       └── logger/
β”‚
└── README.md

Authentication Flow

Client
   β”‚
POST /auth/login
   β”‚
   β–Ό
Rust Gateway
   β”‚
Generic Reverse Proxy
   β”‚
POST /login
   β”‚
   β–Ό
Go Auth Service
   β”‚
Verify Credentials
   β”‚
Generate JWT
   β”‚
   β–Ό
Rust Gateway
   β”‚
   β–Ό
Client

Protected Route Flow

Client
   β”‚
Authorization: Bearer <JWT>
   β”‚
   β–Ό
Rust Gateway
   β”‚
Header Forwarding
   β”‚
   β–Ό
Go Auth Service
   β”‚
JWT Middleware
   β”‚
Repository
   β”‚
PostgreSQL
   β”‚
   β–Ό
User Profile

Current Endpoints

Gateway

Method Endpoint
GET /health
ANY /auth/*

Auth Service

Method Endpoint Description
GET / Health Check
POST /register Register User
POST /login Login
GET /me Current User

Current Progress

Completed

Infrastructure

  • Project Structure
  • Shared Configuration
  • Logging
  • PostgreSQL Integration

Rust Gateway

  • Axum Setup
  • Generic Reverse Proxy
  • Dynamic Route Matching
  • Header Forwarding
  • Body Forwarding
  • Health Endpoint
  • Service-to-Service Communication

Go Auth Service

  • Registration
  • Login
  • JWT Authentication
  • Protected Routes
  • Repository Pattern
  • Unit Tests
  • Repository Tests

Upcoming Roadmap

User Service

  • User Profiles
  • Update Profile
  • Search Users

Gateway

  • Query Parameter Forwarding
  • Response Header Forwarding
  • Request Logging
  • CORS
  • Rate Limiting
  • Metrics
  • Tracing

Platform

  • Redis
  • gRPC
  • Kafka
  • Docker
  • Kubernetes
  • Prometheus
  • Grafana

Frontend

  • Next.js
  • TypeScript
  • Tailwind CSS
  • Authentication
  • Dashboard

Learning Goals

Sentinel is built to gain hands-on experience with:

  • Rust Backend Development
  • Go Microservices
  • Distributed Systems
  • API Gateway Design
  • Authentication & Authorization
  • Cloud-Native Development
  • System Design
  • Docker & Kubernetes
  • Event-Driven Architecture
  • Observability
  • Production Backend Engineering

Status

Current Phase: Gateway & Authentication βœ…

The project currently consists of a production-style Rust API Gateway routing requests to a Go-based Authentication Service backed by PostgreSQL. Authentication flows, protected routes, and generic reverse proxying are fully functional.

The next milestone is expanding the platform with additional microservices, beginning with a dedicated User Service.

About

A cloud-native Backend-as-a-Service platform built with Go, Rust, Kubernetes, Kafka, Redis, PostgreSQL, and Next.js

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages