Docs Angular Connectivity Improvements
Documentation for Sessions
S238.6–7: Docs-Angular Local/Cloud Connectivity Improvements
Session: 238.6, 238.7
Date: 2026-03-19
Focus: Fix connectivity between local files, cloud files/projects in docs-angular (MongoDB backend)
S238.7: Cloud File Manager UI Fix (MongoDB Data Model)
Problem: Backend connected successfully (629 files loaded) but UI showed 0 projects and empty files.
Root cause: CloudTransferService expected the old data model (files embedded in projects). MongoDB backend returns:
- doc-projects — often empty (projects derived from folders-config or file paths)
- doc-files — flat list with path like
english/GoGrab-Space/README.md
Fix: Rewrote refreshCloudData() to:
- Fetch all files via
getAllFilesPaginated()(paginates through API) - Derive projects from file paths when doc-projects empty (
english/GoGrab-Spacefrom path) - Map DocFile → CloudFile and populate
project.structure - Use folders-config for display names when available
- Fix
downloadFileto use file content (or DocsApiService) instead of deprecated StorageService - Fix
uploadFilepath format:english/GoGrab-Space/filename.md - Fix
createCloudProjectto send DocProject schema (name, displayName, isRoot, language)
S238.6: Root Cause Analysis (from screenshots)
MIME type errors — Chunks (
chunk-*.js) returned HTML instead of JavaScript- Cause:
_redirectshad/* /index.html 200which rewrote ALL requests (including static assets) to index.html - Fix: Removed the catch-all redirect. docs-angular uses hash routing (
#/admin/cloud), so the server only receives/and static asset requests — no SPA fallback needed
- Cause:
Cloud service / View Sessions 404 — "Failed to load view sessions", "Failed to create view session"
- Cause: backend-docs-api at docs-api.gograb.space may be unreachable (not deployed, CORS, or network)
- Fix: Improved error handling and user feedback; clearer status messages
DocsApiService healthCheck — Fragile URL construction
- Fix: Simplified to use
${apiUrl}/healthwhen apiUrl already ends with/docs-api
- Fix: Simplified to use
Changes Made
| File | Change |
|---|---|
apps/docs-angular/public/_redirects |
Removed /* /index.html 200 — was breaking chunk loading |
apps/docs-angular/src/app/services/docs-api.service.ts |
Simplified healthCheck() URL construction |
apps/docs-angular/src/app/admin/view-sessions/view-sessions.component.ts |
Added loadError signal, error UI with retry, clearer 404 message |
apps/docs-angular/src/app/admin/view-sessions/view-sessions.component.scss |
Added .error-hint styling |
apps/docs-angular/src/app/admin/components/cloud-file-manager/cloud-file-manager.component.ts |
Improved status message and console hint when backend unreachable |
Deployment Checklist
Redeploy docs-angular to Cloudflare Pages:
yarn deploy:docs # or: ./tools/scripts/deploy-docs.shVerify backend-docs-api is deployed and reachable:
curl https://docs-api.gograb.space/docs-api/health- If 404/connection refused: deploy backend-docs-api to Railway (or your hosting)
- Ensure docs-api.gograb.space DNS points to the backend
Verify production branch in Cloudflare Pages:
- Project
gograb-docsshould use branchdeploy/docsfor production - Custom domain docs.gograb.space should map to that deployment
- Project
After deploy: Hard refresh (Cmd+Shift+R) to clear cached HTML/chunks
References
- S224-docs-backend-api-integration-research.md
- S224-docs-project-persistence-and-view-sessions-outline.md
- AGENTS.md §7 — Backend API URL Tokens