Skip to content

Commit 6470a5c

Browse files
committed
Refactor server into modular axumkit workspace
Split the monolithic server crate into multiple focused crates: axumkit-server, axumkit-dto, axumkit-entity, axumkit-errors, axumkit-constants, and axumkit-worker. Migrated and reorganized code, DTOs, entities, errors, and services into their respective crates. Updated project structure, added Docker support, and revised migration files. This modularization improves maintainability, testability, and separation of concerns.
1 parent c070ca0 commit 6470a5c

494 files changed

Lines changed: 15543 additions & 6199 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.local.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"mcp__serena__get_symbols_overview",
77
"mcp__serena__find_symbol",
88
"mcp__serena__write_memory",
9-
"mcp__serena__search_for_pattern"
9+
"mcp__serena__search_for_pattern",
10+
"Bash(find:*)",
11+
"Bash(cargo check:*)"
1012
],
1113
"deny": [],
1214
"ask": []

.dockerignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Rust build artifacts
2+
target/
3+
**/target/
4+
5+
# Git
6+
.git/
7+
.gitignore
8+
9+
# IDEs
10+
.vscode/
11+
.idea/
12+
*.swp
13+
*.swo
14+
*~
15+
16+
# Environment files
17+
.env
18+
.env.*
19+
!.env.example
20+
21+
# Documentation
22+
*.md
23+
!README.md
24+
docs/
25+
26+
# CI/CD
27+
.github/
28+
29+
# Tests
30+
tests/
31+
e2e/
32+
test-ui/
33+
34+
# Python (worker) - exclude entire directory for Rust build
35+
worker/
36+
37+
# Node (if any)
38+
node_modules/
39+
**/node_modules/
40+
**/.pnpm-store/
41+
pnpm-lock.yaml
42+
package-lock.json
43+
npm-debug.log
44+
yarn-error.log
45+
46+
# OS
47+
.DS_Store
48+
Thumbs.db
49+
50+
# Docker
51+
Dockerfile
52+
.dockerignore
53+
docker-compose*.yml
54+
55+
# Logs
56+
*.log
57+
logs/
58+
59+
# Temporary files
60+
tmp/
61+
temp/
62+
63+
# MCP
64+
.serena/
65+
.claude/
66+
.mcp.json
67+
68+
# Project specific
69+
docker_env/
70+
swagger.json
71+
nul
72+
73+
# Keep Cargo.lock for reproducible builds
74+
!Cargo.lock
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust CI - Release
1+
name: axumkit-server
22

33
on:
44
push:
@@ -10,15 +10,20 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

13+
defaults:
14+
run:
15+
working-directory: .
16+
1317
steps:
1418
- uses: actions/checkout@v3
19+
1520
- uses: actions-rs/toolchain@v1
1621
with:
1722
toolchain: stable
1823
override: true
1924

2025
- name: Cache Cargo dependencies
21-
uses: actions/cache@v4
26+
uses: actions/cache@v3
2227
with:
2328
path: |
2429
~/.cargo/registry
@@ -27,5 +32,4 @@ jobs:
2732
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2833

2934
- name: Release Build
30-
working-directory: ./
3135
run: cargo build --release

.github/workflows/docker.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Docker Build & Push
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
12+
jobs:
13+
build:
14+
# 태그 push는 항상, PR은 [e2e] 있을 때만
15+
if: |
16+
github.event_name == 'push'
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to Container Registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
# Server image metadata
37+
- name: Extract server metadata
38+
id: meta-server
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ github.repository }}
42+
tags: |
43+
type=ref,event=branch
44+
type=ref,event=pr
45+
type=semver,pattern={{version}}
46+
type=semver,pattern={{major}}.{{minor}}
47+
type=raw,value=latest,enable={{is_default_branch}}
48+
49+
# Worker image metadata
50+
- name: Extract worker metadata
51+
id: meta-worker
52+
uses: docker/metadata-action@v5
53+
with:
54+
images: ${{ env.REGISTRY }}/${{ github.repository }}-worker
55+
tags: |
56+
type=ref,event=branch
57+
type=ref,event=pr
58+
type=semver,pattern={{version}}
59+
type=semver,pattern={{major}}.{{minor}}
60+
type=raw,value=latest,enable={{is_default_branch}}
61+
62+
# Build and push server image
63+
- name: Build and push Server image
64+
uses: docker/build-push-action@v5
65+
with:
66+
context: .
67+
file: ./Dockerfile
68+
target: server-runtime
69+
push: true
70+
tags: ${{ steps.meta-server.outputs.tags }}
71+
labels: ${{ steps.meta-server.outputs.labels }}
72+
cache-from: type=gha
73+
cache-to: type=gha,mode=max
74+
platforms: linux/amd64
75+
76+
# Build and push worker image (uses cached builder stage)
77+
- name: Build and push Worker image
78+
uses: docker/build-push-action@v5
79+
with:
80+
context: .
81+
file: ./Dockerfile
82+
target: worker-runtime
83+
push: true
84+
tags: ${{ steps.meta-worker.outputs.tags }}
85+
labels: ${{ steps.meta-worker.outputs.labels }}
86+
cache-from: type=gha
87+
cache-to: type=gha,mode=max
88+
platforms: linux/amd64
89+
90+
- name: Build summary
91+
if: github.event_name != 'pull_request'
92+
run: |
93+
echo "## 📦 Packages Published" >> $GITHUB_STEP_SUMMARY
94+
echo "" >> $GITHUB_STEP_SUMMARY
95+
echo "Docker images have been published to GitHub Container Registry:" >> $GITHUB_STEP_SUMMARY
96+
echo "" >> $GITHUB_STEP_SUMMARY
97+
echo "### Server" >> $GITHUB_STEP_SUMMARY
98+
echo '```bash' >> $GITHUB_STEP_SUMMARY
99+
echo "docker pull ${{ env.REGISTRY }}/${{ github.repository }}:latest" >> $GITHUB_STEP_SUMMARY
100+
echo '```' >> $GITHUB_STEP_SUMMARY
101+
echo "" >> $GITHUB_STEP_SUMMARY
102+
echo "### Worker" >> $GITHUB_STEP_SUMMARY
103+
echo '```bash' >> $GITHUB_STEP_SUMMARY
104+
echo "docker pull ${{ env.REGISTRY }}/${{ github.repository }}-worker:latest" >> $GITHUB_STEP_SUMMARY
105+
echo '```' >> $GITHUB_STEP_SUMMARY
106+
107+
test:
108+
# PR에서 [e2e] 없을 때만 빌드 테스트 (push 안 함)
109+
if: |
110+
github.event_name == 'pull_request' &&
111+
!contains(github.event.pull_request.title, '[e2e]') &&
112+
!contains(github.event.pull_request.body, '[e2e]')
113+
runs-on: ubuntu-latest
114+
115+
steps:
116+
- name: Checkout repository
117+
uses: actions/checkout@v4
118+
119+
- name: Set up Docker Buildx
120+
uses: docker/setup-buildx-action@v3
121+
122+
- name: Build test server image
123+
uses: docker/build-push-action@v5
124+
with:
125+
context: .
126+
file: ./Dockerfile
127+
target: server-runtime
128+
load: true
129+
tags: V7-server:test
130+
cache-from: type=gha
131+
132+
- name: Build test worker image
133+
uses: docker/build-push-action@v5
134+
with:
135+
context: .
136+
file: ./Dockerfile
137+
target: worker-runtime
138+
load: true
139+
tags: V7-worker:test
140+
cache-from: type=gha
141+
142+
- name: Test Docker images
143+
run: |
144+
echo "Testing Docker images..."
145+
docker images V7-server:test
146+
docker images V7-worker:test
147+
echo "✅ Docker images built successfully"

.github/workflows/e2e-tests.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
e2e:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Install Rust
23+
uses: dtolnay/rust-toolchain@stable
24+
25+
- name: Cache Rust dependencies
26+
uses: Swatinem/rust-cache@v2
27+
with:
28+
workspaces: "."
29+
30+
- name: Run E2E tests
31+
run: cargo test -p e2e -- --nocapture --test-threads=1

.gitignore

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1-
/target
2-
.idea
3-
.env
1+
nul
2+
3+
# Generated by Cargo
4+
# will have compiled files and executables
5+
debug
6+
target
7+
8+
# These are backup files generated by rustfmt
9+
**/*.rs.bk
10+
11+
# MSVC Windows builds of rustc generate these, which store debugging information
12+
*.pdb
13+
14+
# Generated by cargo mutants
15+
# Contains mutation testing data
16+
**/mutants.out*/
17+
18+
# RustRover
19+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
20+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
21+
# and can be added to the global gitignore or merged into this file. For a more nuclear
22+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
23+
.idea/
24+
*.env
25+
!e2e/e2e_env/*.env
26+
docker.env
27+
docker_env/
28+
logs
29+
reference
30+
31+
# k8s secrets (contains sensitive data)
32+
k8s/overlays/*/secrets/

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

0 commit comments

Comments
 (0)