About me
Trang chủ là bản tóm tắt; tài liệu này là profile đầy đủ — stack, kiến trúc, và ví dụ code dùng Prism (đúng language, title, showLineNumbers, highlight dòng).
Software engineer với Java backbone: Spring services, API polyglot, frontend khi product cần. Code là phần của thiết kế — boundary rõ, contract ổn, vận hành được lúc 2h sáng.
Profile (java)
Developer.java
/**
* @author Vu Nguyen
* @role Java Developer / Backend Engineer
* @package dev.vunguyen
*/
public final class Developer implements Engineer {
private static final String NAME = "Vu Nguyen";
private static final String FOCUS =
"Enterprise apps, APIs, and maintainable systems";
private final List<String> stack = List.of(
"Java 21", "Spring Boot", "Spring Data JPA",
"Typescript", "VueJS", "React", "Next.js", "Tailwind CSS",
"Python", "Flask", "FastAPI", "Django", "Celery",
"Golang", "Gin", "Gorm",
"Rust", "Objective-C", "Swift",
"PostgreSQL", "Redis", "Kafka", "Docker", "Kubernetes",
"Git", "GitHub", "GitLab", "Bitbucket", "SVN",
"Linux", "Windows", "macOS", "iOS", "Android",
"AI", "LLM", "OpenAI", "Anthropic", "Deepseek"
);
@Override
public void dailyRoutine() {
while (isAlive()) {
drinkCoffee();
writeTestsFirst(); // highlight-next-line
refactorSafely();
documentWhatMatters();
}
}
public static void main(String[] args) {
new Developer().dailyRoutine();
}
}
Metadata (ví dụ json):
compile-time-facts.json
{
"package": "dev.vunguyen",
"author": "Vu Nguyen",
"location": "UTC+7",
"remote": true,
"focus": ["JVM services", "web apps", "AI-assisted workflows"]
}
Stack theo ngôn ngữ
Các fence dùng Prism language id đã đăng ký trong src/prism/additionalLanguages.ts (và typescript / javascript mặc định của Docusaurus).
JVM · java
OrderService.java
@Service
@Transactional
public class OrderService {
private final OrderRepository orders;
public OrderId placeOrder(PlaceOrderCommand cmd) {
var order = Order.create(cmd);
return orders.save(order).id();
}
}
Web · typescript
api-client.ts
export async function fetchProfile(): Promise<Profile> {
const res = await fetch('/api/v1/profile', {
headers: { Accept: 'application/json' },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json() as Promise<Profile>;
}
Python · python
health.py
from fastapi import FastAPI
app = FastAPI(title="dev.vunguyen")
@app.get("/health")
async def health() -> dict[str, str]:
return {"status": "ok"}
Go · go
main.go
func main() {
r := gin.Default()
r.GET("/health", func(c *gin.Context) {
c.JSON(200, gin.H{"status": "ok"})
})
r.Run(":8080")
}
Systems · rust
cache_key.rs
pub fn cache_key(tenant: &str, id: &str) -> String {
format!("tenant:{tenant}:entity:{id}")
}
Data & ops · sql · yaml · docker
orders-index.sql
CREATE INDEX CONCURRENTLY idx_orders_customer_created
ON orders (customer_id, created_at DESC)
WHERE deleted_at IS NULL;
docker-compose.snippet.yml
services:
api:
image: dev-vunguyen/api:latest
ports:
- "8080:8080"
environment:
SPRING_PROFILES_ACTIVE: prod
Dockerfile
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY build/libs/*.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
API contract · graphql · json
schema.graphql
type Query {
profile: Profile!
}
type Profile {
name: String!
stack: [String!]!
}
openapi-fragment.json
{
"paths": {
"/v1/orders": {
"post": {
"operationId": "placeOrder",
"responses": { "201": { "description": "Created" } }
}
}
}
}
Tooling · bash · diff
local-dev.sh
#!/usr/bin/env bash
set -euo pipefail
./gradlew bootRun &
npm run start
review.diff
- return repo.save(order);
+ return orders.save(order).id(); // success-next-line
Solution architecture (SA)
- Bounded context & ownership — tránh distributed monolith.
- Integration: REST/gRPC sync vs Kafka async; outbox khi cần consistency.
- NFR: availability, RPO/RTO — ghi ADR cho quyết định lớn.
- Platform: observability, identity, CI/CD golden paths.
- Evolution: strangler fig, feature flags, migration có checkpoint.
Context map (ví dụ yaml):
context-map.yaml
contexts:
ordering:
owner: checkout-team
integrations:
- billing: async-events
- catalog: sync-rest
billing:
owner: payments-team
System design
| Area | Topics |
|---|---|
| Scalability | Stateless services, cache, read replicas |
| Data | Indexing, idempotency, CDC |
| Messaging | Kafka, retry/DLQ, outbox |
| Resilience | Timeout, circuit breaker, bulkhead |
| Security | Least privilege, secrets rotation |
Resilience sketch (java + highlight khối):
ResilientClient.java
public final class ResilientClient {
public Response call(Request req) {
return breaker.executeSupplier(() ->
http.post("/resource", req)
.withTimeout(Duration.ofSeconds(2))
);
}
}
Design patterns
| Nhóm | Ví dụ |
|---|---|
| Structural | Adapter, Facade tách domain khỏi framework |
| Behavioral | Strategy, Observer |
| Integration | BFF, Gateway, Saga / process manager |
| Persistence | Repository, optimistic locking |
StrategyExample.java
public interface PricingStrategy {
Money price(Order order);
}
public class CheckoutService {
private final PricingStrategy pricing; // highlight-next-line
public Receipt checkout(Cart cart) {
var total = pricing.price(cart.toOrder());
return Receipt.of(total);
}
}
Best practices
- Testing pyramid: unit → integration → contract.
- Observability: structured logs, trace id, RED metrics.
- Delivery: short-lived branches, rollback plan.
- Docs: README, ADR, runbook.
CI snippet (bash):
ci-check.sh
./gradlew test jacocoTestReport
npm run typecheck
npm run build
Config app (toml):
app.toml
[observability]
metrics_path = "/actuator/prometheus"
trace_sampling = 0.1
Principles
| Principle | Gợi ý ngắn |
|---|---|
| SOLID | Một lý do để đổi; phụ thuộc abstraction |
| DRY | Không duplicate knowledge |
| KISS / YAGNI | Đơn giản đủ dùng |
| Fail fast | Validate sớm, lỗi rõ |
| Operability | Debug được khi incident |
| Secure by default | Deny by default |
EngineeringPrinciples.java
public interface EngineeringPrinciples {
default void beforeMerge() {
requireTests();
requireReadableDiff();
// skipObservability(); — không merge nếu thiếu hook
requireObservabilityHook(); // success-next-line
}
}
On this site
| Section | Purpose |
|---|---|
| Home | About me landing |
| Showcase | Projects & experiments |
| Blog | Tutorials, system design, ADR |
Ghi chú Prism trong MDX
- Fence:
```<language> title="File.ext" showLineNumbers— id đúng:go(khônggolang),bash(khôngshell). - Highlight một dòng:
// highlight-next-line(Java/TS),# highlight-next-line(Python). - Khối:
// highlight-start…// highlight-end. - Dòng lỗi / OK:
// error-next-line,// success-next-line. - Chọn dòng bằng metastring:
```java {9-11}.
Blog và showcase sẽ mở rộng các mẫu trên — ADR, service design, trade-off production.