From efc8cef4cd30ab8d1a05cd0aad3d7feee7898472 Mon Sep 17 00:00:00 2001 From: Adrian Flores Cortes Date: Sun, 25 Jan 2026 09:51:26 -0600 Subject: [PATCH] feat: Initial frontend structure for ERP Transportistas - React 18.x with Vite configuration - TailwindCSS with transport-themed colors - Leaflet for map integration - TypeScript setup with path aliases Co-Authored-By: Claude Opus 4.5 --- package.json | 55 ++++++++++++++++++++++++++++++++++++++++++++++ tailwind.config.js | 39 ++++++++++++++++++++++++++++++++ tsconfig.json | 32 +++++++++++++++++++++++++++ vite.config.ts | 32 +++++++++++++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 package.json create mode 100644 tailwind.config.js create mode 100644 tsconfig.json create mode 100644 vite.config.ts diff --git a/package.json b/package.json new file mode 100644 index 0000000..a1c8634 --- /dev/null +++ b/package.json @@ -0,0 +1,55 @@ +{ + "name": "@erp-transportistas/frontend", + "version": "1.0.0", + "description": "Frontend SPA para ERP Transportistas - Vertical de transporte de carga y logistica", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "preview": "vite preview", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "lint:fix": "eslint . --ext ts,tsx --fix", + "typecheck": "tsc --noEmit", + "test": "vitest", + "test:ui": "vitest --ui", + "test:cov": "vitest run --coverage" + }, + "dependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-dom": "^6.28.0", + "zustand": "^5.0.1", + "axios": "^1.7.7", + "@tanstack/react-query": "^5.8.4", + "lucide-react": "^0.460.0", + "date-fns": "^2.30.0", + "clsx": "^2.0.0", + "react-hook-form": "^7.48.2", + "@hookform/resolvers": "^3.3.2", + "zod": "^3.22.4", + "leaflet": "^1.9.4", + "react-leaflet": "^4.2.1" + }, + "devDependencies": { + "@types/react": "^18.2.43", + "@types/react-dom": "^18.2.17", + "@types/leaflet": "^1.9.8", + "@vitejs/plugin-react": "^4.2.1", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.32", + "tailwindcss": "^3.4.15", + "typescript": "^5.3.2", + "vite": "^5.0.8", + "vitest": "^1.0.4", + "eslint": "^8.54.0", + "@typescript-eslint/eslint-plugin": "^6.12.0", + "@typescript-eslint/parser": "^6.12.0", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "author": "ISEM", + "license": "PROPRIETARY" +} diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..7c27b6d --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,39 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + "./index.html", + "./src/**/*.{js,ts,jsx,tsx}", + ], + theme: { + extend: { + colors: { + // Colores del giro transporte + transport: { + 50: '#f0f9ff', + 100: '#e0f2fe', + 200: '#bae6fd', + 300: '#7dd3fc', + 400: '#38bdf8', + 500: '#0ea5e9', + 600: '#0284c7', + 700: '#0369a1', + 800: '#075985', + 900: '#0c4a6e', + }, + // Estados de viaje + status: { + draft: '#9ca3af', // Borrador + planned: '#3b82f6', // Planeado + dispatched: '#f59e0b', // Despachado + in_transit: '#10b981', // En transito + at_destination: '#8b5cf6', // En destino + delivered: '#22c55e', // Entregado + closed: '#6b7280', // Cerrado + invoiced: '#0ea5e9', // Facturado + collected: '#059669', // Cobrado + }, + }, + }, + }, + plugins: [], +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..fce1048 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "ES2022", + "useDefineForClassFields": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "baseUrl": "./src", + "paths": { + "@/*": ["./*"], + "@shared/*": ["shared/*"], + "@components/*": ["shared/components/*"], + "@hooks/*": ["shared/hooks/*"], + "@stores/*": ["shared/stores/*"], + "@services/*": ["services/*"], + "@features/*": ["features/*"], + "@pages/*": ["pages/*"] + } + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..fb8c794 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import path from 'path'; + +export default defineConfig({ + plugins: [react()], + resolve: { + alias: { + '@': path.resolve(__dirname, './src'), + '@shared': path.resolve(__dirname, './src/shared'), + '@components': path.resolve(__dirname, './src/shared/components'), + '@hooks': path.resolve(__dirname, './src/shared/hooks'), + '@stores': path.resolve(__dirname, './src/shared/stores'), + '@services': path.resolve(__dirname, './src/services'), + '@features': path.resolve(__dirname, './src/features'), + '@pages': path.resolve(__dirname, './src/pages'), + }, + }, + server: { + port: 5174, + proxy: { + '/api': { + target: 'http://localhost:3014', + changeOrigin: true, + }, + }, + }, + build: { + outDir: 'dist', + sourcemap: true, + }, +});