Ir al contenido

Inicio Rápido

  • Node.js 18+
  • MySQL 8.x accesible (o credenciales en AWS Secrets Manager)
  • AWS CLI configurado con permisos a Secrets Manager, Lambda y SQS
  • Acceso a las credenciales STP del ambiente de desarrollo
Ventana de terminal
git clone <repo-url>
cd finalitixspeiapi
npm install

Crea un archivo .env en la raíz del proyecto:

Ventana de terminal
# Ambiente
ENV=dev
PORT=3010
REGION=us-east-1
# Base de datos (nombre usado para logs)
DATABASE=database
# AWS Secrets Manager
CREDENTIALS_SECRET=secret/db/dev
STP_SECRET_NAME=secret/stp/dev
# Lambda functions
FUNCTION_FINALITIXNOTIFICATIONS_NAME=FinalitixNotifications
FUNCTION_FINALITIXNOTIFICATIONSPUBSUB_NAME=FinalitixNotificationsPubSub
FUNCTION_FINALITIXCONTACT_NAME=FinalitixContact
# SQS
ACC_MOVE_SQS_URL=https://sqs.us-east-1.amazonaws.com/ACCOUNT_ID/acc-move.fifo
CUSTOMER_NOTIFICATION_SQS_URL=https://sqs.us-east-1.amazonaws.com/ACCOUNT_ID/customer-notif.fifo
# Zona horaria para cálculo de periodos
ACCOUNT_CRON_TZ=America/Monterrey
# Modo mock (omitir para conectar a STP real)
API_IMPLMENTATION=MOCK
Ventana de terminal
npm run dev
# → Servidor escuchando en http://localhost:3010
Ventana de terminal
# Health check básico
curl http://localhost:3010/health
# {"status":"ok","uptime":4.2}
# Health check del router
curl http://localhost:3010/
# "API Finalitix!"
Ventana de terminal
curl -X POST http://localhost:3010/api/v1/connection \
-H "Content-Type: application/json" \
-d '{
"module": "account",
"method": "postAccount",
"params": {
"user_id": "uuid-del-usuario",
"alias": "Cuenta Principal"
}
}'

Respuesta esperada:

{
"statusCode": 200,
"body": {
"success": true,
"status": 200,
"result": { "account_number": "64618001000001237" },
"message": "Cuenta creada correctamente.."
}
}