2026-05-05 00:01:06 +03:30
# Dyolink
2026-06-23 15:54:13 +03:30
Monorepo: **NestJS ** backend (`backend/` ), **Next.js ** frontend (`frontend/` ), **Docker ** stack under `infrastructure/` ..
2026-05-05 00:01:06 +03:30
Local development: see * * `backend/README.md` ** and * * `frontend/README.md` **.
2026-07-12 21:08:29 +03:30
**Cursor AI:** project conventions for agents are in [`AGENTS.md` ](AGENTS.md ), [`.cursor/rules/` ](.cursor/rules/ ), and [`.cursor/skills/` ](.cursor/skills/ ).
2026-05-05 00:01:06 +03:30
---
2026-07-07 15:32:25 +03:30
## Production deploy (Docker Hub + HTTPS + Let's Encrypt)
**Full step-by-step guide:** [`infrastructure/DEPLOY.md` ](infrastructure/DEPLOY.md )
Minimal server setup: install Docker, create `.env` + `secrets/` , `docker login` , run one script.
| On server (once) | In repo / Docker |
|------------------|------------------|
| DNS A record → server IP | `docker-compose.prod.yml` , nginx, certbot |
| `docker login` (private Hub) | Build & push images from dev machine |
| `secrets/database.env` , `secrets/backend.env` | Examples: `database.prod.env.example` , `backend.prod.env.example` |
| `infrastructure/.env` (`DOMAIN` , `LETSENCRYPT_EMAIL` ) | `deploy.prod.env.example` |
**Dev machine** — build frontend with the public domain baked in, push to Docker Hub:
```bash
./infrastructure/scripts/build-and-push-prod.sh wixur.ir latest
```
**Server** — from `infrastructure/` :
```bash
cp deploy.prod.env.example .env # edit DOMAIN, paths
mkdir -p ../secrets && cp database.prod.env.example ../secrets/database.env
cp backend.prod.env.example ../secrets/backend.env # set passwords + FRONTEND_URL
docker login
chmod +x scripts/*.sh
./scripts/deploy-prod.sh
```
SSL is issued automatically via **Certbot ** (`scripts/init-letsencrypt.sh` ). Nginx config is generated from `DOMAIN` in `.env` . When you move to another domain (e.g. `dyolink.com` ), update `.env` + `backend.env` , re-run `init-letsencrypt.sh` , and **rebuild the frontend image ** with the new URL.
---
2026-08-23 11:10:28 +03:30
## Staging deploy (Gitea Actions + Windows)
2026-05-05 00:01:06 +03:30
2026-08-23 11:10:28 +03:30
**Full guide:** [`infrastructure/STAGING-DEPLOY.md` ](infrastructure/STAGING-DEPLOY.md )
2026-05-05 00:01:06 +03:30
2026-08-23 11:10:28 +03:30
Merge or push to * * `master` ** → Gitea Actions builds images → deploys to `http://<host>:8088` .
2026-05-05 00:01:06 +03:30
2026-08-23 11:10:28 +03:30
Workflow: [`.gitea/workflows/registry-build-deploy.yml` ](.gitea/workflows/registry-build-deploy.yml )
2026-05-05 00:01:06 +03:30
---
## Related paths
| Path | Role |
|------|------|
| `backend/Dockerfile` | API image |
| `frontend/Dockerfile` | Web image |
2026-08-23 11:10:28 +03:30
| `infrastructure/STAGING-DEPLOY.md` | Staging setup, CI variables, testing |
2026-05-05 00:01:06 +03:30
| `infrastructure/docker-compose.registry.yml` | Pull-only staging stack (registry images + nginx + postgres) |
| `infrastructure/deploy.registry.env.example` | Template for `deploy.registry.env` |