Skip to content

Commit 72cdfb7

Browse files
committed
Add quick deployment guide and update API URL in tests
- Created a new file `DEPLOY-QUICK.md` with a concise deployment guide for production, covering configuration, migration, and deployment steps for Docker, Vercel, and static clients. - Updated `DEPLOY.md` to include the new quick deployment instructions. - Modified the test file `files.test.ts` to use `NEXT_PUBLIC_API_URL` for the API endpoint, ensuring consistency with environment variable usage. Files modified: - DEPLOY-QUICK.md: New deployment guide added. - DEPLOY.md: Updated to reference quick deployment instructions. - lib/files/files.test.ts: Updated API URL reference in tests.
1 parent 09be227 commit 72cdfb7

File tree

3 files changed

+485
-1
lines changed

3 files changed

+485
-1
lines changed

DEPLOY-QUICK.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# ⚡ Быстрый деплой на продакшен
2+
3+
## 🎯 Минимальные шаги
4+
5+
### 1. Конфигурация (ОБЯЗАТЕЛЬНО!)
6+
7+
```bash
8+
npx hasyx config
9+
```
10+
11+
**Что настроить:**
12+
- Hasura (URL, секреты)
13+
- Host (публичный URL, порт)
14+
- NextAuth Secrets (NEXTAUTH_SECRET, NEXTAUTH_URL)
15+
- Остальное по необходимости
16+
17+
### 2. Применение миграций и схемы
18+
19+
```bash
20+
npx hasyx migrate # Применить миграции БД
21+
npx hasyx schema # Генерировать типы из Hasura
22+
npx hasyx events # Синхронизировать event triggers
23+
```
24+
25+
### 3. Деплой
26+
27+
#### Docker:
28+
```bash
29+
# Сборка
30+
docker build -t your-app:latest \
31+
--build-arg NEXT_PUBLIC_HASURA_GRAPHQL_URL="..." \
32+
--build-arg NEXT_PUBLIC_MAIN_URL="..." \
33+
# ... остальные NEXT_PUBLIC_* переменные
34+
35+
# Запуск
36+
npx hasyx docker define 3000
37+
```
38+
39+
#### Vercel:
40+
```bash
41+
# 1. Настройте VERCEL_TOKEN и VERCEL_PROJECT_NAME в .env
42+
# 2. Синхронизируйте переменные окружения
43+
npx hasyx vercel sync
44+
# 3. Push в репозиторий - деплой автоматический
45+
```
46+
47+
#### Статический клиент:
48+
```bash
49+
npm run client # Сборка в client/
50+
# Затем задеплойте client/ директорию
51+
```
52+
53+
## ⚠️ Критически важно
54+
55+
1. **НЕ редактируйте `.env` вручную!** Только через `npx hasyx config`
56+
2. **Все секреты** должны быть в `hasyx.config.json` или переменных окружения платформы
57+
3. **Проверьте сборку** локально перед деплоем: `npm run build`
58+
59+
## 📋 Обязательные переменные
60+
61+
- `NEXT_PUBLIC_HASURA_GRAPHQL_URL`
62+
- `HASURA_ADMIN_SECRET`
63+
- `HASURA_JWT_SECRET`
64+
- `HASURA_EVENT_SECRET`
65+
- `NEXTAUTH_SECRET`
66+
- `NEXTAUTH_URL`
67+
- `NEXT_PUBLIC_MAIN_URL`
68+
69+
Полный список см. в [DEPLOY.md](./DEPLOY.md)
70+

0 commit comments

Comments
 (0)