feat: monorepo with NestJS API, admin panel and DB-driven website

Restructure the repo into a pnpm + Turborepo monorepo:

- apps/web: Nuxt 4 site, now server-rendered and reading all content
  from the API; pages cached with SWR and purged on content changes
- apps/api: NestJS 12 + Prisma 7 + PostgreSQL. Auth with short-lived
  access tokens and rotating httpOnly refresh cookies, roles (ADMIN,
  EDITOR), catalog, editable site sections, media upload to S3-compatible
  storage (converted to WebP), contact messages, audit log
- apps/admin: Vue 3 admin panel (Ant Design Vue, Pinia, Tailwind) for
  products, categories, site sections, messages, media and users
- packages/shared: Zod schemas and types shared by API and admin

Also:
- seed script that loads the original 8 categories / 89 products and
  section content
- Docker images for api (with a one-off migrate service), web, admin,
  and an nginx gateway for both domains
- dev and production compose files, daily database backup service
- API e2e tests

Removes the committed static out/ build and the old root Dockerfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
S. Esmaeili
2026-10-21 20:31:05 +03:30
co-authored by Claude Opus 5.5
parent 31076174e2
commit 789d224ea0
395 changed files with 19070 additions and 11592 deletions
+118
View File
@@ -0,0 +1,118 @@
/*
* Ant Design Vue ↔ project look.
* antd's CSS-in-JS is unlayered while Tailwind v4 lives in cascade layers, so Tailwind classes
* can't restyle antd elements. These unlayered rules pin antd form controls to the exact
* pre-migration styling (same values as the old Tailwind `inputCls` / submit button).
*/
/* ---- form shell ---- */
.contact-form.ant-form {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
/* antd resets items and their grid wrappers to 14px/1.5714; inherit like the original markup did
(the control line box decides the gap under the inline-block textarea) */
.contact-form .ant-form-item,
.contact-form .ant-form-item .ant-row,
.contact-form .ant-form-item .ant-col {
margin-bottom: 0;
font-size: inherit;
line-height: inherit;
}
.contact-form .ant-form-item .ant-form-item-label {
padding: 0 0 8px; /* mb-2 */
line-height: 16px;
}
.contact-form .ant-form-item-label > label {
width: 100%; /* original labels were full-width blocks */
height: auto;
font-size: 12px; /* text-xs */
line-height: 16px;
color: var(--color-muted);
}
.contact-form .ant-form-item-explain {
font-size: 12px;
line-height: 20px;
padding-top: 4px;
}
/* ---- inputs (= w-full rounded-lg border border-line bg-bg px-4 py-3.5 text-sm text-ink) ---- */
.contact-form .ant-input {
width: 100%;
border-radius: 8px;
border: 1px solid var(--color-line);
background-color: var(--color-bg);
padding: 14px 16px;
font-family: inherit;
font-size: 14px;
line-height: 20px;
color: var(--color-ink);
box-shadow: none;
transition-property: color, background-color, border-color;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.contact-form .ant-input::placeholder {
color: color-mix(in oklab, var(--color-muted) 50%, transparent);
}
.contact-form .ant-input:hover {
border-color: var(--color-line);
}
.contact-form .ant-input:focus,
.contact-form .ant-input-focused {
border-color: var(--color-accent);
outline: none;
box-shadow: none;
}
/* antd's .ant-input-rtl forces direction:rtl; honour an explicit dir="ltr" (phone field) */
.contact-form .ant-input[dir="ltr"] {
direction: ltr;
text-align: left;
}
.contact-form textarea.ant-input {
resize: none;
min-height: 0;
vertical-align: baseline; /* native inline-block textarea alignment (antd sets bottom) */
}
/* ---- submit (= rounded-full bg-accent py-4 font-bold text-bg, hover:bg-accent-soft + glow) ---- */
.contact-form .ant-btn.contact-submit {
display: flex;
width: 100%;
height: auto;
align-items: center;
justify-content: center;
gap: 10px;
border: 0;
border-radius: calc(infinity * 1px); /* = tailwind rounded-full */
background-color: var(--color-accent);
padding: 16px 0;
font-family: inherit;
font-size: 16px;
line-height: 24px;
font-weight: 700;
color: var(--color-bg);
box-shadow: none;
cursor: default;
transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-form .ant-btn.contact-submit > span {
display: inline;
}
@media (hover: hover) {
.contact-form .ant-btn.contact-submit:hover {
background-color: var(--color-accent-soft);
color: var(--color-bg);
box-shadow: 0 8px 45px rgba(255, 90, 0, 0.45);
}
}
.contact-form .ant-btn.contact-submit:disabled {
opacity: 0.6;
border: 0;
}
/* no click-wave ring (wasn't part of the original button) */
.contact-form .ant-btn.contact-submit::after,
.contact-form .ant-wave {
display: none;
}
+213
View File
@@ -0,0 +1,213 @@
@import "tailwindcss";
/* ---- local fonts ---- */
@font-face {
font-family: "IRANSans";
src: url("/fonts/IRANSansWebFaNum_UltraLight.woff2") format("woff2");
font-weight: 200;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IRANSans";
src: url("/fonts/IRANSansWebFaNum_Light.woff2") format("woff2");
font-weight: 300;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IRANSans";
src: url("/fonts/IRANSansWebFaNum.woff2") format("woff2");
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IRANSans";
src: url("/fonts/IRANSansWebFaNum_Medium.woff2") format("woff2");
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IRANSans";
src: url("/fonts/IRANSansWebFaNum_Bold.woff2") format("woff2");
font-weight: 700;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IRANSans";
src: url("/fonts/IRANSansWebFaNum_Black.woff2") format("woff2");
font-weight: 900;
font-style: normal;
font-display: swap;
}
:root {
--font-iransans: "IRANSans", sans-serif;
}
@theme {
--font-sans: var(--font-iransans);
--font-mono: var(--font-iransans);
--color-bg: #0b1224;
--color-panel: #101a32;
--color-panel-2: #152040;
--color-ink: #edede6;
--color-muted: #8e9ab0;
--color-accent: #ff5a00;
--color-accent-soft: #ff7a2a;
--color-hazard: #ffb800;
--color-line: #1e2d4d;
--animate-marquee: marquee 32s linear infinite;
--animate-spin-slow: spin-slow 18s linear infinite;
--animate-blink: blink 1.1s steps(2, start) infinite;
--animate-fade-up: fade-up 1s cubic-bezier(0.22, 1, 0.36, 1) both;
@keyframes marquee {
from {
transform: translateX(0);
}
to {
transform: translateX(-50%);
}
}
@keyframes spin-slow {
to {
transform: rotate(360deg);
}
}
@keyframes blink {
to {
visibility: hidden;
}
}
@keyframes fade-up {
from {
opacity: 0;
transform: translateY(44px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
}
/* added for migration: CSS-only entrance animation for Hero (no JS dependency, content visible in server HTML) */
.animate-fade-up-1 {
animation: var(--animate-fade-up);
animation-delay: 0.15s;
}
.animate-fade-up-2 {
animation: var(--animate-fade-up);
animation-delay: 0.28s;
}
.animate-fade-up-3 {
animation: var(--animate-fade-up);
animation-delay: 0.42s;
}
.animate-fade-up-4 {
animation: var(--animate-fade-up);
animation-delay: 0.55s;
}
.animate-fade-up-5 {
animation: var(--animate-fade-up);
animation-delay: 0.68s;
}
.animate-fade-up-6 {
animation: var(--animate-fade-up);
animation-delay: 0.7s;
}
.animate-fade-up-7 {
animation: var(--animate-fade-up);
animation-delay: 0.82s;
}
.animate-fade-up-8 {
animation: var(--animate-fade-up);
animation-delay: 0.9s;
}
.animate-fade-up-9 {
animation: var(--animate-fade-up);
animation-delay: 1s;
}
html {
scroll-behavior: smooth;
}
body {
background-color: var(--color-bg);
color: var(--color-ink);
overflow-x: hidden;
}
::selection {
background: var(--color-accent);
color: var(--color-bg);
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
background: #253558;
border-radius: 8px;
border: 2px solid var(--color-bg);
}
::-webkit-scrollbar-thumb:hover {
background: var(--color-accent);
}
/* ---- hazard tape (yellow/black diagonal stripes) ---- */
.hazard {
background-image: repeating-linear-gradient(
-45deg,
#ffb800 0 14px,
#0b1224 14px 28px
);
}
/* ---- blueprint grid ---- */
.bg-grid {
background-image:
linear-gradient(to left, rgba(237, 237, 230, 0.045) 1px, transparent 1px),
linear-gradient(to bottom, rgba(237, 237, 230, 0.045) 1px, transparent 1px);
background-size: 72px 72px;
}
.bg-grid-fine {
background-image:
linear-gradient(to left, rgba(237, 237, 230, 0.03) 1px, transparent 1px),
linear-gradient(to bottom, rgba(237, 237, 230, 0.03) 1px, transparent 1px);
background-size: 28px 28px;
}
/* ---- film grain ---- */
.noise {
position: fixed;
inset: 0;
z-index: 90;
pointer-events: none;
opacity: 0.05;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* ---- outlined display text ---- */
.text-outline {
color: transparent;
-webkit-text-stroke: 1px rgba(237, 237, 230, 0.16);
}
/* ---- vertical safety tape strip ---- */
.tape-v {
background-image: repeating-linear-gradient(
45deg,
#ffb800 0 10px,
#0b1224 10px 20px
);
}