Skip to content

Commit b473bdd

Browse files
authored
unify mail service and user service (#3)
* reorganize mail service and user service under unified * bridge services * enable service to run as one * minor fixes * Move start.sh
1 parent 5ad694c commit b473bdd

File tree

69 files changed

+218
-772
lines changed

Some content is hidden

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

69 files changed

+218
-772
lines changed

docker-compose.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ services:
1111
- midnight-network
1212
depends_on:
1313
- lark-ui
14-
- user-service
15-
- mail-service
14+
- unified-service
1615

1716
# Frontend UI - SvelteKit Application
1817
lark-ui:
@@ -28,35 +27,21 @@ services:
2827
expose:
2928
- "5173"
3029

31-
# User Service - NestJS API
32-
user-service:
30+
# Unified Service - NestJS API
31+
unified-service:
3332
build:
3433
context: .
35-
dockerfile: ./owl-api/user-service/Dockerfile
34+
dockerfile: ./owl-api/unified-service/Dockerfile
3635
environment:
3736
- NODE_ENV=production
3837
- PORT=3002
39-
- MAIL_SERVICE_URL=http://mail-service:3003
38+
- MAIL_SERVICE_URL=http://unified-service:3002
4039
restart: unless-stopped
4140
networks:
4241
- midnight-network
4342
expose:
4443
- "3002"
4544

46-
# Mail Service - NestJS API
47-
mail-service:
48-
build:
49-
context: .
50-
dockerfile: ./owl-api/mail-service/Dockerfile
51-
environment:
52-
- NODE_ENV=production
53-
- MAIL_SERVICE_PORT=3003
54-
restart: unless-stopped
55-
networks:
56-
- midnight-network
57-
expose:
58-
- "3003"
59-
6045
networks:
6146
midnight-network:
6247
driver: bridge

gateway/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ FROM base AS runner
1818
WORKDIR /app
1919
ENV NODE_ENV=production
2020
ENV PORT=3000
21-
ENV USER_SERVICE_URL=http://user-service:3002
22-
ENV MAIL_SERVICE_URL=http://mail-service:3003
21+
ENV USER_SERVICE_URL=http://unified-service:3002
22+
ENV MAIL_SERVICE_URL=http://unified-service:3002
2323
ENV UI_SERVICE_URL=http://lark-ui:5173
2424

2525
RUN addgroup --system --gid 1001 nodejs

gateway/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (process.env.NODE_ENV !== 'production') {
1111
const app = express();
1212
const PORT = process.env.PORT || 3000;
1313
const USER_SERVICE_URL = process.env.USER_SERVICE_URL || 'http://localhost:3002';
14-
const MAIL_SERVICE_URL = process.env.MAIL_SERVICE_URL || 'http://localhost:3003';
14+
const MAIL_SERVICE_URL = process.env.MAIL_SERVICE_URL || 'http://localhost:3002';
1515
const UI_SERVICE_URL = process.env.UI_SERVICE_URL || 'http://localhost:5173';
1616

1717
app.use(cors());
@@ -73,7 +73,7 @@ app.use('/', createProxyMiddleware({
7373
app.listen(PORT, () => {
7474
console.log(`🌙 Gateway ready at http://localhost:${PORT}`);
7575
console.log(` / → UI (${UI_SERVICE_URL})`);
76-
console.log(` /api/user/* → User Service (${USER_SERVICE_URL})`);
76+
console.log(` /api/* → Unified Service (${USER_SERVICE_URL})`);
7777
console.log(` Mail Service (${MAIL_SERVICE_URL}) - Internal only`);
7878
});
7979

owl-api/mail-service/Dockerfile

Lines changed: 0 additions & 37 deletions
This file was deleted.

owl-api/mail-service/eslint.config.mjs

Lines changed: 0 additions & 35 deletions
This file was deleted.

owl-api/mail-service/package.json

Lines changed: 0 additions & 91 deletions
This file was deleted.

owl-api/mail-service/prisma/migrations/20251020000000_init/migration.sql

Lines changed: 0 additions & 19 deletions
This file was deleted.

owl-api/mail-service/prisma/schema.prisma

Lines changed: 0 additions & 77 deletions
This file was deleted.

owl-api/mail-service/src/app.module.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

owl-api/mail-service/src/main.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)