Skip to content

Commit d8b9615

Browse files
authored
Add Dockerfiles and GitHub Actions workflow for building and publishing PR images (#9)
* Add Dockerfiles and GitHub Actions workflow for building and publishing PR images * Refactor GitHub Actions workflow to build and publish PR images, updating triggers to pull requests and removing unnecessary steps for tag handling. * Update GitHub Actions workflow to use latest Docker actions for Buildx and login * Update Docker Build-Push Action to version 6 in GitHub Actions workflow * Fix Dockerfile references from api-gateway to api for consistency in build process * Remove GitHub NPM token and registry arguments from Dockerfile for security and simplicity * Refactor GitHub Actions workflow to trigger on push events and build images for API Gateway, API, and Web, removing unnecessary GitHub NPM token arguments for improved security and simplicity. * fix docker build and the workflow * fix docker build and the workflow * new code from mark-old repo * formatting * removing unnecessary workflows, updating docker files, and cleaning merging prisma migrations to one migration script
1 parent a07a33a commit d8b9615

File tree

346 files changed

+62932
-9839
lines changed

Some content is hidden

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

346 files changed

+62932
-9839
lines changed

.env.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ PORT= # e.g. 3010
77

88
# ────── Back-end API ──────
99
API_PORT= # e.g. 4222
10-
1110
# ────── API Gateway ──────
1211
API_GATEWAY_PORT= # e.g. 8000
1312
API_GATEWAY_HOST= # e.g. http://localhost:8000

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pids
1111
*.seed
1212
*.pid.lock
1313

14+
1415
# to insure no accidental commits of the seed file or mock jwt file
1516
seed.sql
1617
staging-seed.sql
@@ -59,17 +60,17 @@ typings/
5960
.yarn-integrity
6061

6162
# dotenv environment variables file
62-
.env
63+
*.env
6364
dev.env
6465
dev.op.env
65-
.env.local
6666
.env.merged
6767
.env.op.local
6868

69+
*.env
70+
.env.local
6971

7072
# local configs
7173
config/local
72-
7374
# typescript
7475
*.tsbuildinfo
7576
next-env.d.ts
@@ -103,3 +104,4 @@ dist/
103104
.turbo/
104105
out/
105106
.idea/whitesource/WebStormUsageMetrics.txt
107+
.specstory/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ coverage
44
./husky/_/
55
**/.github/workflows/*
66
helm-chart
7+
yarn.lock
78
node_modules
89
docs/
910
.vscode

.secrets.baseline

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"exclude": {
3-
"files": "^.secrets.baseline$",
3+
"files": null,
44
"lines": null
55
},
6-
"generated_at": "2025-05-03T07:35:06Z",
6+
"generated_at": "2025-07-28T14:48:09Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -81,7 +81,7 @@
8181
{
8282
"hashed_secret": "d08f88df745fa7950b104e4a707a31cfce7b5841",
8383
"is_verified": false,
84-
"line_number": 22,
84+
"line_number": 21,
8585
"type": "Secret Keyword",
8686
"verified_result": null
8787
}
@@ -95,27 +95,18 @@
9595
"verified_result": null
9696
}
9797
],
98-
"apps/api-gateway/Dockerfile": [
99-
{
100-
"hashed_secret": "f38ff65b69de46549b49035293fb9ced5f89a071",
101-
"is_verified": false,
102-
"line_number": 13,
103-
"type": "NPM tokens",
104-
"verified_result": null
105-
}
106-
],
10798
"apps/api-gateway/src/api/api.service.ts": [
10899
{
109100
"hashed_secret": "bb27330ad8e4418fd1545f76c797f9e495ced3f1",
110101
"is_verified": false,
111-
"line_number": 61,
102+
"line_number": 62,
112103
"type": "Secret Keyword",
113104
"verified_result": null
114105
},
115106
{
116107
"hashed_secret": "5df614d5ca1ea5b297766ca8fc7825aae5b71cb2",
117108
"is_verified": false,
118-
"line_number": 62,
109+
"line_number": 63,
119110
"type": "Secret Keyword",
120111
"verified_result": null
121112
}
@@ -129,12 +120,12 @@
129120
"verified_result": null
130121
}
131122
],
132-
"apps/api/Dockerfile": [
123+
"apps/api/src/api/attempt/services/file-content-extraction.ts": [
133124
{
134-
"hashed_secret": "f38ff65b69de46549b49035293fb9ced5f89a071",
125+
"hashed_secret": "2c0580ffd7d80319531cf629f5e90f747b1386f1",
135126
"is_verified": false,
136-
"line_number": 14,
137-
"type": "NPM tokens",
127+
"line_number": 2468,
128+
"type": "Secret Keyword",
138129
"verified_result": null
139130
}
140131
],
@@ -165,20 +156,20 @@
165156
"verified_result": null
166157
}
167158
],
168-
"apps/web/Dockerfile": [
159+
"apps/web/app/api/markChat/route.ts": [
169160
{
170-
"hashed_secret": "f38ff65b69de46549b49035293fb9ced5f89a071",
161+
"hashed_secret": "3f70a0183ead614880b70bff64fd39c0d9155d62",
171162
"is_verified": false,
172-
"line_number": 14,
173-
"type": "NPM tokens",
163+
"line_number": 8,
164+
"type": "Secret Keyword",
174165
"verified_result": null
175166
}
176167
],
177-
"apps/web/app/api/markChat/route.ts": [
168+
"apps/web/app/api/markChat/services/reportingService.ts": [
178169
{
179-
"hashed_secret": "3f70a0183ead614880b70bff64fd39c0d9155d62",
170+
"hashed_secret": "d3ecb0d890368d7659ee54010045b835dacb8efe",
180171
"is_verified": false,
181-
"line_number": 9,
172+
"line_number": 62,
182173
"type": "Secret Keyword",
183174
"verified_result": null
184175
}
@@ -187,7 +178,7 @@
187178
{
188179
"hashed_secret": "60634a9040f4a588cd5ec80391507a208c79cf00",
189180
"is_verified": false,
190-
"line_number": 7,
181+
"line_number": 6,
191182
"type": "Secret Keyword",
192183
"verified_result": null
193184
}
@@ -205,7 +196,7 @@
205196
{
206197
"hashed_secret": "cfb93ca9f329289d5f23de2b0e065103b81a374c",
207198
"is_verified": false,
208-
"line_number": 166,
199+
"line_number": 158,
209200
"type": "Secret Keyword",
210201
"verified_result": null
211202
}
@@ -214,14 +205,14 @@
214205
{
215206
"hashed_secret": "f0c5bc5473fd2f959bdac630e625aa33346fd12a",
216207
"is_verified": false,
217-
"line_number": 166,
208+
"line_number": 162,
218209
"type": "Secret Keyword",
219210
"verified_result": null
220211
},
221212
{
222213
"hashed_secret": "ee977806d7286510da8b9a7492ba58e2484c0ecc",
223214
"is_verified": false,
224-
"line_number": 183,
215+
"line_number": 177,
225216
"type": "Secret Keyword",
226217
"verified_result": null
227218
}
@@ -230,21 +221,30 @@
230221
{
231222
"hashed_secret": "e1166e6dd837019ab04f130ab34c425e04161645",
232223
"is_verified": false,
233-
"line_number": 88,
224+
"line_number": 380,
234225
"type": "Secret Keyword",
235226
"verified_result": null
236227
},
237228
{
238229
"hashed_secret": "f0c5bc5473fd2f959bdac630e625aa33346fd12a",
239230
"is_verified": false,
240-
"line_number": 138,
231+
"line_number": 427,
241232
"type": "Secret Keyword",
242233
"verified_result": null
243234
},
244235
{
245236
"hashed_secret": "29080f1c58f9859ddaa6aeda7d2c410c12e222dc",
246237
"is_verified": false,
247-
"line_number": 171,
238+
"line_number": 459,
239+
"type": "Secret Keyword",
240+
"verified_result": null
241+
}
242+
],
243+
"apps/web/lib/shared.ts": [
244+
{
245+
"hashed_secret": "d3ecb0d890368d7659ee54010045b835dacb8efe",
246+
"is_verified": false,
247+
"line_number": 996,
248248
"type": "Secret Keyword",
249249
"verified_result": null
250250
}
@@ -262,14 +262,14 @@
262262
{
263263
"hashed_secret": "1c2b0d17c738509518ecc6efa233ee6c10e724f2",
264264
"is_verified": false,
265-
"line_number": 166,
265+
"line_number": 225,
266266
"type": "Basic Auth Credentials",
267267
"verified_result": null
268268
},
269269
{
270270
"hashed_secret": "f6b2b77f83ae6122acb0954c6502cf87b2c097c3",
271271
"is_verified": false,
272-
"line_number": 206,
272+
"line_number": 265,
273273
"type": "Secret Keyword",
274274
"verified_result": null
275275
}

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
nodejs 20.19.2
1+
nodejs 23.11.0
22
yarn 1.22.22

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,33 +63,27 @@ The Mark System is built on a modular, domain-driven architecture that separates
6363
Mark System V2 represents a significant evolution from the original architecture, with improvements in:
6464

6565
1. **Repository Pattern Implementation**:
66-
6766
- Centralized data access logic
6867
- Improved testability and maintainability
6968

7069
2. **Service Modularity**:
71-
7270
- Specialized service components
7371
- Clear boundaries of responsibility
7472

7573
3. **Enhanced Error Handling**:
76-
7774
- Structured logging with stack traces
7875
- Error categorization and recovery strategies
7976

8077
4. **Concurrency Management**:
81-
8278
- Rate limiting with Bottleneck
8379
- Queue management for high-load operations
8480

8581
5. **Intelligent Processing**:
86-
8782
- Content change detection
8883
- Avoiding redundant operations
8984
- Batch processing for efficiency
9085

9186
6. **Progress Tracking**:
92-
9387
- Detailed job status reporting
9488
- Percentage-based completion indicators
9589

@@ -318,7 +312,6 @@ class NATS,GHAPI externalLayer
318312
319313
```
320314

321-
322315
## Acknowledgments
323316

324317
- NestJS Team for the excellent framework

apps/api-gateway/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1+
# local-test/api-gateway.Dockerfile
12
# Using a consistent base for all stages
2-
ARG BASE_IMAGE=icr.io/skills-network/node:20
3+
ARG BASE_IMAGE=node:22-alpine
34
FROM ${BASE_IMAGE} AS builder
45

5-
ARG SN_GITHUB_NPM_TOKEN
6-
ARG SN_GITHUB_NPM_REGISTRY=https://npm.pkg.github.com
76
ARG DIR=/usr/src/app
87

98
# Pruning using turbo
109
WORKDIR $DIR
1110
COPY . .
1211
RUN yarn global add turbo@^2.0.3
13-
RUN echo "@ibm-skills-network:registry=$SN_GITHUB_NPM_REGISTRY" >> .npmrc && echo "//npm.pkg.github.com/:_authToken=$SN_GITHUB_NPM_TOKEN" >> .npmrc
1412
RUN turbo prune api-gateway --docker && rm -f .npmrc
1513

1614
# Installing the isolated workspace
@@ -37,7 +35,7 @@ FROM ${BASE_IMAGE} AS production
3735
ARG DIR=/usr/src/app
3836
ENV NODE_ENV production
3937
WORKDIR $DIR
40-
RUN apk add --no-cache dumb-init~=1
38+
RUN apk add --no-cache dumb-init
4139
COPY --chown=node:node --from=sourcer $DIR/apps/api-gateway/dist ./dist
4240
COPY --chown=node:node --from=sourcer $DIR/node_modules $DIR/node_modules
4341
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
@@ -48,4 +46,4 @@ EXPOSE 3000
4846
FROM production AS patched
4947
USER root
5048
RUN apk -U upgrade
51-
USER node
49+
USER node

apps/api-gateway/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"test:watch": "jest --watch"
2626
},
2727
"dependencies": {
28+
"@instana/collector": "^4.14.0",
2829
"@nestjs/common": "10.4.17",
2930
"@nestjs/config": "^3.0.0",
3031
"@nestjs/core": "10.4.17",
@@ -61,8 +62,8 @@
6162
"@typescript-eslint/parser": "^5.59.11",
6263
"dotenv-cli": "^8.0.0",
6364
"eslint": "^8.42.0",
64-
"eslint-config-prettier": "^8.8.0",
65-
"eslint-plugin-prettier": "^4.2.1",
65+
"eslint-config-prettier": "^10.1.8",
66+
"eslint-plugin-prettier": "^5.5.3",
6667
"eslint-plugin-unicorn": "^47.0.0",
6768
"husky": "^8.0.3",
6869
"jest": "^29.5.0",

apps/api-gateway/src/api/api.controller.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ describe("ApiController", () => {
2727
{
2828
provide: WINSTON_MODULE_PROVIDER,
2929
useValue: {
30-
child: jest.fn().mockReturnValue({}), // assuming 'child' method returns an object in real implementation.
31-
} as Partial<Logger>, // Partial<Logger> makes Logger optional, so that it's not necessary to implement every method of Logger.
30+
child: jest.fn().mockReturnValue({}),
31+
} as Partial<Logger>,
3232
},
3333
],
3434
}).compile();

0 commit comments

Comments
 (0)