Graduation Thesis Project · Hanoi University of Architecture

Scientific Staff Research
Management System

A microservice platform for academic research management — staff profiles, research registration, approval workflows and real-time notifications. Deployed to production with automated CI/CD.

Microservice Apache Kafka Redis PostgreSQL Docker Next.js React Native Socket.io JWT · RBAC · ABAC Cloudflare R2 Nginx · HTTPS CI/CD · Docker Hub
0
Microservices
0
Kafka Topics
0
Isolated DBs
0
Client Platforms
Live Demo · In Production
hau.bian.io.vn
User 2026CNTT56 Pass 123456
Open live site →
Explore
📌

Project Note: This project is maintained as a private repository because it will be submitted for official academic evaluation as part of my graduation thesis. To give recruiters and collaborators an overview of the work, this showcase presents the system architecture, technologies and core features without exposing the source code.

System Architecture

A layered architecture with a single entry point — Nginx as the sole internet-facing gateway, routing requests through an API Gateway to four independent microservices, each owning its own database.

🏛️
4-Layer Architecture Overview
Client → Nginx → API Gateway → Services → Data
System architecture diagram

The system is organised into three functional tiers plus one entry layer. The Client tier consists of a Next.js web application and a React Native mobile app — both access the system exclusively through an Nginx reverse proxy that handles HTTPS termination (Let's Encrypt) on ports 80/443 and acts as the sole internet-facing exposure point. Behind Nginx sits the API Gateway (Express, port 3000), which owns all cross-cutting concerns: request routing, JWT validation, RBAC checks and rate limiting. The Business tier comprises four independently deployable microservices — Auth, Staff, Research and Notification — on ports 3001–3004. The Data tier follows a strict Database-per-Service pattern: each service owns a private PostgreSQL instance, enforcing complete data isolation.

Live in production — Nginx + VPS + HTTPS at hau.bian.io.vn
Nginx · Let's Encrypt JWT Validation RBAC + ABAC Rate Limiting DB per Service

Shared Infrastructure

Cross-service infrastructure — event backbone, caching, file storage, email delivery and real-time channels — shared across the system but kept outside any single service's domain.

⚙️
Shared Infrastructure Components
Kafka · Redis · Cloudflare R2 · Gmail SMTP · Socket.io
Shared infrastructure diagram

Apache Kafka serves as the event backbone. Three services — Auth, Staff and Research — act as publishers; Notification Service is the sole consumer, processing all events to dispatch alerts. Redis is shared between Auth (refresh tokens, password-reset tokens, login lock counters) and Notification (unread-count cache). Cloudflare R2 — S3-compatible object storage — holds research PDFs and staff avatars, keeping binary assets out of PostgreSQL. Gmail SMTP is used by Notification Service to send transactional emails. Finally, Socket.io maintains bidirectional connections for real-time push notifications and force_logout events when an account is locked.

Kafka Producer × 3 Kafka Consumer × 1 Redis — Auth + Notif R2 Object Storage Socket.io Real-time Transactional Email

Kafka Event Flow

13 Kafka topics, each mapping to one business event — named in kebab-case following the entity-action convention, declared centrally, and referenced uniformly by all producers and the single consumer.

13 Business Event Topics
topics.ts · kebab-case · entity-action
Kafka event flow diagram

The system defines 13 Kafka topics, each corresponding to exactly one business event. Topics follow a kebab-case entity-action structure — for example research-approved or user-blocked — so each name is self-documenting and debuggable without extra docs. All topics live in a single topics.ts owned by Notification Service; the three producers import constants from it, ensuring naming consistency across the event mesh. Notification Service, the sole consumer, subscribes to all 13 topics and maps each to the appropriate handler.

research-approved research-rejected user-blocked staff-updated + 9 more topics topics.ts — single source of truth

Deployment & CI/CD

A fully automated, push-to-deploy pipeline. Every push to main triggers GitHub Actions to build Docker images, push them to Docker Hub, and deploy to a production VPS over SSH — served through Nginx with HTTPS at hau.bian.io.vn.

🚀
CI/CD Pipeline & Production Deployment
Push → GitHub Actions → Docker Hub → VPS

The whole system runs on a production VPS (Ubuntu), served at hau.bian.io.vn over HTTPS. A single Nginx reverse proxy terminates TLS (Let's Encrypt) and is the only port exposed to the internet — every microservice, database, Kafka and Redis stays private inside the Docker network. Deployment is fully automated with GitHub Actions: a path filter detects which service changed, builds only that image, and pushes it to Docker Hub. A deploy job then connects to the VPS over SSH, syncs the latest code, pulls the fresh images and restarts the stack with docker compose — a zero-touch, push-to-deploy workflow with no manual server steps. The same Nginx reverse proxy fronts both local development and production, giving an identical single-entry-point topology across environments — the two only differ in TLS and upstream targets.

01
git push
Push to main branch
02
Build
GitHub Actions builds changed service images
03
Push image
Images pushed to Docker Hub
04
SSH Deploy
Connect to VPS, pull + docker compose up
05
Live
Served via Nginx + HTTPS
GitHub Actions Docker Hub SSH Auto-Deploy Nginx + Let's Encrypt Path-filtered builds Same Nginx — dev & prod Zero-touch deploy

Feature Showcase

A selection of key screens from the web interface. Full source code is not publicly available pending the official academic defence.


Technical Highlights

Key architectural and engineering decisions that shaped the system.

🧩
Microservice Architecture
Four independently deployable services — Auth, Staff, Research, Notification — each with its own codebase and deployment unit.
Event-Driven via Kafka
13 business-event topics enable fully decoupled communication — producers emit, Notification Service reacts.
🔐
JWT + RBAC + ABAC
Layered authorisation: role-based checks at the Gateway, attribute-based checks within each service for fine-grained control.
🗄️
Database per Service
Complete data isolation — each PostgreSQL instance is private to its service, preventing cross-service coupling.
🔴
Redis Token Management
Refresh tokens, reset tokens and login lock counters stored in Redis for fast, TTL-aware in-memory access.
🐳
Docker + CI/CD Auto-Deploy
All services containerised. GitHub Actions builds images, pushes to Docker Hub and auto-deploys to the VPS via SSH on every push to main.
📡
Real-time with Socket.io
Bidirectional channels push live notifications and force_logout commands to connected clients without polling.
☁️
Cloudflare R2 Storage
S3-compatible object storage for research PDFs and staff avatars — offloading binary assets from relational databases.
📱
Cross-platform Client
A Next.js web admin and a React Native (Expo) mobile app share the same API Gateway interface, covering web and iOS/Android.