How chira-platforms-org/chira-web-app works
1. Overall shape
- This repository is a multi-page web application backed by a small service-oriented backend.
- The frontend lives mostly under public/, while backend logic is split across services/*.
- The architecture is closer to a portal + supporting services than a single monolithic app.
2. Frontend boundary
- public/ contains many standalone HTML entry points: home.html, login.html, client.html, client-portal.html, consultation.html, payment.html, request.html, welcome.html, contact.html, file-upload.html, and others.
- This suggests the UI is organized as multiple pages / flows rather than one SPA.
- Shared assets are split into global and feature-specific folders such as public/css, public/js, public/images, plus feature bundles under public/app, public/hub, and public/analysis-library.
3. Feature modules in the browser
- public/app contains a dedicated app page, CSS, JS, and sample JSON profiles like sample_01_supply_chain_profile.json and sample_02_global_fuel_prices_profile.json.
- public/analysis-library looks like a separate analytical module or UI component set.
- public/hub appears to be another distinct UI surface, likely a dashboard or portal hub.
- These modules are useful to diagram as separate frontend subdomains or feature areas, even if they are served from the same origin.
4. Backend service decomposition
- services/auth-service, services/file-upload-service, services/payment-service, services/portal-service, and services/request-service indicate domain-focused microservices.
- Each service has its own server.js; several also have their own package.json and lockfile, which implies they can be deployed and run independently.
- The separation suggests distinct responsibilities: authentication, uploads, payments, portal data, and request handling.
5. API entrypoint / routing layer
- services/gateway is the clearest sign of an API gateway sitting in front of the domain services.
- In the likely runtime flow, browser pages call the gateway, and the gateway routes requests to the appropriate downstream service.
- server.js at the repository root may serve as the main app server or a convenience entrypoint for hosting static content plus APIs.
6. Primary data flows
- A typical flow is: browser page → gateway → domain service → response back to the page.
- File upload flows likely go through file-upload-service.
- Authentication flows go through auth-service.
- Payment-related actions go through payment-service.
- Portal and request workflows likely map to portal-service and request-service respectively.
7. Static assets vs. dynamic services
- The frontend is mostly static HTML/CSS/JS, while the services handle dynamic behavior and backend state.
- This split is important for the diagram: the static site can be deployed separately or served by the root server, while services can scale independently.
- public/client-app.html, public/client-portal.html, and similar pages likely act as launch points into the service-backed workflows.
8. Deployment and environment clues
- wrangler.toml suggests there is at least some Cloudflare Workers/Pages deployment intent.
- render-config.md suggests another deployment target or environment-specific guidance.
- The presence of shell scripts like final-upload.sh and upload-to-github.sh implies manual or CI-assisted release steps.
9. Operational / integration utilities
- test-api-connection.js is likely a small diagnostic script for verifying backend reachability.
- These utilities are not core runtime components, but they matter for the architecture diagram as supporting tooling around the API layer.
10. What to highlight in an architecture diagram
- Show one browser/client layer feeding multiple UI pages and feature modules.
- Show an API gateway in the backend, then separate service boxes for auth, upload, payment, portal, and request handling.
- Show static assets served from public/ alongside the page entrypoints.
- If you need a deployment boundary, note that the repo includes both Node server entrypoints and Cloudflare-oriented config, so runtime hosting may be split between static delivery and backend service hosting.
11. Repository characterization
- This is not a single-purpose library; it is a full product web stack with multiple user journeys and backend capabilities.
- The strongest architectural boundary is between the frontend portal surfaces and the domain services behind the gateway.
Main entry points: gateway/server.js API gateway · server.js Root server · wrangler.toml Deployment config · auth-service/server.js Auth service
Components 15
Frontend
Static multi-page UI and feature-specific browser modules under public/
- Public pages · Standalone HTML entry points for the main user journeys
- App module · Dedicated app surface with its own CSS, JS, and sample profiles
public/app/index.html - Hub · Separate portal/dashboard surface with its own scripts and styles
public/hub/index.html - Analysis library · Analytical UI module isolated from the main pages
public/analysis-library/index.html - Shared assets · Common CSS, JavaScript, and images used across pages
public/css/style.css
Backend
Root server, API gateway, and domain services
- Root server · Main application server entrypoint for hosting and/or coordinating the app
server.js - API gateway · Central request router in front of the domain services
services/gateway/server.js - Auth service · Authentication and login-related backend logic
services/auth-service/server.js - Upload service · File upload backend for document and asset transfer
services/file-upload-service/server.js - Payment service · Payment processing backend
services/payment-service/server.js - Portal service · Backend for portal and client-facing data
services/portal-service/server.js - Request service · Backend for request/workflow handling
services/request-service/server.js
Ops
Deployment and support tooling
- Deployment config · Cloudflare-oriented deployment and runtime configuration
wrangler.toml - Release scripts · Shell scripts used for upload/release workflows
final-upload.sh - API probe · Utility for checking backend connectivity
test-api-connection.js
Connections 20
- Root server → Shared assets: serves · Hosts the shared static frontend assets
- Root server → Public pages: serves · Delivers the standalone HTML entry points
- Root server → API gateway: routes · Coordinates API traffic with backend routing
- Public pages → API gateway: calls · Browser pages invoke backend APIs through the gateway
- App module → API gateway: calls · Feature app uses backend APIs
- Hub → API gateway: calls · Hub UI depends on backend APIs
- Analysis library → API gateway: calls · Analysis features query backend services when needed
- API gateway → Auth service: routes · Authentication requests are forwarded here
- API gateway → Upload service: routes · Upload requests are forwarded here
- API gateway → Payment service: routes · Payment requests are forwarded here
- API gateway → Portal service: routes · Portal data requests are forwarded here
- API gateway → Request service: routes · Workflow and request operations are forwarded here
- Public pages → Auth service: login flow · Login page journeys map to the authentication service
- Public pages → Upload service: upload flow · File upload pages map to the upload service
- Public pages → Payment service: payment flow · Payment pages map to the payment service
- Public pages → Portal service: portal flow · Client and portal pages map to portal data
- Public pages → Request service: request flow · Request and consultation flows map to request handling
- Deployment config → Root server: targets · Deployment configuration reflects the runtime host setup
- Release scripts → Deployment config: supports · Release scripts assist deployment and publishing
- API probe → API gateway: checks · Diagnostic utility verifies API reachability