Skip to content

Commit 3780098

Browse files
committed
Enough of this Will look into algo later
1 parent 9ac5222 commit 3780098

29 files changed

Lines changed: 537 additions & 132 deletions

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ omit =
1818
*/website_profiling/llm/*
1919
*/website_profiling/llm_config.py
2020
*/website_profiling/llm_client_http.py
21+
*/website_profiling/ai_service_client.py
2122
*/website_profiling/commands/chat_cmd.py
2223
*/website_profiling/cli.py
2324
*/website_profiling/commands/enrich_cmd.py

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ report.db
2525
report.db.*
2626
*.backup-*
2727

28+
# .NET build output (must not overwrite Docker restore layers)
29+
**/bin/
30+
**/obj/
31+
**/.vs/
32+
**/TestResults/
33+
2834
# UI-generated configs
2935
.website-profiling-ui-*.txt
3036
.web-pipeline

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ WORKDIR /app
6060

6161
# Application source
6262
COPY pytest.ini /app/pytest.ini
63+
COPY config/typed_config_manifest.json /app/config/typed_config_manifest.json
6364
COPY src /app/src
6465
COPY tests /app/tests
6566
COPY alembic /app/alembic

docker-compose.prod.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Production-style layout: postgres + fastapi + worker + bff + web + files (+ optional mcp).
1+
# Production-style layout: postgres + fastapi + bff + web + files (+ optional mcp).
22
# The browser talks only to `bff`; FastAPI and FileService are network-internal.
33
services:
44
postgres:
5+
container_name: wp-postgres
56
image: postgres:16-alpine
67
environment:
78
POSTGRES_DB: ${POSTGRES_DB:-website_profiling}
@@ -16,6 +17,7 @@ services:
1617
retries: 5
1718

1819
fastapi:
20+
container_name: wp-fastapi
1921
build:
2022
context: .
2123
dockerfile: Dockerfile
@@ -44,9 +46,8 @@ services:
4446
retries: 3
4547
start_period: 30s
4648

47-
# Pipeline worker runs inside ReportService (C# BackgroundService).
48-
4949
data:
50+
container_name: wp-data
5051
build:
5152
context: ./services
5253
dockerfile: Data/Dockerfile
@@ -64,6 +65,7 @@ services:
6465
start_period: 15s
6566

6667
ai:
68+
container_name: wp-ai
6769
build:
6870
context: ./services
6971
dockerfile: AiService/Dockerfile
@@ -85,6 +87,7 @@ services:
8587
start_period: 20s
8688

8789
integrations:
90+
container_name: wp-integrations
8891
build:
8992
context: ./services
9093
dockerfile: IntegrationsService/Dockerfile
@@ -110,19 +113,17 @@ services:
110113
start_period: 20s
111114

112115
report:
116+
container_name: wp-report
113117
build:
114-
context: ./services
115-
dockerfile: ReportService/Dockerfile
118+
context: .
119+
dockerfile: services/ReportService/Dockerfile
116120
environment:
117121
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
118122
ASPNETCORE_URLS: http://+:8094
119123
FASTAPI_URL: http://fastapi:8001
120124
INTEGRATIONS_SERVICE_URL: http://integrations:8093
121125
REPORT_SERVICE_USE_PYTHON_BRIDGE: "0"
122126
USE_FASTAPI_PYTHON_BRIDGE: "1"
123-
WEBSITE_PROFILING_ROOT: /app
124-
PYTHON: /opt/venv/bin/python
125-
DATA_DIR: /data
126127
REPORT_SERVICE_WORKER_ENABLED: "1"
127128
depends_on:
128129
postgres:
@@ -139,6 +140,7 @@ services:
139140
start_period: 20s
140141

141142
files:
143+
container_name: wp-files
142144
build:
143145
context: ./services
144146
dockerfile: FileService/Dockerfile
@@ -152,6 +154,7 @@ services:
152154
condition: service_started
153155

154156
bff:
157+
container_name: wp-bff
155158
build:
156159
context: ./services/Bff
157160
depends_on:
@@ -189,6 +192,7 @@ services:
189192
BFF_COOKIE_DOMAIN: ${BFF_COOKIE_DOMAIN:-}
190193

191194
web:
195+
container_name: wp-web
192196
build:
193197
context: ./web
194198
args:
@@ -206,6 +210,7 @@ services:
206210
start_period: 30s
207211

208212
mcp:
213+
container_name: wp-mcp
209214
build:
210215
context: ./services
211216
dockerfile: AiService/Dockerfile

docker-compose.pull.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# docker compose -f docker-compose.pull.yml up -d
77
services:
88
postgres:
9+
container_name: wp-postgres
910
image: postgres:16-alpine
1011
environment:
1112
POSTGRES_DB: website_profiling
@@ -20,6 +21,7 @@ services:
2021
retries: 5
2122

2223
fastapi:
24+
container_name: wp-fastapi
2325
image: ${BACKEND_IMAGE:-website-profiling:latest}
2426
depends_on:
2527
postgres:
@@ -46,9 +48,8 @@ services:
4648
retries: 3
4749
start_period: 30s
4850

49-
# Pipeline worker runs inside ReportService (C# BackgroundService).
50-
5151
data:
52+
container_name: wp-data
5253
build:
5354
context: ./services
5455
dockerfile: Data/Dockerfile
@@ -66,6 +67,7 @@ services:
6667
start_period: 15s
6768

6869
ai:
70+
container_name: wp-ai
6971
build:
7072
context: ./services
7173
dockerfile: AiService/Dockerfile
@@ -86,6 +88,7 @@ services:
8688
start_period: 20s
8789

8890
integrations:
91+
container_name: wp-integrations
8992
build:
9093
context: ./services
9194
dockerfile: IntegrationsService/Dockerfile
@@ -110,16 +113,18 @@ services:
110113
start_period: 20s
111114

112115
report:
116+
container_name: wp-report
113117
build:
114-
context: ./services
115-
dockerfile: ReportService/Dockerfile
118+
context: .
119+
dockerfile: services/ReportService/Dockerfile
116120
environment:
117121
DATABASE_URL: postgres://profiling:profiling@postgres:5432/website_profiling
118122
ASPNETCORE_URLS: http://+:8094
119123
FASTAPI_URL: http://fastapi:8001
120124
INTEGRATIONS_SERVICE_URL: http://integrations:8093
121125
REPORT_SERVICE_USE_PYTHON_BRIDGE: "0"
122126
USE_FASTAPI_PYTHON_BRIDGE: "1"
127+
REPORT_SERVICE_WORKER_ENABLED: "1"
123128
depends_on:
124129
postgres:
125130
condition: service_healthy
@@ -135,6 +140,7 @@ services:
135140
start_period: 20s
136141

137142
files:
143+
container_name: wp-files
138144
build:
139145
context: ./services
140146
dockerfile: FileService/Dockerfile
@@ -148,6 +154,7 @@ services:
148154
condition: service_started
149155

150156
bff:
157+
container_name: wp-bff
151158
build:
152159
context: ./services/Bff
153160
ports:
@@ -179,6 +186,7 @@ services:
179186
condition: service_healthy
180187

181188
web:
189+
container_name: wp-web
182190
image: ${WEB_IMAGE:-website-profiling-web:latest}
183191
depends_on:
184192
bff:

docker-compose.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
services:
22
postgres:
3+
container_name: wp-postgres
34
image: postgres:16-alpine
45
environment:
56
POSTGRES_DB: website_profiling
@@ -16,6 +17,7 @@ services:
1617
# FastAPI backend — now its own service (was bundled into `web`). Network-internal:
1718
# only the BFF talks to it, so no host port is published.
1819
fastapi:
20+
container_name: wp-fastapi
1921
build:
2022
context: .
2123
dockerfile: Dockerfile
@@ -45,12 +47,10 @@ services:
4547
retries: 3
4648
start_period: 20s
4749

48-
# Pipeline worker runs inside ReportService (C# BackgroundService).
49-
# Python is invoked only as a subprocess for crawl/lighthouse CLI steps.
50-
5150
# .NET read microservice — reads Postgres directly, incrementally replacing FastAPI reads.
5251
# Internal: only the BFF reaches it (no published host port).
5352
data:
53+
container_name: wp-data
5454
build:
5555
context: ./services
5656
dockerfile: Data/Dockerfile
@@ -68,6 +68,7 @@ services:
6868
start_period: 15s
6969

7070
ai:
71+
container_name: wp-ai
7172
build:
7273
context: ./services
7374
dockerfile: AiService/Dockerfile
@@ -89,6 +90,7 @@ services:
8990
start_period: 20s
9091

9192
integrations:
93+
container_name: wp-integrations
9294
build:
9395
context: ./services
9496
dockerfile: IntegrationsService/Dockerfile
@@ -113,19 +115,17 @@ services:
113115
start_period: 20s
114116

115117
report:
118+
container_name: wp-report
116119
build:
117-
context: ./services
118-
dockerfile: ReportService/Dockerfile
120+
context: .
121+
dockerfile: services/ReportService/Dockerfile
119122
environment:
120123
DATABASE_URL: postgres://profiling:profiling@postgres:5432/website_profiling
121124
ASPNETCORE_URLS: http://+:8094
122125
FASTAPI_URL: http://fastapi:8001
123126
INTEGRATIONS_SERVICE_URL: http://integrations:8093
124127
REPORT_SERVICE_USE_PYTHON_BRIDGE: "0"
125128
USE_FASTAPI_PYTHON_BRIDGE: "1"
126-
WEBSITE_PROFILING_ROOT: /app
127-
PYTHON: /opt/venv/bin/python
128-
DATA_DIR: /data
129129
REPORT_SERVICE_WORKER_ENABLED: "1"
130130
depends_on:
131131
postgres:
@@ -142,6 +142,7 @@ services:
142142
start_period: 20s
143143

144144
config:
145+
container_name: wp-config
145146
build:
146147
context: .
147148
dockerfile: services/ConfigService/Dockerfile
@@ -161,6 +162,7 @@ services:
161162

162163
# .NET BFF — the single browser-facing API surface (owns auth + CORS).
163164
bff:
165+
container_name: wp-bff
164166
build:
165167
context: ./services/Bff
166168
ports:
@@ -198,6 +200,7 @@ services:
198200

199201
# Vite SPA (nginx). The browser calls the BFF (:8090) for all /api/*.
200202
web:
203+
container_name: wp-web
201204
build:
202205
context: ./web
203206
args:
@@ -216,6 +219,7 @@ services:
216219

217220
# File export service (PDF/Excel). Internal: only the BFF reaches it.
218221
files:
222+
container_name: wp-files
219223
build:
220224
context: ./services
221225
dockerfile: FileService/Dockerfile

services/ConfigService/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
22
WORKDIR /src
33
COPY services/Shared/WebsiteProfiling.Contracts/WebsiteProfiling.Contracts.csproj services/Shared/WebsiteProfiling.Contracts/
4+
COPY services/Shared/WebsiteProfiling.TypedConfig/WebsiteProfiling.TypedConfig.csproj services/Shared/WebsiteProfiling.TypedConfig/
45
COPY services/ConfigService/src/ConfigService.Application/ConfigService.Application.csproj services/ConfigService/src/ConfigService.Application/
56
COPY services/ConfigService/src/ConfigService.Api/ConfigService.Api.csproj services/ConfigService/src/ConfigService.Api/
67
RUN dotnet restore services/ConfigService/src/ConfigService.Api/ConfigService.Api.csproj
78
COPY services/Shared/WebsiteProfiling.Contracts/ services/Shared/WebsiteProfiling.Contracts/
9+
COPY services/Shared/WebsiteProfiling.TypedConfig/ services/Shared/WebsiteProfiling.TypedConfig/
810
COPY config/typed_config_manifest.json config/typed_config_manifest.json
911
COPY services/ConfigService/src/ services/ConfigService/src/
1012
RUN dotnet publish services/ConfigService/src/ConfigService.Api/ConfigService.Api.csproj -c Release -o /app/publish --no-restore
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using Xunit;
2+
3+
[assembly: CollectionBehavior(DisableTestParallelization = true)]

0 commit comments

Comments
 (0)