🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
250 lines
5.3 KiB
Markdown
250 lines
5.3 KiB
Markdown
---
|
|
id: "STACK-IA"
|
|
title: "Stack Tecnologico - Inmobiliaria Analytics"
|
|
type: "Technical Document"
|
|
version: "1.0.0"
|
|
status: "Active"
|
|
created_date: "2026-01-04"
|
|
updated_date: "2026-01-04"
|
|
---
|
|
|
|
# Stack Tecnologico - Inmobiliaria Analytics
|
|
|
|
---
|
|
|
|
## Resumen
|
|
|
|
Documentacion detallada del stack tecnologico seleccionado para el proyecto Inmobiliaria Analytics.
|
|
|
|
---
|
|
|
|
## Stack Principal
|
|
|
|
### Backend
|
|
|
|
| Componente | Tecnologia | Version | Justificacion |
|
|
|------------|------------|---------|---------------|
|
|
| Runtime | Node.js | 20.x LTS | Estabilidad y soporte largo plazo |
|
|
| Framework | NestJS | 10.3.x | Arquitectura modular, TypeScript nativo |
|
|
| ORM | TypeORM | 0.3.x | Integracion con NestJS, migraciones |
|
|
| Validacion | class-validator | 0.14.x | Decoradores para DTOs |
|
|
| Transformacion | class-transformer | 0.5.x | Serializacion de objetos |
|
|
|
|
### Autenticacion
|
|
|
|
| Componente | Tecnologia | Version | Justificacion |
|
|
|------------|------------|---------|---------------|
|
|
| Framework | Passport | 0.7.x | Estrategias flexibles |
|
|
| Token | JWT | 10.x | Stateless, escalable |
|
|
| Local | passport-local | 1.0.x | Login con usuario/password |
|
|
| Hashing | bcrypt | 5.1.x | Seguridad para passwords |
|
|
|
|
### Frontend
|
|
|
|
| Componente | Tecnologia | Version | Justificacion |
|
|
|------------|------------|---------|---------------|
|
|
| Framework | React | 18.x | Ecosistema maduro |
|
|
| Lenguaje | TypeScript | 5.3.x | Type safety |
|
|
| Build | Vite | 5.x | Desarrollo rapido |
|
|
| Estado | Zustand | 4.x | Simple y performante |
|
|
| Estilos | Tailwind CSS | 3.x | Utility-first |
|
|
| Charts | Recharts | 2.x | React-native charts |
|
|
|
|
### Base de Datos
|
|
|
|
| Componente | Tecnologia | Version | Justificacion |
|
|
|------------|------------|---------|---------------|
|
|
| RDBMS | PostgreSQL | 16.x | ACID, extensiones geograficas |
|
|
| Cache | Redis | 7.x | Alto rendimiento |
|
|
| Driver | pg | 8.11.x | Driver PostgreSQL para Node |
|
|
|
|
### Infraestructura
|
|
|
|
| Componente | Tecnologia | Version | Justificacion |
|
|
|------------|------------|---------|---------------|
|
|
| Contenedores | Docker | 24.x | Portabilidad |
|
|
| Orquestacion | Docker Compose | 2.x | Desarrollo local |
|
|
| Proxy/LB | Traefik | 3.x | Routing dinamico |
|
|
|
|
---
|
|
|
|
## Dependencias del Backend
|
|
|
|
### Produccion
|
|
|
|
```json
|
|
{
|
|
"@nestjs/common": "^10.3.0",
|
|
"@nestjs/config": "^3.1.1",
|
|
"@nestjs/core": "^10.3.0",
|
|
"@nestjs/jwt": "^10.2.0",
|
|
"@nestjs/passport": "^10.0.3",
|
|
"@nestjs/platform-express": "^10.3.0",
|
|
"@nestjs/typeorm": "^10.0.1",
|
|
"bcrypt": "^5.1.1",
|
|
"class-transformer": "^0.5.1",
|
|
"class-validator": "^0.14.1",
|
|
"passport": "^0.7.0",
|
|
"passport-jwt": "^4.0.1",
|
|
"passport-local": "^1.0.0",
|
|
"pg": "^8.11.3",
|
|
"reflect-metadata": "^0.2.1",
|
|
"rxjs": "^7.8.1",
|
|
"typeorm": "^0.3.19",
|
|
"stripe": "^14.0.0"
|
|
}
|
|
```
|
|
|
|
### Desarrollo
|
|
|
|
```json
|
|
{
|
|
"@nestjs/cli": "^10.3.0",
|
|
"@nestjs/schematics": "^10.1.0",
|
|
"@nestjs/testing": "^10.3.0",
|
|
"@types/bcrypt": "^5.0.2",
|
|
"@types/express": "^4.17.21",
|
|
"@types/jest": "^29.5.11",
|
|
"@types/node": "^20.10.6",
|
|
"@types/passport-jwt": "^4.0.0",
|
|
"@types/passport-local": "^1.0.38",
|
|
"@typescript-eslint/eslint-plugin": "^6.18.0",
|
|
"@typescript-eslint/parser": "^6.18.0",
|
|
"eslint": "^8.56.0",
|
|
"eslint-config-prettier": "^9.1.0",
|
|
"eslint-plugin-prettier": "^5.1.2",
|
|
"jest": "^29.7.0",
|
|
"prettier": "^3.1.1",
|
|
"supertest": "^6.3.4",
|
|
"ts-jest": "^29.1.1",
|
|
"ts-node": "^10.9.2",
|
|
"typescript": "^5.3.3"
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## Configuracion de Puertos
|
|
|
|
| Servicio | Puerto | Ambiente |
|
|
|----------|--------|----------|
|
|
| Frontend | 3100 | Todos |
|
|
| Backend API | 3101 | Todos |
|
|
| WebSocket | 3102 | Todos |
|
|
| PostgreSQL | 5439 | Local |
|
|
| Redis | 6386 | Local |
|
|
|
|
---
|
|
|
|
## Variables de Entorno
|
|
|
|
### Aplicacion
|
|
|
|
```env
|
|
# App
|
|
APP_NAME=inmobiliaria-analytics
|
|
APP_PORT=3101
|
|
APP_ENV=development
|
|
API_PREFIX=api
|
|
|
|
# CORS
|
|
CORS_ORIGIN=http://localhost:3100
|
|
```
|
|
|
|
### Base de Datos
|
|
|
|
```env
|
|
# PostgreSQL
|
|
DB_HOST=localhost
|
|
DB_PORT=5439
|
|
DB_USERNAME=postgres
|
|
DB_PASSWORD=postgres
|
|
DB_DATABASE=inmobiliaria_analytics
|
|
DB_SYNCHRONIZE=true
|
|
DB_LOGGING=true
|
|
|
|
# Redis
|
|
REDIS_HOST=localhost
|
|
REDIS_PORT=6386
|
|
```
|
|
|
|
### Seguridad
|
|
|
|
```env
|
|
# JWT
|
|
JWT_SECRET=your-secret-key
|
|
JWT_EXPIRES_IN=1d
|
|
JWT_REFRESH_EXPIRES_IN=7d
|
|
```
|
|
|
|
---
|
|
|
|
## Scripts de Desarrollo
|
|
|
|
### Backend
|
|
|
|
```bash
|
|
# Desarrollo
|
|
npm run start:dev
|
|
|
|
# Build
|
|
npm run build
|
|
|
|
# Tests
|
|
npm run test
|
|
npm run test:cov
|
|
npm run test:e2e
|
|
|
|
# Linting
|
|
npm run lint
|
|
npm run format
|
|
```
|
|
|
|
### Base de Datos
|
|
|
|
```bash
|
|
# Migraciones (futuro)
|
|
npm run migration:generate -- -n MigrationName
|
|
npm run migration:run
|
|
npm run migration:revert
|
|
```
|
|
|
|
---
|
|
|
|
## Herramientas de Desarrollo
|
|
|
|
| Herramienta | Proposito |
|
|
|-------------|-----------|
|
|
| ESLint | Linting de codigo |
|
|
| Prettier | Formateo de codigo |
|
|
| Jest | Testing unitario y e2e |
|
|
| Swagger | Documentacion API |
|
|
| Docker Compose | Ambiente local |
|
|
|
|
---
|
|
|
|
## Extensiones Futuras
|
|
|
|
| Componente | Tecnologia | Proposito |
|
|
|------------|------------|-----------|
|
|
| Search | Elasticsearch | Busqueda avanzada |
|
|
| ML | Python/FastAPI | Predicciones |
|
|
| Queue | BullMQ | Jobs asinconos |
|
|
| Metrics | Prometheus | Monitoreo |
|
|
| Logs | ELK Stack | Centralizacion |
|
|
|
|
---
|
|
|
|
## Referencias
|
|
|
|
- [ADR-001-stack-tecnologico.md](../97-adr/ADR-001-stack-tecnologico.md)
|
|
- [ARQUITECTURA-GENERAL.md](./ARQUITECTURA-GENERAL.md)
|
|
- [package.json](../../apps/backend/package.json)
|
|
|
|
---
|
|
|
|
**Documento:** Stack Tecnologico
|
|
**Version:** 1.0.0
|
|
**Estado:** Active
|
|
**Ultima actualizacion:** 2026-01-04
|