feat: Integrated SvelteKit frontend into unified Aether orchestration. Updated deploy scripts and documentation.

This commit is contained in:
Scott Idem
2026-03-10 13:33:39 -04:00
parent b6c55a5042
commit 18462249b3
2 changed files with 22 additions and 12 deletions

View File

@@ -123,35 +123,45 @@ Developer sandbox pages — not for production use.
# How to build and deploy SvelteKit: # 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: Run these commands from the root of the `aether_app_sveltekit` project:
#### 1. Deploy to Staging (Dev) #### 1. Deploy to Staging (Dev Workstation)
This builds and restarts the staging containers (`ae_app_node_dev`, etc.) on your local workstation. This triggers an autonomous build inside the Docker container using your `.env.staging` file and restarts the service.
```bash ```bash
npm run deploy:staging npm run deploy:staging
``` ```
#### 2. Deploy to Production #### 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 ```bash
npm run deploy:prod npm run deploy:prod
``` ```
### Technical Details ### 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**: - **Environment Handling**:
- `PUBLIC_` variables are baked into the image during the build step based on `.env.staging` or `.env.prod`. - `PUBLIC_` variables are baked into the image during the build step.
- Private runtime variables are passed via the `env_file` in `docker-compose.yml`. - Private runtime variables are passed via the orchestration's `.env` file.
- **Networking**: Containers are automatically joined to the `ae_dev_net` network to allow local Nginx proxying. - **Networking**: The frontend communicates with the backend via the high-speed internal Docker network (`http://ae_api:5005`).
- **Legacy Migration**: The `upstream` in the local Nginx configuration has been updated to point to these new SvelteKit containers on port 3000.
--- ---
## 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 # Rebuild the node_modules directory and manually install extra Svelte packages
Run the npm update to fix the node_modules directory and package.json Run the npm update to fix the node_modules directory and package.json

View File

@@ -17,8 +17,8 @@
"format": "prettier --write .", "format": "prettier --write .",
"test:integration": "playwright test", "test:integration": "playwright test",
"test:unit": "vitest", "test:unit": "vitest",
"deploy:staging": "docker compose -f ../ae_env_node_app/docker-compose.yml up -d --build --remove-orphans", "deploy:staging": "docker compose -f ../aether_container_env/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: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": { "devDependencies": {
"@eslint/js": "^9.39.1", "@eslint/js": "^9.39.1",