- Backend migrado a estructura VPS (src/ subfolder) - Frontend con estructura Vite + React 19 + Tailwind - Configuración PostgreSQL con Pool - API service con interceptores JWT - Ambos servidores funcionando (backend:3001, frontend:5173)
115 lines
1.5 KiB
Markdown
115 lines
1.5 KiB
Markdown
# 🛠️ Comandos Útiles
|
|
|
|
## Desarrollo
|
|
|
|
```bash
|
|
# Iniciar servidor de desarrollo
|
|
npm run dev
|
|
|
|
# Iniciar en puerto específico
|
|
npm run dev -- --port 3000
|
|
|
|
# Abrir automáticamente en navegador
|
|
npm run dev -- --open
|
|
```
|
|
|
|
## Build
|
|
|
|
```bash
|
|
# Build de producción
|
|
npm run build
|
|
|
|
# Preview del build
|
|
npm run preview
|
|
|
|
# Build con análisis de bundle
|
|
npm run build -- --mode production
|
|
```
|
|
|
|
## Dependencias
|
|
|
|
```bash
|
|
# Instalar todas las dependencias
|
|
npm install
|
|
|
|
# Agregar nueva dependencia
|
|
npm install nombre-paquete
|
|
|
|
# Agregar dependencia de desarrollo
|
|
npm install -D nombre-paquete
|
|
|
|
# Actualizar dependencias
|
|
npm update
|
|
|
|
# Auditar vulnerabilidades
|
|
npm audit
|
|
npm audit fix
|
|
```
|
|
|
|
## Linting y formato
|
|
|
|
```bash
|
|
# Ejecutar linter
|
|
npm run lint
|
|
|
|
# Fix automático de problemas
|
|
npm run lint -- --fix
|
|
```
|
|
|
|
## Testing (si está configurado)
|
|
|
|
```bash
|
|
# Ejecutar tests
|
|
npm test
|
|
|
|
# Tests en modo watch
|
|
npm test -- --watch
|
|
|
|
# Coverage
|
|
npm test -- --coverage
|
|
```
|
|
|
|
## Tailwind CSS
|
|
|
|
```bash
|
|
# Regenerar clases de Tailwind
|
|
npx tailwindcss -i ./src/index.css -o ./dist/output.css --watch
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
```bash
|
|
# Limpiar caché de npm
|
|
npm cache clean --force
|
|
|
|
# Eliminar node_modules y reinstalar
|
|
rm -rf node_modules package-lock.json
|
|
npm install
|
|
|
|
# Verificar versión de Node
|
|
node --version
|
|
npm --version
|
|
```
|
|
|
|
## Despliegue
|
|
|
|
### Vercel
|
|
```bash
|
|
npm install -g vercel
|
|
vercel
|
|
```
|
|
|
|
### Netlify
|
|
```bash
|
|
npm install -g netlify-cli
|
|
netlify deploy --prod
|
|
```
|
|
|
|
### Build manual para servidor
|
|
```bash
|
|
npm run build
|
|
# Subir carpeta dist/ al servidor
|
|
scp -r dist/* usuario@servidor:/var/www/dominio/
|
|
```
|
|
|