38 Commits
Author SHA1 Message Date
mohmdsdgandCursor 0903a1c1e9 Ship deploy build for multi-company order items.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-15 10:38:10 +03:30
mohmdsdgandCursor 63646b9f01 Replace demo admins with a single login and drop fake inbox seed.
Only 09128081392 / 123456 remains as admin; remove seeded internal messages and add a reset-admin script for production databases.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 16:25:37 +03:30
mohmdsdgandCursor fd187ea2ee Add global admin checks list and deepen check notification links.
Expose GET /admin/checks with order context, and point admin check alerts to the per-order checks page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 16:17:51 +03:30
mohmdsdgandCursor d4aaa8e997 Rebuild order flow: settle after pricing, notifications, and invoice expiry.
Hide prices until admin sends the invoice, enforce status transitions, add customer/admin SMS+in-app notifications, schedule cash invoice reminders, and ship updated dist/prisma-client/deploy-bundle for git-pull deploys.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 12:00:13 +03:30
mohmdsdgandCursor 06e5f48d07 Clarify login OTP message when phone is not registered
Tell the user no account exists and to register, instead of a bare
"user not found" string on the login OTP request path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 16:49:39 +03:30
mohmdsdgandCursor d5dfd6a0f0 Ship prebuilt Prisma client so the server never runs prisma generate
prisma generate needs over three minutes on the production host, which made
every deploy hang on that build step. The client is now generated on the dev
machine into prisma-client.tar.gz (tracked, 8.5MB) and the image just untars
it. Dropping the unused linux-musl engine target halves that payload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 16:35:06 +03:30
mohmdsdgandCursor aa9b3ee451 Cache prisma generate layer so routine deploys rebuild only dist
prisma generate takes ~110s on the production host and it sat after COPY dist,
so every deploy paid for it. Moving schema copy and generate ahead of dist
means a code-only deploy reuses that layer and finishes in seconds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 16:22:45 +03:30
mohmdsdgandCursor 811f671e78 Restore git-pull-only deploy: single compose path with schema from git
Deploy is back to the flow that worked: build dist locally, push, then on the
server only `git pull` + `docker compose up -d --build`. The Dockerfile now
also takes prisma/ and package.json from git and runs `prisma generate`, so
schema and migration changes ship without rebuilding the 120MB node_modules
bundle. Removes the prebuilt compose path, which could never work on a server
without npm.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 16:14:53 +03:30
mohmdsdgandCursor a0da04e1ae Update lockfile so prisma installs with production dependencies.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 15:55:51 +03:30
mohmdsdgandCursor 25d9038632 Keep prisma in production dependencies for container migrate.
Prebuilt images copy host node_modules; with omit=dev the CLI was missing and the API crash-looped.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 15:54:23 +03:30
mohmdsdgandCursor 4e48275054 Use local Prisma binary in entrypoint to avoid npx network hang.
npx can stall checking the registry on restricted networks; migrate never finished so the API never started.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 15:49:42 +03:30
mohmdsdgandCursor 6703d2080a Fix prebuilt API boot: use bookworm and pass .env into container.
Alpine lacked OpenSSL so Prisma migrate hung and Nest never started; also restore env_file so GLOBAL_PREFIX and SMS settings reach the API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 15:38:25 +03:30
mohmdsdgandCursor 86b3146836 Allow prebuilt Docker context files through .dockerignore.
Dockerfile.prebuilt needs package.json, prisma, and node_modules in the build context; the previous ignore whitelist blocked them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 15:12:41 +03:30
mohmdsdgandCursor 345a4a4708 Add SMS OTP, harden auth, and fix order/checkout server bugs.
Ship 4-digit OTP with rate-limit attempts, Tehran-safe expiry/rass math, larger JSON body limit for check images, and safer order pricing/status guards. Include rebuilt dist for prebuilt deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 14:55:26 +03:30
mohmdsdgandCursor b121797263 Support LiteSpeed /server path via GLOBAL_PREFIX
Allow Nest prefix server/api and overlay dist from git onto the deploy bundle so proxy paths match without a full retar.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 09:55:57 +03:30
mohmdsdgandCursor 2d513a81af Expose API on host port 8585 for LiteSpeed proxy
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 09:18:08 +03:30
mohmdsdgandCursor 85900f649c Use full node:22-bookworm image so OpenSSL is available without apt
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 22:11:34 +03:30
mohmdsdgandCursor fd98ffb7a3 Skip apt-get in Dockerfile for servers blocked from Debian mirrors
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 22:07:34 +03:30
mohmdsdgandCursor fe324936c8 Fix Prisma runtime by switching API image to Debian slim
Alpine musl is incompatible with host-built Prisma engines; use bookworm-slim and allow updating entrypoint without repacking the bundle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 22:04:27 +03:30
mohmdsdgandCursor 6ed952cc5d Extract deploy bundle inside Dockerfile so server needs no tar command
Server workflow is only git pull and docker compose up --build; env still comes from .env.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 22:00:15 +03:30
mohmdsdgandCursor 8cedf9f082 Add deploy-bundle.tar.gz for git-based server deploy
Ship prebuilt dist and production node_modules so the server only pulls and extracts, without npm or scp.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:51:28 +03:30
mohmdsdgandCursor d2e385d1f9 Fix pack-bundle prisma generate with DATABASE_URL
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:49:02 +03:30
mohmdsdgandCursor b620dd0015 Add offline deploy bundle with dist and production node_modules
Allow shipping a tarball so the server Docker image only copies files and never runs npm.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:43:59 +03:30
mohmdsdgandCursor 44f030bc06 Clean tsbuildinfo before nest build to avoid empty dist
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:38:33 +03:30
mohmdsdgandCursor df765c9296 Fix local dist build by clearing incremental cache before nest build
Nest deleteOutDir plus stale tsbuildinfo left an empty dist; force clean tsc emit and commit the rebuilt output.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:38:22 +03:30
mohmdsdgandCursor cbcea58e94 Deploy via committed dist: local Nest build, server runs with .env
Build on the developer machine without Docker, commit dist/, and run on the server with Dockerfile.dist plus compose env_file.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:35:22 +03:30
mohmdsdgandCursor 67cfc17079 Align main compose with server .env env_file loading
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:29:32 +03:30
mohmdsdgandCursor 1b249e0b57 Load runtime config from server .env via compose env_file
Keep secrets out of the image; only override DATABASE_URL host for the Docker network.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:29:21 +03:30
mohmdsdgandCursor 1fdbae1791 Add local Docker image build and export for server deploy
Build and gzip the API image on a machine with good network, then docker load on the server without remote npm builds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:28:35 +03:30
mohmdsdgandCursor 81d0571d72 Speed up deploy by using portable Node on host disk
Avoid slow npm installs over Docker bind mounts; download Node from npmmirror and build on the server filesystem.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:27:41 +03:30
mohmdsdgandCursor 1fe99fd688 Pull Node image via IranServer Docker mirror by default
Avoid slow/blocked docker.io pulls when running deploy-host-build.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:20:29 +03:30
mohmdsdgandCursor 68f0d45adf Build with temporary Node container so host Node is not required
Use docker run node:22-alpine for npm ci/build, then package via Dockerfile.prebuilt.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:19:21 +03:30
mohmdsdgandCursor 56afc032d2 Add host-build deploy path for slow Docker npm installs
Install and build on the server host with npmmirror, then package a slim image without network during docker build.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:17:44 +03:30
mohmdsdgandCursor ad236b7357 Switch npm mirror to npmmirror after IranServer 404s
IranServer npm mirror lacks packages; use registry.npmmirror.com which matches npmjs URL layout for lockfile rewrites.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:00:13 +03:30
mohmdsdgandCursor 5e973d7f2c Use Iranian npm mirror and rewrite package-lock URLs
npm ci ignores registry config when lockfile points at registry.npmjs.org; rewrite resolved URLs to mirror.iranserver.com before install.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 20:54:35 +03:30
mohmdsdgandCursor 5ed1b83457 Fix npm registry ARG so builds use npmmirror by default
ARG after FROM was empty without an explicit default, so npm ci hit the slow/blocked official registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 20:49:49 +03:30
mohmdsdgandCursor 9a9566dd50 Fix Docker build for restricted Alpine CDN access
Drop apk openssl (node alpine already has it) and use npmmirror by default so Iranian servers can build without Alpine TLS failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 20:37:59 +03:30
mohmdsdgandCursor 9f0422c1db Add NestJS fabric trade API with Prisma and Docker
Provide backend for admin and user apps with Postgres, migrations, seed data, and docker-compose for LiteSpeed reverse-proxy deployment.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 20:26:39 +03:30