Skip to content

Commit e772b2b

Browse files
authored
Merge pull request #14 from HardMax71/dev
Dev
2 parents f194597 + f17e87b commit e772b2b

File tree

11 files changed

+27
-18
lines changed

11 files changed

+27
-18
lines changed

.env.example

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
NEO4J_PASSWORD=your_secure_neo4j_password_here
22
GRAFANA_ADMIN_PASSWORD=your_secure_grafana_password_here
3-
VITE_API_BASE_URL=http://localhost:8000/api
4-
VITE_GRAFANA_URL=http://grafana.localhost:8081
53

64
# Frontend build target: dev (vite hot-reload) or prod (nginx static)
75
FRONTEND_TARGET=dev

.github/workflows/publish-images.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ jobs:
4141
context: ./frontend
4242
dockerfile: ./frontend/Dockerfile
4343
target: prod
44-
build-args: |
45-
VITE_API_BASE_URL=/api
46-
VITE_GRAFANA_URL=
4744

4845
steps:
4946
- name: Checkout repository

docker-compose.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ services:
177177
- "5173:5173"
178178
volumes:
179179
- ./frontend:/app
180-
environment:
181-
- VITE_API_BASE_URL=${VITE_API_BASE_URL}
182-
- VITE_GRAFANA_URL=${VITE_GRAFANA_URL}
183180
networks:
184181
- public-network
185182
depends_on:

frontend/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<link rel="preconnect" href="https://fonts.googleapis.com">
99
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1010
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
11+
<script src="/config.js"></script>
1112
</head>
1213
<body>
1314
<div id="root"></div>

frontend/public/config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Runtime configuration - this file is replaced/generated at container startup
2+
window.APP_CONFIG = {
3+
API_BASE_URL: "http://localhost:8000",
4+
GRAFANA_URL: "http://grafana.localhost:8081"
5+
};

frontend/src/api/client.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
// Configure the Hey API client with the base URL
22
import { client } from './generated';
33

4-
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "http://localhost:8000/api";
4+
// Runtime config from window.APP_CONFIG (set by /config.js loaded before React)
5+
declare global {
6+
interface Window {
7+
APP_CONFIG?: {
8+
API_BASE_URL?: string;
9+
GRAFANA_URL?: string;
10+
};
11+
}
12+
}
13+
14+
// Base URL for API requests (generated client paths already include /api prefix)
15+
export const API_BASE_URL = window.APP_CONFIG?.API_BASE_URL || "http://localhost:8000";
516

617
// Configure the global client with our base URL
718
client.setConfig({

frontend/src/pages/Health.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
import { IconButton } from "../components/styled/Button";
2626
import PageHeader from "../components/PageHeader";
2727

28-
const GRAFANA_URL = import.meta.env.VITE_GRAFANA_URL || "http://grafana.localhost:8081";
28+
const GRAFANA_URL = window.APP_CONFIG?.GRAFANA_URL || "http://grafana.localhost:8081";
2929

3030
export default function Health() {
3131
const { data, error, isLoading, refetch } = useHealth();
@@ -50,7 +50,7 @@ export default function Health() {
5050
<IconButton as="a" href={GRAFANA_URL} target="_blank" rel="noopener noreferrer" title="Open Grafana Dashboard">
5151
<BarChart3 size={18} />
5252
</IconButton>
53-
<IconButton as="a" href={`${API_BASE_URL}/v1/health/`} target="_blank" rel="noopener noreferrer" title="Open API endpoint">
53+
<IconButton as="a" href={`${API_BASE_URL}/api/v1/health/`} target="_blank" rel="noopener noreferrer" title="Open API endpoint">
5454
<Code2 size={18} />
5555
</IconButton>
5656
<IconButton onClick={() => refetch()} disabled={isLoading} title="Refresh">

frontend/src/pages/JobStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ export default function JobStatus() {
13711371
</Tooltip>
13721372
<Tooltip text="Open API endpoint">
13731373
<a
1374-
href={`${API_BASE_URL}/v1/resumes/${job.uid}/`}
1374+
href={`${API_BASE_URL}/api/v1/resumes/${job.uid}/`}
13751375
target="_blank"
13761376
rel="noopener noreferrer"
13771377
style={{

frontend/src/pages/Landing.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import AnimatedTerminal from '../components/AnimatedTerminal';
66

77
// Code examples defined outside component to avoid recreation on each render
88
const CODE_EXAMPLES = {
9-
curl: `curl -X POST ${API_BASE_URL}/v1/resumes/ \\
9+
curl: `curl -X POST ${API_BASE_URL}/api/v1/resumes/ \\
1010
-H "Content-Type: multipart/form-data" \\
1111
-F "file=@resume.pdf"`,
1212

1313
python: `import requests
1414
1515
response = requests.post(
16-
'${API_BASE_URL}/v1/resumes/',
16+
'${API_BASE_URL}/api/v1/resumes/',
1717
files={'file': open('resume.pdf', 'rb')}
1818
)
1919
print(response.json())`,
@@ -24,7 +24,7 @@ const fs = require('fs');
2424
const form = new FormData();
2525
form.append('file', fs.createReadStream('resume.pdf'));
2626
27-
fetch('${API_BASE_URL}/v1/resumes/', {
27+
fetch('${API_BASE_URL}/api/v1/resumes/', {
2828
method: 'POST',
2929
body: form
3030
}).then(r => r.json()).then(console.log);`
@@ -354,7 +354,7 @@ export default function Landing() {
354354
<p className="landing-code-footer">
355355
Full documentation at{' '}
356356
<a
357-
href={`${API_BASE_URL}/docs/`}
357+
href={`${API_BASE_URL}/api/docs/`}
358358
target="_blank"
359359
rel="noopener noreferrer"
360360
>

frontend/src/pages/PrivacyPolicy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function PrivacyPolicy() {
4242
</a>{" "}
4343
or using the{" "}
4444
<a
45-
href={`${API_BASE_URL}/docs/`}
45+
href={`${API_BASE_URL}/api/docs/`}
4646
target="_blank"
4747
rel="noopener noreferrer"
4848
className="policy-link"

0 commit comments

Comments
 (0)