diff --git a/PDF Editor Timeline.xlsx.bak b/PDF Editor Timeline.xlsx.bak deleted file mode 100644 index b473c78..0000000 Binary files a/PDF Editor Timeline.xlsx.bak and /dev/null differ diff --git a/docker-compose.yml b/docker-compose.yml index b759a91..4e18737 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,13 +9,13 @@ services: environment: PDFENGINE_ENVIRONMENT: dev PDFENGINE_ENGINE_AVAILABLE: "true" - PORT: 8000 + PORT: 8765 ports: - - "8000:8000" + - "8765:8765" volumes: - ./gateway:/home/app healthcheck: - test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health').read()" ] + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8765/health').read()" ] interval: 20s timeout: 5s retries: 5 @@ -30,7 +30,7 @@ services: image: pdf-engine-frontend:dev container_name: pdf-engine-frontend environment: - VITE_GATEWAY_URL: http://localhost:8000 + VITE_GATEWAY_URL: http://localhost:8765 ports: - "5173:5173" volumes: diff --git a/frontend/.env b/frontend/.env new file mode 100644 index 0000000..e5771d2 --- /dev/null +++ b/frontend/.env @@ -0,0 +1 @@ +VITE_GATEWAY_URL=http://127.0.0.1:8765 diff --git a/frontend/src/lib/gatewayService.ts b/frontend/src/lib/gatewayService.ts index c13decf..17f26df 100644 --- a/frontend/src/lib/gatewayService.ts +++ b/frontend/src/lib/gatewayService.ts @@ -333,7 +333,7 @@ class GatewayService { public baseUrl: string; constructor() { - this.baseUrl = import.meta.env.VITE_GATEWAY_URL || 'http://127.0.0.1:8000'; + this.baseUrl = import.meta.env.VITE_GATEWAY_URL as string; } async getHealth(): Promise<{ status: string; version: string; engine_available: boolean }> { diff --git a/gateway/Dockerfile b/gateway/Dockerfile index 575caa4..be56642 100644 --- a/gateway/Dockerfile +++ b/gateway/Dockerfile @@ -85,7 +85,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PORT=8000 + PORT=8765 RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -114,6 +114,6 @@ COPY gateway/tests ./tests RUN chown -R app:app /home/app USER app -EXPOSE 8000 +EXPOSE 8765 -CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8765"] diff --git a/gateway/README.md b/gateway/README.md index 5cc9358..1da891e 100644 --- a/gateway/README.md +++ b/gateway/README.md @@ -59,7 +59,7 @@ Run the service: Using the startup script (Windows): ```powershell -# Default port (8000) +# Default port (8765) powershell -File scripts/start_gateway.ps1 # Custom port (e.g. 8080) @@ -68,7 +68,7 @@ powershell -File scripts/start_gateway.ps1 -Port 8080 Or run directly via uvicorn (cross-platform): ```sh -# Default port (8000) +# Default port (8765) uvicorn app.main:app --reload # Custom port (e.g. 8080) @@ -100,8 +100,8 @@ Additionally, the gateway startup scripts and frontend configuration support: | Var | Default | Meaning | |--------------------|-------------------------|--------------------------------------------------| -| `PORT` | `8000` | Gateway listening port (used by `start_gateway.ps1`). | -| `VITE_GATEWAY_URL` | `http://127.0.0.1:8000` | URL of the gateway API (used by the frontend). | +| `PORT` | `8765` | Gateway listening port (used by `start_gateway.ps1`). | +| `VITE_GATEWAY_URL` | `http://127.0.0.1:8765` | URL of the gateway API (used by the frontend). | A `.env` file in `gateway/` is auto-loaded if present (it is git-ignored via the repo-wide `.venv/` and Python rules — add `.env` to your local diff --git a/gateway/tests/api_validate.py b/gateway/tests/api_validate.py index a8fe917..38b29f2 100644 --- a/gateway/tests/api_validate.py +++ b/gateway/tests/api_validate.py @@ -8,7 +8,7 @@ import urllib.request sys.path.insert(0, "gateway") -BASE = os.environ.get("GATEWAY_URL", "http://localhost:8000") +BASE = os.environ.get("GATEWAY_URL", "http://localhost:8765") def http_get(url): diff --git a/gateway/tests/font_api_validation.py b/gateway/tests/font_api_validation.py index 269dd15..dd15d5c 100644 --- a/gateway/tests/font_api_validation.py +++ b/gateway/tests/font_api_validation.py @@ -12,7 +12,7 @@ import time import httpx -BASE_URL = os.environ.get("GATEWAY_URL", "http://localhost:8000") +BASE_URL = os.environ.get("GATEWAY_URL", "http://localhost:8765") CORPUS_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "corpus", "fonts")) TARGET_PDFS = [ diff --git a/gateway/tests/validation_output.txt b/gateway/tests/validation_output.txt index a4a8bb8..70cf14e 100644 --- a/gateway/tests/validation_output.txt +++ b/gateway/tests/validation_output.txt @@ -1,6 +1,6 @@ ================================================================================ FONT EXTRACTION API VALIDATION - Server: http://localhost:8000 + Server: http://localhost:8765 Corpus: C:\Users\Maskan\Desktop\pdf_editor\pdf\corpus\fonts Timestamp: 2026-06-02 12:36:47 ================================================================================ diff --git a/scripts/start_gateway.ps1 b/scripts/start_gateway.ps1 index d8c5a0d..f21d7b7 100644 --- a/scripts/start_gateway.ps1 +++ b/scripts/start_gateway.ps1 @@ -10,7 +10,7 @@ if ($Port -le 0) { if ($envPort) { $Port = $envPort } else { - $Port = 8000 + $Port = 8765 } }