Skip to content

Commit c856902

Browse files
authored
refactor: platform structure (#809)
* refactor: platform structure * fix: turbo json
1 parent dd9ac21 commit c856902

1,499 files changed

Lines changed: 4904 additions & 5172 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.

.github/workflows/build.yml

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,61 +8,60 @@ on:
88
- "main"
99

1010
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
1515

16-
- name: Setup pnpm
17-
uses: pnpm/action-setup@v4
18-
with:
19-
version: 10.25.0
20-
run_install: false
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
with:
19+
version: 10.25.0
20+
run_install: false
2121

22-
- name: Setup Node.js
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: 22.x
26-
cache: 'pnpm'
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22.x
26+
cache: "pnpm"
2727

28-
- name: Install build dependencies
29-
run: |
30-
sudo apt-get update
31-
sudo apt-get install -y build-essential python3
28+
- name: Install build dependencies
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install -y build-essential python3
3232
33-
- name: Setup environment variables
34-
run: |
35-
# Always copy .env.example to .env before builds to ensure env vars are available
36-
# Root level .env
37-
if [ -f .env.example ]; then
38-
cp .env.example .env
39-
echo "✅ Created root .env from .env.example"
40-
else
41-
echo "⚠️ Warning: root .env.example not found, creating minimal .env"
42-
touch .env
43-
fi
44-
45-
# Package-level .env files (e.g., blabsy)
46-
for dir in platforms/* infrastructure/*; do
47-
if [ -d "$dir" ] && [ -f "$dir/.env.example" ]; then
48-
cp "$dir/.env.example" "$dir/.env"
49-
echo "✅ Created $dir/.env from $dir/.env.example"
50-
fi
51-
done
33+
- name: Setup environment variables
34+
run: |
35+
# Always copy .env.example to .env before builds to ensure env vars are available
36+
# Root level .env
37+
if [ -f .env.example ]; then
38+
cp .env.example .env
39+
echo "✅ Created root .env from .env.example"
40+
else
41+
echo "⚠️ Warning: root .env.example not found, creating minimal .env"
42+
touch .env
43+
fi
5244
53-
- name: Install Dependencies
54-
run: |
55-
# Install all dependencies (optional dependencies are installed by default)
56-
# Use --frozen-lockfile to ensure reproducible builds
57-
pnpm install --frozen-lockfile
58-
59-
- name: Rebuild native modules
60-
run: |
61-
# Rebuild native modules to ensure compatibility with CI environment
62-
pnpm rebuild || echo "Rebuild completed with warnings (some packages may not need rebuilding)"
45+
# Package-level .env files (e.g., blabsy)
46+
for dir in platforms/*/* infrastructure/*; do
47+
if [ -d "$dir" ] && [ -f "$dir/.env.example" ]; then
48+
cp "$dir/.env.example" "$dir/.env"
49+
echo "✅ Created $dir/.env from $dir/.env.example"
50+
fi
51+
done
6352
64-
- name: Build All Packages
65-
run: |
66-
# Build all packages using turbo
67-
pnpm build
53+
- name: Install Dependencies
54+
run: |
55+
# Install all dependencies (optional dependencies are installed by default)
56+
# Use --frozen-lockfile to ensure reproducible builds
57+
pnpm install --frozen-lockfile
6858
59+
- name: Rebuild native modules
60+
run: |
61+
# Rebuild native modules to ensure compatibility with CI environment
62+
pnpm rebuild || echo "Rebuild completed with warnings (some packages may not need rebuilding)"
63+
64+
- name: Build All Packages
65+
run: |
66+
# Build all packages using turbo
67+
pnpm build
Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,53 @@
11
name: Tests [registry]
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
8-
paths:
9-
- 'platforms/registry/**'
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
paths:
9+
- "platforms/registry/api/**"
1010

1111
jobs:
12-
test:
13-
runs-on: ubuntu-latest
14-
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: Set up Node.js 22
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: 22
23-
24-
- name: Install build dependencies
25-
run: |
26-
sudo apt-get update
27-
sudo apt-get install -y build-essential python3
28-
29-
- name: Install pnpm
30-
run: npm install -g pnpm
31-
32-
- name: Install dependencies
33-
run: pnpm install
34-
35-
- name: Clean and rebuild ssh2 native module
36-
run: |
37-
# Remove any pre-built binaries that might be incompatible
38-
find node_modules -name "sshcrypto.node" -delete 2>/dev/null || true
39-
find node_modules -path "*/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node" -delete 2>/dev/null || true
40-
# Rebuild ssh2 specifically for this platform
41-
pnpm rebuild ssh2
42-
# Rebuild all other native modules
43-
pnpm rebuild
44-
45-
- name: Run tests
46-
env:
47-
CI: true
48-
GITHUB_ACTIONS: true
49-
DOCKER_HOST: unix:///var/run/docker.sock
50-
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
51-
TESTCONTAINERS_RYUK_DISABLED: false
52-
TESTCONTAINERS_HOST_OVERRIDE: localhost
53-
run: pnpm -F=registry test
54-
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js 22
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
24+
- name: Install build dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y build-essential python3
28+
29+
- name: Install pnpm
30+
run: npm install -g pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install
34+
35+
- name: Clean and rebuild ssh2 native module
36+
run: |
37+
# Remove any pre-built binaries that might be incompatible
38+
find node_modules -name "sshcrypto.node" -delete 2>/dev/null || true
39+
find node_modules -path "*/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node" -delete 2>/dev/null || true
40+
# Rebuild ssh2 specifically for this platform
41+
pnpm rebuild ssh2
42+
# Rebuild all other native modules
43+
pnpm rebuild
44+
45+
- name: Run tests
46+
env:
47+
CI: true
48+
GITHUB_ACTIONS: true
49+
DOCKER_HOST: unix:///var/run/docker.sock
50+
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
51+
TESTCONTAINERS_RYUK_DISABLED: false
52+
TESTCONTAINERS_HOST_OVERRIDE: localhost
53+
run: pnpm -F=registry test

README.md

Lines changed: 17 additions & 6 deletions

docker/Dockerfile.blabsy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ RUN pnpm turbo build --filter=blabsy
2626
# ---
2727
FROM base AS runner
2828
# Copy built application
29-
COPY --from=builder /app/platforms/blabsy/package.json ./
30-
COPY --from=builder /app/platforms/blabsy/.next ./.next
31-
COPY --from=builder /app/platforms/blabsy/public ./public
32-
COPY --from=builder /app/platforms/blabsy/next.config.ts ./
33-
COPY --from=builder /app/platforms/blabsy/node_modules ./node_modules
29+
COPY --from=builder /app/platforms/blabsy/client/package.json ./
30+
COPY --from=builder /app/platforms/blabsy/client/.next ./.next
31+
COPY --from=builder /app/platforms/blabsy/client/public ./public
32+
COPY --from=builder /app/platforms/blabsy/client/next.config.ts ./
33+
COPY --from=builder /app/platforms/blabsy/client/node_modules ./node_modules
3434

3535
EXPOSE 8080
3636
ENV NODE_ENV=production

docker/Dockerfile.blabsy-w3ds-auth-api

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ COPY --from=builder /app/pnpm-lock.yaml ./
3939
COPY --from=builder /app/infrastructure ./infrastructure
4040

4141
# Copy blabsy-w3ds-auth-api
42-
COPY --from=builder /app/platforms/blabsy-w3ds-auth-api/dist ./dist
43-
COPY --from=builder /app/platforms/blabsy-w3ds-auth-api/package.json ./
44-
COPY --from=builder /app/platforms/blabsy-w3ds-auth-api/node_modules ./node_modules
42+
COPY --from=builder /app/platforms/blabsy/api/dist ./dist
43+
COPY --from=builder /app/platforms/blabsy/api/package.json ./
44+
COPY --from=builder /app/platforms/blabsy/api/node_modules ./node_modules
4545

4646
# Copy root node_modules
4747
COPY --from=builder /app/node_modules ./node_modules
4848

49-
WORKDIR /app/platforms/blabsy-w3ds-auth-api
49+
WORKDIR /app/platforms/blabsy/api
5050

5151
EXPOSE 3000
5252
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \

docker/Dockerfile.pictique

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ RUN pnpm turbo build --filter=pictique
2626
# ---
2727
FROM base AS runner
2828
# Copy built application
29-
COPY --from=builder /app/platforms/pictique/build ./build
30-
COPY --from=builder /app/platforms/pictique/package.json ./
31-
COPY --from=builder /app/platforms/pictique/node_modules ./node_modules
29+
COPY --from=builder /app/platforms/pictique/client/build ./build
30+
COPY --from=builder /app/platforms/pictique/client/package.json ./
31+
COPY --from=builder /app/platforms/pictique/client/node_modules ./node_modules
3232

3333
EXPOSE 5173
3434
ENV NODE_ENV=production

docker/Dockerfile.pictique-api

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ COPY --from=builder /app/pnpm-lock.yaml ./
3838
COPY --from=builder /app/infrastructure ./infrastructure
3939

4040
# Copy pictique-api
41-
COPY --from=builder /app/platforms/pictique-api/dist ./dist
42-
COPY --from=builder /app/platforms/pictique-api/package.json ./
43-
COPY --from=builder /app/platforms/pictique-api/node_modules ./node_modules
41+
COPY --from=builder /app/platforms/pictique/api/dist ./dist
42+
COPY --from=builder /app/platforms/pictique/api/package.json ./
43+
COPY --from=builder /app/platforms/pictique/api/node_modules ./node_modules
4444

4545
# Copy root node_modules
4646
COPY --from=builder /app/node_modules ./node_modules
4747

48-
WORKDIR /app/platforms/pictique-api
48+
WORKDIR /app/platforms/pictique/api
4949

5050
EXPOSE 1111
5151
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \

docker/Dockerfile.registry

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ COPY --from=builder /app/package.json ./
3030
COPY --from=builder /app/pnpm-workspace.yaml ./
3131
COPY --from=builder /app/pnpm-lock.yaml ./
3232
# Copy built application
33-
COPY --from=builder /app/platforms/registry/dist ./dist
34-
COPY --from=builder /app/platforms/registry/package.json ./
35-
COPY --from=builder /app/platforms/registry/motd.json ./
36-
COPY --from=builder /app/platforms/registry/node_modules ./node_modules
33+
COPY --from=builder /app/platforms/registry/api/dist ./dist
34+
COPY --from=builder /app/platforms/registry/api/package.json ./
35+
COPY --from=builder /app/platforms/registry/api/motd.json ./
36+
COPY --from=builder /app/platforms/registry/api/node_modules ./node_modules
3737
COPY --from=builder /app/node_modules ./node_modules
3838

3939
EXPOSE 4321
File renamed without changes.

0 commit comments

Comments
 (0)