migrate to ci and postgress

This commit is contained in:
2026-02-08 20:06:17 +03:00
parent 88fcc33e87
commit f839d215f3
16 changed files with 1195 additions and 240 deletions

View File

@ -8,19 +8,27 @@
## Стек
- **Framework:** NestJS
- **Framework:** NestJS 11
- **Language:** TypeScript
- **Runtime:** Node.js
- **Database:** PostgreSQL (shared-db) + TypeORM
- **CI/CD:** Drone CI + ci-templates
## Структура
```
src/
├── main.ts # Точка входа
├── app.module.ts # Корневой модуль
├── app.module.ts # Корневой модуль (ConfigModule + TypeORM)
├── app.controller.ts # REST контроллер
├── app.service.ts # Бизнес-логика
├── schemas.ts # Валидация данных
├── app.service.ts # Бизнес-логика (TypeORM Repository)
├── entities/
│ ├── user.entity.ts # Entity: users
│ └── storage.entity.ts # Entity: storages
├── health/
│ ├── health.module.ts # Health check модуль
│ └── health.controller.ts # GET /health
├── schemas.ts # Swagger DTO
├── types.ts # TypeScript типы
├── consts.ts # Константы
└── api.responses.ts # Форматы ответов API
@ -37,6 +45,13 @@ npm run start:prod # Production запуск
## Деплой
- **Dockerfile:** есть
- **CI/CD:** Drone CI через ci-templates (service.yaml + .drone.yml)
- **Namespace:** backend-for-learning
- **URL:** https://simple-storage.vigdorov.ru
- **Health:** GET /health
## Локальная разработка
Переменные окружения в `.env.local`:
- `DATABASE_HOST` — хост PostgreSQL (localhost для dev через NodePort :30432)
- `DATABASE_PORT`, `DATABASE_USER`, `DATABASE_PASSWORD`, `DATABASE_NAME`