Repository navigation
docs: fix VPS path and fill Commands in CLAUDE.md #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
| |---|---| | ||
| | GitHub | https://github.com/tulubyev/delivery-platform | | ||
| | Локально | `~/Dropbox/DEV/Delivery` | | ||
| | VPS | `/opt/delivery-platform` (90.156.168.149) | | ||
| | VPS | `/var/www/lastmiles` (90.156.168.149) | | ||
| | Прод | lastmiles.ru | | ||
| | Стек | pnpm-монорепо — Express + Prisma + BullMQ, React/Vite, Expo | | ||
|
|
||
|
|
@@ -28,4 +28,41 @@ | |
|
|
||
| ## Команды | ||
|
|
||
| <!-- заполнить: установка, запуск, сборка, тесты, деплой --> | ||
| Установка и локальный запуск (нужен `.env` по образцу `.env.example`): | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| pnpm --filter @delivery/shared build # shared собирается первым, иначе tsc не видит @delivery/shared | ||
| pnpm --filter api exec prisma generate # после установки и после правок schema.prisma | ||
| pnpm dev:api # API | ||
| pnpm dev:web # web (Vite) | ||
| ``` | ||
|
|
||
| Проверка типов (тестов в проекте нет, `lint` = `tsc --noEmit`): | ||
|
|
||
| ```bash | ||
| pnpm lint | ||
| ``` | ||
|
|
||
| База данных: | ||
|
|
||
| ```bash | ||
| pnpm db:migrate # dev-миграции | ||
| pnpm --filter api db:migrate:prod # prisma migrate deploy (на проде делает контейнер сам) | ||
| pnpm --filter api db:seed # сид | ||
| ``` | ||
|
|
||
| Деплой на VPS (`/var/www/lastmiles`, пользователь с sudo): | ||
|
|
||
| ```bash | ||
| cd /var/www/lastmiles && sudo git pull --ff-only origin main | ||
| sudo docker compose up -d --build api # API: пересборка и пересоздание контейнера | ||
| sudo pnpm --filter @delivery/shared build && sudo pnpm --filter web build # фронт: dist раздаёт nginx, рестарт не нужен | ||
| ``` | ||
|
|
||
| Заметки по инфраструктуре: | ||
|
|
||
| - Фронт: nginx на хосте, `root /var/www/lastmiles/apps/web/dist`, порт 8080. Перед ним Traefik. | ||
| - API: контейнер `delivery-api` в сети `traefik-public`. Traefik маршрутизирует `api.lastmiles.ru` на `http://delivery-api:3000` (конфиг в репозитории `vps-server-infra`, файл `traefik/dynamic.yml`). | ||
|
Comment on lines
+65
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: set -eu
printf '%s\n' '--- diff CLAUDE.md ---'
git diff --unified=25 fc8621983611786acc404815a72e9596f7014487 4420de01358b5da69f68713ad43fccfc953b23c8 -- CLAUDE.md
printf '%s\n' '--- README routing section ---'
nl -ba README.md | sed -n '155,205p'
printf '%s\n' '--- relevant infrastructure and deployment references ---'
rg -n -S --glob '!node_modules' --glob '!dist' --glob '!build' 'lastmiles\.ru|api\.lastmiles\.ru|127\.0\.0\.1:3100|delivery-api:3000|traefik-public|root /var/www|listen 8080|listen 80|nginx' .Repository: tulubyev/delivery-platform Length of output: 11371 🏁 Script executed: set -eu
printf '%s\n' '--- nginx configuration ---'
nl -ba nginx/nginx.conf | sed -n '1,155p'
printf '%s\n' '--- docker compose ---'
nl -ba docker-compose.yml | sed -n '1,75p'
printf '%s\n' '--- topology-file changes across PR ---'
git diff --name-status fc8621983611786acc404815a72e9596f7014487 4420de01358b5da69f68713ad43fccfc953b23c8 -- nginx/nginx.conf docker-compose.yml scripts/server-setup.sh README.md
printf '%s\n' '--- referenced infrastructure checkout ---'
if [ -d ../vps-server-infra ]; then
rg -n -S 'lastmiles\.ru|api\.lastmiles\.ru|delivery-api|listen 8080|127\.0\.0\.1:3100' ../vps-server-infra
else
printf '%s\n' 'vps-server-infra is not present in the checkout'
fiRepository: tulubyev/delivery-platform Length of output: 7516 Align the VPS routing documentation.
🤖 Prompt for AI Agents |
||
| - Миграции применяются автоматически: при старте контейнер API выполняет `prisma migrate deploy`, затем `node dist/app.js`. Если миграция падает, ошибка уходит в лог контейнера, а API всё равно стартует. | ||
| - Вход защищён капчей Aptogon: нужен `APTOGON_SECRET_KEY` в `.env`, отключить можно `CAPTCHA_ENABLED=false`. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n -C 4 'VPS_HOST|/opt/delivery-platform|APP_DIR' .github/workflows/deploy.yml scripts/setup-vps.shRepository: tulubyev/delivery-platform
Length of output: 2720
🏁 Script executed:
Repository: tulubyev/delivery-platform
Length of output: 2251
🏁 Script executed:
Repository: tulubyev/delivery-platform
Length of output: 6240
Align deployment paths with the documented VPS path.
If
VPS_HOSTpoints to90.156.168.149, the deployment workflow can stop atcd /opt/delivery-platformbecause the documented checkout is/var/www/lastmiles. The setup script also clones and uses the old path. Update both paths.🐛 Suggested fix
🤖 Prompt for AI Agents