9807d47c8d
Backend:
- numbers.ts — per-org per-doctype per-year sequential numbering (ДГ-2026/001, СЧ-2026/001…)
- money.ts — line totals + Russian rubInWords helper
- documents/routes.ts — CRUD with transactional lines bulk-replace, status changes, history endpoint for client-line autocomplete
- templates/routes.ts — CRUD + instantiate (clones template body into new draft document)
- shared/render/toHtml.ts — block→HTML renderer with placeholder substitution ({{customer.inn}}, {{contract.number}}, {{today}}…)
- documents/pdf.ts — Puppeteer-based PDF rendering with auto-detected Chromium executable
- documents/pdf.routes.ts — GET /:id/preview (HTML) and GET /:id/pdf
- Dockerfile.api — added apk chromium + cyrillic fonts
Web:
- api.ts — Document, DocumentTemplate, Block, LineHistoryItem types
- BlocksEditor — generic block list with reorder/add/remove and per-block forms (heading, party, services_table, totals, terms, signatures, custom_text, page_break)
- LinesEditor — services rows with auto sumCents, "from catalog" picker, "from history by client" panel
- ClientPicker — reusable client dropdown
- pages: Documents list, DocumentEdit (new+existing), Templates list, TemplateEdit
- richtext.ts — plain↔TipTap-JSON conversion (no TipTap yet, just keeps the format compatible)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38 lines
954 B
Docker
38 lines
954 B
Docker
FROM node:20-alpine
|
|
WORKDIR /app
|
|
|
|
# Chromium для Puppeteer (PDF рендер) + шрифты для кириллицы.
|
|
# nss/freetype/harfbuzz нужны самому chromium для рендера, ttf-* — для текста.
|
|
RUN apk add --no-cache \
|
|
openssl \
|
|
tini \
|
|
chromium \
|
|
nss \
|
|
freetype \
|
|
harfbuzz \
|
|
ca-certificates \
|
|
ttf-dejavu \
|
|
ttf-liberation \
|
|
font-noto-cjk
|
|
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
|
|
|
COPY package.json package-lock.json* tsconfig.base.json ./
|
|
COPY apps/api/package.json apps/api/
|
|
COPY packages/shared/package.json packages/shared/
|
|
|
|
RUN npm install --include=dev
|
|
|
|
COPY apps/api ./apps/api
|
|
COPY packages/shared ./packages/shared
|
|
|
|
RUN cd apps/api && npx prisma generate
|
|
|
|
ENV NODE_ENV=production
|
|
WORKDIR /app/apps/api
|
|
EXPOSE 3030
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
CMD ["sh", "-c", "npx prisma migrate deploy && npx tsx src/server.ts"]
|