[ERP-VIDRIO-TEMPLADO] feat: Create backend scaffold
- package.json with Express, TypeORM, PostgreSQL dependencies - tsconfig.json with TypeScript compiler options - src/index.ts with health and API info endpoints - .gitignore with standard exclusions - Build compiles successfully Ready for module implementation (8 modules planned) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b20c0a59d3
commit
0628a86ec1
37
.gitignore
vendored
Normal file
37
.gitignore
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
# Dependencies
|
||||
node_modules/
|
||||
|
||||
# Build output
|
||||
dist/
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Environment files
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Test coverage
|
||||
coverage/
|
||||
.nyc_output/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Temporary files
|
||||
tmp/
|
||||
temp/
|
||||
2981
package-lock.json
generated
Normal file
2981
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
46
package.json
Normal file
46
package.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "erp-vidrio-templado-backend",
|
||||
"version": "0.1.0",
|
||||
"description": "Backend para ERP de Vidrio Templado - Sistema de gestión de producción, cotización y despacho",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js",
|
||||
"dev": "ts-node-dev --respawn --transpile-only src/index.ts",
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"keywords": [
|
||||
"erp",
|
||||
"vidrio-templado",
|
||||
"glass",
|
||||
"manufacturing",
|
||||
"production"
|
||||
],
|
||||
"author": "ISEM",
|
||||
"license": "UNLICENSED",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
"typeorm": "^0.3.17",
|
||||
"pg": "^8.11.3",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"dotenv": "^16.3.1",
|
||||
"cors": "^2.8.5",
|
||||
"helmet": "^7.1.0",
|
||||
"class-validator": "^0.14.0",
|
||||
"class-transformer": "^0.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.3.3",
|
||||
"@types/node": "^20.10.0",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/pg": "^8.10.9",
|
||||
"ts-node": "^10.9.2",
|
||||
"ts-node-dev": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
}
|
||||
70
src/index.ts
Normal file
70
src/index.ts
Normal file
@ -0,0 +1,70 @@
|
||||
/**
|
||||
* ERP Vidrio Templado - Backend
|
||||
*
|
||||
* Sistema de gestión para plantas de vidrio templado
|
||||
*
|
||||
* Módulos planificados:
|
||||
* - VT-001: Fundamentos (Auth, Users, Tenants)
|
||||
* - VT-002: Cotizaciones (Cotizador por m²)
|
||||
* - VT-003: Producción (Órdenes de producción)
|
||||
* - VT-004: Inventario (Stock vidrio/MP)
|
||||
* - VT-005: Corte (Optimización nesting)
|
||||
* - VT-006: Templado (Control de hornos)
|
||||
* - VT-007: Calidad (QC y certificaciones)
|
||||
* - VT-008: Despacho (Logística entregas)
|
||||
*/
|
||||
|
||||
import 'reflect-metadata';
|
||||
import express from 'express';
|
||||
import cors from 'cors';
|
||||
import helmet from 'helmet';
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3000;
|
||||
|
||||
// Middleware
|
||||
app.use(helmet());
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
|
||||
// Health check endpoint
|
||||
app.get('/health', (req, res) => {
|
||||
res.json({
|
||||
status: 'ok',
|
||||
service: 'erp-vidrio-templado-backend',
|
||||
version: '0.1.0',
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
});
|
||||
|
||||
// API info endpoint
|
||||
app.get('/api', (req, res) => {
|
||||
res.json({
|
||||
name: 'ERP Vidrio Templado API',
|
||||
version: '0.1.0',
|
||||
description: 'Sistema de gestión para plantas de vidrio templado',
|
||||
modules: [
|
||||
'VT-001: Fundamentos',
|
||||
'VT-002: Cotizaciones',
|
||||
'VT-003: Producción',
|
||||
'VT-004: Inventario',
|
||||
'VT-005: Corte',
|
||||
'VT-006: Templado',
|
||||
'VT-007: Calidad',
|
||||
'VT-008: Despacho',
|
||||
],
|
||||
status: 'scaffold - en desarrollo',
|
||||
});
|
||||
});
|
||||
|
||||
// Start server
|
||||
if (require.main === module) {
|
||||
app.listen(PORT, () => {
|
||||
console.log(`ERP Vidrio Templado backend running on port ${PORT}`);
|
||||
});
|
||||
}
|
||||
|
||||
export default app;
|
||||
30
tsconfig.json
Normal file
30
tsconfig.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "commonjs",
|
||||
"lib": ["ES2022"],
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": false,
|
||||
"noImplicitAny": false,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"strictPropertyInitialization": false,
|
||||
"moduleResolution": "node",
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"@config/*": ["config/*"],
|
||||
"@modules/*": ["modules/*"],
|
||||
"@shared/*": ["shared/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user