From 18462249b3a7a5fe4483421e7e5c5cf470b26765 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 10 Mar 2026 13:33:39 -0400 Subject: [PATCH] feat: Integrated SvelteKit frontend into unified Aether orchestration. Updated deploy scripts and documentation. --- README.md | 30 ++++++++++++++++++++---------- package.json | 4 ++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f21c6bcd..f7804bba 100644 --- a/README.md +++ b/README.md @@ -123,35 +123,45 @@ Developer sandbox pages — not for production use. # How to build and deploy SvelteKit: -The deployment is now fully automated using Docker Compose. The application is built directly from source inside a clean Docker environment, eliminating the need for manual `rsync` or `npm_deploy` management. +The deployment is now fully integrated into the unified **Aether Docker Environment** (`aether_container_env`). The application is built directly from source inside a clean Docker container, ensuring consistent environment handling across staging and production. -### Commands +### Deployment Commands Run these commands from the root of the `aether_app_sveltekit` project: -#### 1. Deploy to Staging (Dev) -This builds and restarts the staging containers (`ae_app_node_dev`, etc.) on your local workstation. +#### 1. Deploy to Staging (Dev Workstation) +This triggers an autonomous build inside the Docker container using your `.env.staging` file and restarts the service. ```bash npm run deploy:staging ``` #### 2. Deploy to Production -This builds the image using production flags and restarts the production containers. +This builds the image using production flags (using `.env.prod`) and restarts the production container. ```bash npm run deploy:prod ``` ### Technical Details -- **Dockerfile**: Uses a multi-stage build. Stage 1 (builder) installs dependencies and builds the app using the `BUILD_MODE` argument. Stage 2 (runtime) creates the final lightweight image. +- **Unified Orchestration**: All services (API, UI, Redis) are managed via `~/OSIT_dev/aether_container_env/docker-compose.yml`. +- **Dockerfile**: Uses a multi-stage build. Stage 1 (builder) installs dependencies and builds the app using the `BUILD_MODE` argument passed from Docker Compose. Stage 2 (runtime) creates the final lightweight image. - **Environment Handling**: - - `PUBLIC_` variables are baked into the image during the build step based on `.env.staging` or `.env.prod`. - - Private runtime variables are passed via the `env_file` in `docker-compose.yml`. -- **Networking**: Containers are automatically joined to the `ae_dev_net` network to allow local Nginx proxying. -- **Legacy Migration**: The `upstream` in the local Nginx configuration has been updated to point to these new SvelteKit containers on port 3000. + - `PUBLIC_` variables are baked into the image during the build step. + - Private runtime variables are passed via the orchestration's `.env` file. +- **Networking**: The frontend communicates with the backend via the high-speed internal Docker network (`http://ae_api:5005`). --- +## Developing (Local HMR) + +For the best developer experience with Hot Module Replacement (HMR), start a local development server on your host machine: + +```bash +npm run dev +``` + +The local dev server will communicate with the **FastAPI backend running in Docker** (typically via `dev-api.oneskyit.com`). This gives you the speed of local Svelte development with the power of the full Aether stack. + # Rebuild the node_modules directory and manually install extra Svelte packages Run the npm update to fix the node_modules directory and package.json diff --git a/package.json b/package.json index 6febf57b..8147ae99 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "format": "prettier --write .", "test:integration": "playwright test", "test:unit": "vitest", - "deploy:staging": "docker compose -f ../ae_env_node_app/docker-compose.yml up -d --build --remove-orphans", - "deploy:prod": "docker compose -f ../ae_env_node_app/docker-compose.yml build --build-arg BUILD_MODE=prod && docker compose -f ../ae_env_node_app/docker-compose.yml up -d --remove-orphans" + "deploy:staging": "docker compose -f ../aether_container_env/docker-compose.yml up -d --build --remove-orphans", + "deploy:prod": "docker compose -f ../aether_container_env/docker-compose.yml build --build-arg BUILD_MODE=prod && docker compose -f ../aether_container_env/docker-compose.yml up -d --remove-orphans" }, "devDependencies": { "@eslint/js": "^9.39.1",