BetonPro ERP — System Architecture

Construction Business Management • Concrete Services • Coolify + Next.js

Coolify Server: coolify.blv.bg Docker Container: beton-pro (Node.js 22, Alpine) auth-group :3000 Потребители Browser / Mobile beton.blv.bg Next.js Frontend App Router • SSR • RSC Tailwind CSS • shadcn/ui react-pdf/renderer (документи) i18n: български (bg-BG) Port :3000 API Routes REST + Server Actions Drizzle ORM • Validation (Zod) /api/* NextAuth.js v5 Credentials + JWT Roles: admin, manager brigadir, sklad Database SQLite (local) → PostgreSQL (migrate) Drizzle ORM driver File Storage PDFs / Снимки / Док. Coolify Persistent Volume Audit Log All mutations tracked HTTPS fetch Login / JWT Verify credentials Drizzle SQL R/W Coolify Dashboard Deploy | Restart | Logs Legend Frontend / User Backend API Database Authentication Cloud / Infra Storage Auth Flow Security Group Cloud Boundary Container Audit / Logging

Frontend Stack

  • • Next.js 14 (App Router)
  • • Tailwind CSS + shadcn/ui
  • • React Hook Form + Zod
  • • react-pdf/renderer
  • • Mobile-responsive (български UI)

Backend & Data

  • • REST API + Server Actions
  • • Drizzle ORM (SQLite → PG)
  • • NextAuth.js v5 (JWT)
  • • Coolify Persistent Volume (files)
  • • Audit log (all mutations)

Infrastructure

  • • Coolify Docker (v4.x)
  • • GitHub → Auto-deploy
  • • Dev: develop branch
  • • Prod: main branch (manual deploy)
  • • *.blv.bg wildcard SSL