Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Database
DATABASE_URL="postgresql://acme_user:acme_password@localhost:5432/acme_workflow"

# Redis
REDIS_URL="redis://localhost:6379"

# AI API Keys
OPENAI_API_KEY=""
ANTHROPIC_API_KEY=""

# Backend
NODE_ENV="development"
PORT=3001

# Frontend
NEXT_PUBLIC_API_URL="http://localhost:3001"
NEXT_PUBLIC_WS_URL="ws://localhost:3001"

# Optional - for enhanced content generation
SERPER_API_KEY="" # Get your free key here https://serper.dev/api-keys
GOOGLE_CUSTOM_SEARCH_API_KEY=""
GOOGLE_CUSTOM_SEARCH_ENGINE_ID=""
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Directorios de Build
.next/

# Dependencias
node_modules

# Variables de Entorno
.env
.env.local
.env.development.local
.env.production.local

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Caché de TypeScript
*.tsbuildinfo

# Caché del Linter
.eslintcache

# Archivos del Sistema Operativo
.DS_Store
Thumbs.db
22 changes: 22 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Database
DATABASE_URL="postgresql://acme_user:acme_password@localhost:5432/acme_workflow"

# Redis
REDIS_URL="redis://localhost:6379"

# AI API Keys
OPENAI_API_KEY=""
ANTHROPIC_API_KEY=""

# Backend
NODE_ENV="development"
PORT=3001

# Frontend
NEXT_PUBLIC_API_URL="http://localhost:3001"
NEXT_PUBLIC_WS_URL="ws://localhost:3001"

# Optional - for enhanced content generation
SERPER_API_KEY="" # Get your free key here https://serper.dev/api-keys
GOOGLE_CUSTOM_SEARCH_API_KEY=""
GOOGLE_CUSTOM_SEARCH_ENGINE_ID=""
15 changes: 15 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Dependencias
node_modules

# Output de NestJS
dist/

# Variables de Entorno
.env
.env.local

# Logs
npm-debug.log*
yarn-error.log

/generated/prisma
24 changes: 24 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:18-alpine

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm ci --only=production --legacy-peer-deps

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Al intentar levantar locamente, me falló el compose en esta parte.

El --only=production provoca que no se instale @nestjs/cli (dev), entonces no existe nest para compilar. Solución: (1) quitar la flag en dev (lo que hice yo, suficiente para ambientes no productivos), o (2) usar multi-stage: compilar con dev deps y luego prunar a prod para el runtime.

Ejemplo de la opción 2 (AI generated así que puede fallar):

# deps (instala dev+prod)
FROM node:18-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --legacy-peer-deps

# build (compila)
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npx prisma generate
RUN npm run build

# runtime (solo prod)
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production

COPY package*.json ./
COPY --from=builder /app/node_modules ./node_modules
RUN npm prune --production

COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma

EXPOSE 3001
CMD ["node", "dist/main.js"]


# Copy source code
COPY . .

# Generate Prisma client
RUN npx prisma generate

# Build the application
RUN npm run build

# Expose port
EXPOSE 3001

# Start the application
CMD ["npm", "run", "start:prod"]
8 changes: 8 additions & 0 deletions backend/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading