- Node.js (v18 or higher)
- pnpm (v10.9.0 or higher)
- MongoDB instance
- Clone the repository:
git clone https://github.com/upskill-team/Back-End-DSW.git
cd Back-End-DSW- Install dependencies:
pnpm install- Create a
.envfile in the root directory with the following variables:
PORT=3000
NODE_ENV=development
# MongoDB
MONGO_USER=your_mongodb_user
MONGO_PASS=your_mongodb_password
MONGO_CLUSTER=your_mongodb_cluster
MONGO_DB_NAME=your_database_name
# JWT
JWT_SECRET=your_jwt_secret
# Email (Nodemailer)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email_user
EMAIL_PASS=your_email_password
# Email (Resend - Optional)
RESEND_API_KEY=your_resend_api_key
EMAIL_FROM=onboarding@resend.dev
# Cloudinary
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
# Mercado Pago
MP_ACCESS_TOKEN=your_mercadopago_access_token
# Frontend URL
NGROK_FRONTEND_URL=http://localhost:5173
# Backend URL (for webhooks)
LOCALTUNNEL_BACKEND_URL=http://localhost:3000
# Logtail (Optional)
LOG_SOURCE_TOKEN=your_logtail_token
LOG_SOURCE_URL=your_logtail_urlDevelopment mode:
pnpm start:devProduction build:
pnpm build
pnpm start:prodThe server will start on http://localhost:3000
Swagger API Documentation: Once the server is running, access the interactive API documentation at:
http://localhost:3000/api-docs
TypeScript/TSDoc Documentation: Generate and view the code documentation:
pnpm run tdocsThen open docs/index.html in your browser.
You can view the updated documentation at https://upskill-team.github.io/Back-End-DSW/
pnpm start:dev- Start development server with hot reloadpnpm start:prod- Start production serverpnpm build- Compile TypeScript to JavaScriptpnpm lint- Run ESLintpnpm test- Run all testspnpm test:coverage- Run tests with coverage reportpnpm tdocs- Generate TypeScript documentation
- Node.js (v18 o superior)
- pnpm (v10.9.0 o superior)
- Instancia de MongoDB
- Clonar el repositorio:
git clone https://github.com/upskill-team/Back-End-DSW.git
cd Back-End-DSW- Instalar dependencias:
pnpm install- Crear un archivo
.enven el directorio raiz con las siguientes variables:
PORT=3000
NODE_ENV=development
# MongoDB
MONGO_USER=tu_usuario_mongodb
MONGO_PASS=tu_contrasena_mongodb
MONGO_CLUSTER=tu_cluster_mongodb
MONGO_DB_NAME=nombre_de_tu_base_de_datos
# JWT
JWT_SECRET=tu_secreto_jwt
# Email (Nodemailer)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=tu_usuario_email
EMAIL_PASS=tu_contrasena_email
# Email (Resend - Opcional)
RESEND_API_KEY=tu_clave_api_resend
EMAIL_FROM=onboarding@resend.dev
# Cloudinary
CLOUDINARY_CLOUD_NAME=tu_nombre_cloudinary
CLOUDINARY_API_KEY=tu_clave_cloudinary
CLOUDINARY_API_SECRET=tu_secreto_cloudinary
# Mercado Pago
MP_ACCESS_TOKEN=tu_token_acceso_mercadopago
# URL Frontend
NGROK_FRONTEND_URL=http://localhost:5173
# URL Backend (para webhooks)
LOCALTUNNEL_BACKEND_URL=http://localhost:3000
# Logtail (Opcional)
LOG_SOURCE_TOKEN=tu_token_logtail
LOG_SOURCE_URL=tu_url_logtailModo desarrollo:
pnpm start:devCompilacion para produccion:
pnpm build
pnpm start:prodEl servidor iniciara en http://localhost:3000
Documentacion de la API con Swagger: Una vez que el servidor este ejecutandose, accede a la documentacion interactiva de la API en:
http://localhost:3000/api-docs
Documentacion de TypeScript/TSDoc: Generar y ver la documentacion del codigo:
pnpm run tdocsLuego abre docs/index.html en tu navegador.
Puedes ver la documentación actualizada en https://upskill-team.github.io/Back-End-DSW/
pnpm start:dev- Iniciar servidor de desarrollo con recarga automaticapnpm start:prod- Iniciar servidor de produccionpnpm build- Compilar TypeScript a JavaScriptpnpm lint- Ejecutar ESLintpnpm test- Ejecutar todas las pruebaspnpm test:coverage- Ejecutar pruebas con reporte de coberturapnpm tdocs- Generar documentacion TypeScript
Back-End-DSW/
├── src/
│ ├── app.ts # Express app configuration
│ ├── server.ts # Server entry point
│ ├── auth/ # Authentication module
│ ├── models/ # Business entities and logic
│ ├── shared/ # Shared utilities and services
│ ├── emails/ # Email templates and services
│ └── docs/ # API documentation (Swagger)
├── dist/ # Compiled JavaScript output
├── docs/ # Generated TSDoc documentation
└── coverage/ # Test coverage reports