docs: Update README with Docker and certificate info

- Added PDF certificate generation documentation
- Added Docker deployment section with Dockerfile example
- Added environment variables reference

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
richardtekula
2026-01-30 11:32:53 +01:00
parent fc2cf1acc2
commit 78b01fcc75

View File

@@ -478,3 +478,64 @@ Manual triggers available via admin endpoints: `triggerEventNotifications()`, `t
## Audit Logging ## Audit Logging
All write operations log to `auditLogs` via the `auditContext` pattern. Services receive `{ userId, ipAddress, userAgent }` and call the audit service internally. Tracked: logins, logouts, password changes, CRUD on companies/projects/todos/notes/timesheets, user assignments, admin actions. All write operations log to `auditLogs` via the `auditContext` pattern. Services receive `{ userId, ipAddress, userAgent }` and call the audit service internally. Tracked: logins, logouts, password changes, CRUD on companies/projects/todos/notes/timesheets, user assignments, admin actions.
---
## PDF Certificate Generation
The AI Kurzy module can generate PDF certificates for course participants using Puppeteer.
**Services:**
- `certificate.service.js``generateCertificate(registraciaId, templateName)`, `getCertificateDownloadInfo(prilohaId)`, `getAvailableTemplates()`, `hasCertificate(registraciaId)`
- `certificate-email.service.js``sendCertificateEmail(registraciaId, prilohaId)` — sends certificate via JMAP
**Available Templates:**
- `AIcertifikat` — AI kurz (Zdarílek + Gablasová)
- `AIcertifikatGablas` — AI kurz (Gablas + Gablasová)
- `AIcertifikatPatrik` — AI kurz (Patrik + Gablasová)
- `ScrumMaster`, `ScrumProductOwner` — Scrum certifications
- `ITILFoundation` — ITIL® 4 Foundation
- `PRINCE2Foundation`, `PRINCE2Practitioner` — PRINCE2® certifications
---
## Docker Deployment
```dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
# Required for PDF certificate generation
RUN apk add --no-cache chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
COPY src ./src
COPY drizzle.config.js ./
RUN mkdir -p uploads
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001 && \
chown -R nodejs:nodejs /app
USER nodejs
EXPOSE 5000
CMD ["node", "src/index.js"]
```
**Environment Variables:**
```env
NODE_ENV=production
DATABASE_URL=postgres://user:pass@host:5432/db
JWT_SECRET=your-secret
JWT_REFRESH_SECRET=your-refresh-secret
ENCRYPTION_KEY=32-char-key-for-aes
JMAP_URL=https://mail.truemail.sk/jmap/
VAPID_PUBLIC_KEY=...
VAPID_PRIVATE_KEY=...
CORS_ORIGIN=https://your-frontend.com
```