vault backup: 2026-05-18 19:23:58
This commit is contained in:
parent
dfdbd794f3
commit
71618019d9
14 changed files with 196 additions and 4 deletions
|
|
@ -158,6 +158,7 @@ bash /opt/barclays-banner-builder/deploy.sh
|
|||
6. **Base Path**: In production, `APP_BASE_PATH` and `VITE_BASE_PATH` must match (e.g., `/barclays-banner-builder`). The Vite dev server proxies `/api` to the backend, but the base path affects static asset loading in prod.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/ac-tool/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/Barclays-banner-builder/DEVELOPER_MANUAL.md]]
|
||||
|
|
@ -7,6 +7,8 @@ name: Developer_Manual
|
|||
status: active
|
||||
tags:
|
||||
- client/oliver
|
||||
- domain/devops
|
||||
- domain/security
|
||||
- tech/azure-ad
|
||||
- tech/celery
|
||||
- tech/docker
|
||||
|
|
@ -136,6 +138,11 @@ For local/dev/staging, use `docker-compose.yml`. It orchestrates `db`, `redis`,
|
|||
5. **Environment Consistency:** Never commit `.env`. Use `.env.example` as the source of truth for config keys.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/oliver-ai-assistant/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/sandbox-notebookllamalm-nextjs/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL.md]]
|
||||
- [[client/oliver]]
|
||||
- [[client/oliver]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/USER_MANUAL.md]]
|
||||
|
|
@ -81,4 +81,6 @@ A: Yes, you can clear individual chats from the chat interface.
|
|||
A: Your JWT token expires after 15 minutes (default). Simply refresh the page or log in again. The system will prompt you to re-authenticate if needed.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/USER_MANUAL]]
|
||||
- [[01 Projects/oliver-ai-assistant/USER_MANUAL]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/DEVELOPER_MANUAL.md]]
|
||||
|
|
@ -146,4 +146,7 @@ Key variables in `.env`:
|
|||
5. **JWT Expiration**: Default is 15 minutes for access tokens (configured via `JWT_EXPIRATION_MINUTES`), but the README mentions 8-hour lifetime. Verify if refresh tokens are used for extended sessions.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/oliver-ai-assistant/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/DEVELOPER_MANUAL.md]]
|
||||
|
|
@ -85,4 +85,5 @@ A: Content is filtered by **Department** and **Region** to ensure you only see r
|
|||
A: Since authentication is handled by Microsoft Entra ID, reset your password via the standard Microsoft 365 password reset flow.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/USER_MANUAL]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/USER_MANUAL.md]]
|
||||
98
01 Projects/loreal-sla-calculator/DEVELOPER_MANUAL.md
Normal file
98
01 Projects/loreal-sla-calculator/DEVELOPER_MANUAL.md
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
---
|
||||
auto_generated: true
|
||||
manual_updated_at: 2026-05-18
|
||||
modified: 2026-05-18
|
||||
---
|
||||
|
||||
# L'Oréal SLA Calculator Developer Manual
|
||||
|
||||
## Architecture Overview
|
||||
The application is a hybrid architecture:
|
||||
- **Frontend**: Vanilla JavaScript/HTML applications (`index.html`, `client.html`) that fetch configuration and track user events.
|
||||
- **Backend**: A Node.js/Express server handling authentication (MSAL SSO), JWT verification, and anonymous event tracking.
|
||||
- **Infrastructure**: Dockerized deployment with PostgreSQL for potential future state persistence (though current logic is largely client-side/config-driven).
|
||||
|
||||
## Tech Stack
|
||||
- **Frontend**: HTML5, CSS3, Vanilla JS, Flatpickr (date picker).
|
||||
- **Backend**: Node.js, Express.js, MSAL.js (for SSO), JWT, Cookie Parser.
|
||||
- **Database**: PostgreSQL 16 (Alpine image).
|
||||
- **Deployment**: Docker Compose.
|
||||
|
||||
## Local Setup
|
||||
|
||||
1. **Clone the repository**.
|
||||
2. **Install Dependencies**:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
3. **Environment Configuration**:
|
||||
Create a `.env` file in the `server/` directory. Required variables typically include:
|
||||
- `PORT`: Port for the Node app (default 3000).
|
||||
- `POSTGRES_USER`, `POSTGRES_DB`: Database credentials.
|
||||
- `JWT_SECRET`: Secret for token verification.
|
||||
- `MSAL_*`: Client ID and Authority details (found in `auth.js` configuration object).
|
||||
4. **Run the Application**:
|
||||
```bash
|
||||
# For development (local host bypasses auth)
|
||||
npm start
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
| Variable | Description | Required |
|
||||
|----------|-------------|----------|
|
||||
| `PORT` | App listening port (3100 in prod) | Yes |
|
||||
| `NODE_ENV` | `development` or `production` | Yes |
|
||||
| `SERVE_STATIC` | Set to `false` if behind Apache/Nginx | Yes |
|
||||
| `POSTGRES_*` | DB connection details | Yes |
|
||||
| `JWT_SECRET` | Signing secret for access tokens | Yes |
|
||||
|
||||
## Key Services & Entry Points
|
||||
|
||||
### Authentication (`server/middleware/auth.js` & `auth.js`)
|
||||
- **Flow**: Handles MSAL redirect, silent refresh via httpOnly cookies, and password fallback.
|
||||
- **Token Storage**: Access tokens are kept in memory only (`currentAccessToken`) for security.
|
||||
- **Verification**: `verifyAccessToken` in `services/jwtService.js` validates Bearer tokens.
|
||||
|
||||
### Configuration (`config.json`)
|
||||
- The single source of truth for business logic.
|
||||
- Contains:
|
||||
- Brief types and their stage matrices.
|
||||
- Production cross-reference tables (Complexity x Volume).
|
||||
- Syndication tables (Complexity x EAN Volume).
|
||||
- Translation word count ranges.
|
||||
- **Versioning**: The frontend caches this file; update the cache-busting query param in `loadConfig()` if immediate updates are needed.
|
||||
|
||||
### Usage Tracking (`server/routes/events.js`)
|
||||
- **Anonymous Fingerprinting**: Uses `crypto.subtle.digest` on non-PII navigator/screen data to generate a stable `visitor_id`.
|
||||
- **API**: POST to `/api/events` with `{ event, page, visitor_id, metadata }`.
|
||||
- **Dev Mode**: Tracking is disabled on `localhost`.
|
||||
|
||||
### Backend Server (`server/index.js`)
|
||||
- Serves `/api/auth` and `/api/events`.
|
||||
- Provides `/api/health`.
|
||||
- Conditionally serves static files if `SERVE_STATIC` is not `false`.
|
||||
|
||||
## API Reference
|
||||
|
||||
### Auth
|
||||
- `POST /api/auth/login`: Handles email/password login.
|
||||
- `GET /api/auth/msal`: Initiates MSAL flow (handled client-side via redirect).
|
||||
|
||||
### Events
|
||||
- `POST /api/events`: Accepts usage telemetry. Payload: `{ event: string, page: string, visitor_id: string, metadata: object }`.
|
||||
|
||||
### Health
|
||||
- `GET /api/health`: Returns `{ status: 'ok' }`.
|
||||
|
||||
## Deployment
|
||||
1. **Docker Compose**: The `docker-compose.yml` defines two services:
|
||||
- `postgres`: PostgreSQL 16 with persistent volume `postgres_data`.
|
||||
- `app`: Builds from the root `Dockerfile` and maps port 3100.
|
||||
2. **Reverse Proxy**: In production, the app runs behind Apache/Nginx (`SERVE_STATIC=false`). The proxy handles static file delivery and reverse proxies `/loreal-sla-calculator/api/*` to the Node app.
|
||||
3. **SSO Config**: Ensure the redirect URI in the Azure AD App Registration matches `window.location.origin + '/loreal-sla-calculator'`.
|
||||
|
||||
## Known Gotchas
|
||||
- **Auth Bypass**: Authentication is explicitly bypassed on `localhost` and `127.0.0.1` for development convenience.
|
||||
- **Token Refresh**: The frontend attempts one silent token refresh on 401 errors before logging the user out.
|
||||
- **Config Caching**: Browsers may aggressively cache `config.json`. Use the timestamp query string (`?v=...`) to force updates during development.
|
||||
- **Password Encoding**: Passwords are Base64 encoded before transmission in the legacy email/password flow to avoid WAF issues with special characters.
|
||||
62
01 Projects/loreal-sla-calculator/USER_MANUAL.md
Normal file
62
01 Projects/loreal-sla-calculator/USER_MANUAL.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
auto_generated: true
|
||||
manual_updated_at: 2026-05-18
|
||||
modified: 2026-05-18
|
||||
---
|
||||
|
||||
# L'Oréal SLA Calculator User Manual
|
||||
|
||||
## What This Tool Does
|
||||
The SLA Calculator is a web-based tool designed for the eCom Content Factory. It replaces the previous Excel-based workflow with a precise, 4-step wizard to estimate project timelines and determine if specific deadlines can be met. It automates the calculation of production, syndication, and translation stages based on complex business rules.
|
||||
|
||||
## Who Uses It
|
||||
There are two versions of this tool for different audiences:
|
||||
1. **PM Calculator (`index.html`)**: For Project Managers (PMs). Features a 4-step wizard, full stage-by-stage configuration, Gantt chart visualization, and CSV/iCal export capabilities.
|
||||
2. **Client Estimator (`client.html`)**: For external clients. A simplified single-page form with only 4 inputs that uses default SLA settings automatically.
|
||||
|
||||
## How to Access
|
||||
- **Internal Access**: Log in using your Microsoft account (SSO) or email/password credentials.
|
||||
- **Client Access**: Access via the public link provided by your PM. No login required.
|
||||
|
||||
## Main Workflows
|
||||
|
||||
### For Project Managers (Full Calculator)
|
||||
|
||||
#### Step 1: Select Brief Type
|
||||
- Choose from 9 brief types (e.g., Country Pull, Global Push, Local Push, Urgent).
|
||||
- Each type automatically populates the relevant project stages and displays scope descriptions.
|
||||
|
||||
#### Step 2: Configure Stages
|
||||
- Toggle individual project stages on or off as needed.
|
||||
- Set complexity levels for each active stage.
|
||||
- Define asset volumes (up to 300-400) and revision rounds (supports decimals).
|
||||
- Specify market approval days.
|
||||
|
||||
#### Step 3: Enter Dates
|
||||
- Set the project **Kick-off Date**.
|
||||
- Set the required **Go-Live Date**.
|
||||
|
||||
#### Step 4: View Results
|
||||
- **Timeline Breakdown**: View a list of key dates per stage.
|
||||
- **Gantt Chart**: Visualize the project timeline.
|
||||
- **Verdict**: Receive a clear **Yes/No** indication of whether the deadline can be met.
|
||||
- **Exports**: Download the schedule as CSV or iCal files.
|
||||
|
||||
### For Clients (Estimator)
|
||||
1. Answer 4 practical questions regarding the project scope.
|
||||
2. The system determines the appropriate brief type.
|
||||
3. View the calculated submission deadline based on your go-live date and SLA defaults.
|
||||
|
||||
## FAQ
|
||||
|
||||
**Q: How are production days calculated?**
|
||||
A: Production days are determined by a cross-reference table in `config.json` that factors in complexity levels and asset volumes.
|
||||
|
||||
**Q: Can I adjust the number of revisions?**
|
||||
A: Yes, revision rounds can be set with decimal precision in the PM Calculator configuration step.
|
||||
|
||||
**Q: Who can edit the business rules?**
|
||||
A: Non-developers can update assumptions, stage definitions, and default values by editing the `config.json` file directly.
|
||||
|
||||
**Q: What happens if the deadline cannot be met?**
|
||||
A: The tool provides a "No" verdict and allows you to adjust inputs (like complexity or revisions) to see how changes impact the timeline.
|
||||
|
|
@ -210,5 +210,10 @@ Deploy via Nginx or a static site host (Vercel/Netlify) for the frontend, and a
|
|||
5. **Timezones**: Celery tasks use UTC. Ensure server time is synchronized or use `enable_utc=True` in Celery config.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/presenton/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/sandbox-notebookllamalm-nextjs/DEVELOPER_MANUAL.md]]
|
||||
|
|
@ -84,5 +84,7 @@ A: Check the "Sync Logs" in the Admin panel. If errors persist, ensure your Shar
|
|||
A: Currently, we support PDF, DOCX, TXT, MD, and CSV files. Contact support for additional format requests.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/USER_MANUAL]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/USER_MANUAL.md]]
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/USER_MANUAL.md]]
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/USER_MANUAL.md]]
|
||||
- [[01 Projects/oliver-ai-assistant/USER_MANUAL.md]]
|
||||
|
|
@ -156,4 +156,5 @@ The application is a microservice-oriented system comprising:
|
|||
6. **Imports**: A critical import bug was previously fixed in the remediation module. Ensure all imports are relative and correct if modifying Python code.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL.md]]
|
||||
|
|
@ -74,4 +74,8 @@ A: Currently, the system is configured to use Google Gemini (Gemini 3.1 Pro for
|
|||
A: If using Dev Auth (local), the password is set in `DEV_AUTH_PASSWORD` in `.env`. If using Azure AD, reset via your organization's Azure portal.
|
||||
|
||||
**Q: Is my data private?**
|
||||
A: Yes. The architecture enforces multi-tenant isolation. Client data is strictly separated in the Postgres database. Anonymous tracking is disabled by default (`DISABLE_ANONYMOUS_TRACKING=true`).
|
||||
A: Yes. The architecture enforces multi-tenant isolation. Client data is strictly separated in the Postgres database. Anonymous tracking is disabled by default (`DISABLE_ANONYMOUS_TRACKING=true`).
|
||||
|
||||
## Related
|
||||
|
||||
- [[01 Projects/presenton/USER_MANUAL]]
|
||||
|
|
|
|||
|
|
@ -112,4 +112,6 @@ To test endpoints, use the Swagger UI at `http://127.0.0.1:8000/docs` when runni
|
|||
- **Config Persistence**: User configs are stored in `userConfig.json` inside `APP_DATA_DIRECTORY`. If `CAN_CHANGE_KEYS=false`, keys are fixed at startup.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/sandbox-notebookllamalm-nextjs/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL.md]]
|
||||
|
|
@ -84,5 +84,6 @@ A: Modify the `ports` section in `docker-compose.yml` (e.g., `- "8080:80"`).
|
|||
A: Yes. The FastAPI server exposes endpoints for programmatic access. See the Developer Manual for details.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/ppt-tool/USER_MANUAL]]
|
||||
- [[01 Projects/presenton/DEVELOPER_MANUAL.md]]
|
||||
- [[01 Projects/ppt-tool/USER_MANUAL.md]]
|
||||
|
|
@ -143,4 +143,7 @@ The backend exposes three main tools via FastMCP:
|
|||
- **Port Mapping**: PostgreSQL is mapped to host port 5433, not 5432. Redis to 6380. Adjust local database clients accordingly.
|
||||
|
||||
## Related
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/enterprise-ai-hub-nexus/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/Oliver-ai-bot_2.0/DEVELOPER_MANUAL]]
|
||||
- [[01 Projects/ppt-tool/DEVELOPER_MANUAL.md]]
|
||||
Loading…
Add table
Reference in a new issue