diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6f47933 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ + +# Gemini API Key (Obtenha em https://aistudio.google.com/) +API_KEY=sua_chave_aqui diff --git a/index.html b/index.html index fcbaaf2..75fa44a 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,4 @@ + @@ -15,7 +16,7 @@ font-family: 'Akzidenz Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #F8FAFC; /* Slate 50 */ } - /* Custom scrollbar for a cleaner look */ + /* Custom scrollbar */ ::-webkit-scrollbar { width: 8px; height: 8px; @@ -45,11 +46,11 @@ 200: '#fed7aa', 300: '#fdba74', 400: '#fb923c', - 500: '#f97316', // Orange-500 main accent + 500: '#f97316', 600: '#ea580c', }, secondary: { - 900: '#0f172a', // Dark slate for text + 900: '#0f172a', 800: '#1e293b', } }, @@ -65,17 +66,23 @@
+ - \ No newline at end of file + diff --git a/package.json b/package.json index a1b3839..b2c9394 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,29 @@ + { - "name": "comfi", + "name": "comfi-management-system", "private": true, - "version": "0.0.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", - "build": "vite build", - "preview": "vite preview" + "build": "tsc && vite build", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview", + "start": "node server.js" }, "dependencies": { - "react-dom": "^19.2.3", - "lucide-react": "^0.562.0", - "react": "^19.2.3", - "recharts": "^3.6.0", - "@google/genai": "^1.39.0" + "@google/genai": "^1.39.0", + "lucide-react": "^0.454.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "recharts": "^2.13.0", + "express": "^4.21.1" }, "devDependencies": { - "@types/node": "^22.14.0", - "@vitejs/plugin-react": "^5.0.0", - "typescript": "~5.8.2", - "vite": "^6.2.0" + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", + "@vitejs/plugin-react": "^4.3.3", + "typescript": "^5.6.3", + "vite": "^5.4.10" } } diff --git a/server.js b/server.js new file mode 100644 index 0000000..3b9db38 --- /dev/null +++ b/server.js @@ -0,0 +1,22 @@ + +import express from 'express'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const app = express(); +const PORT = process.env.PORT || 8080; + +// Servir os arquivos estáticos da pasta 'dist' gerada pelo build do Vite +app.use(express.static(path.join(__dirname, 'dist'))); + +// Redirecionar todas as rotas para o index.html (suporte a SPA) +app.get('*', (req, res) => { + res.sendFile(path.join(__dirname, 'dist', 'index.html')); +}); + +app.listen(PORT, () => { + console.log(`Servidor rodando na porta ${PORT}`); +}); diff --git a/tsconfig.json b/tsconfig.json index 2c6eed5..f16b70c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,29 +1,22 @@ + { "compilerOptions": { - "target": "ES2022", - "experimentalDecorators": true, - "useDefineForClassFields": false, - "module": "ESNext", - "lib": [ - "ES2022", - "DOM", - "DOM.Iterable" - ], + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, "skipLibCheck": true, - "types": [ - "node" - ], - "moduleResolution": "bundler", + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Node", + "resolveJsonModule": true, "isolatedModules": true, - "moduleDetection": "force", - "allowJs": true, - "jsx": "react-jsx", - "paths": { - "@/*": [ - "./*" - ] - }, - "allowImportingTsExtensions": true, - "noEmit": true - } -} \ No newline at end of file + "noEmit": true, + "jsx": "react-jsx" + }, + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["node_modules", "dist"] +} diff --git a/vite.config.ts b/vite.config.ts index ee5fb8d..dd6e2c4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,23 +1,15 @@ -import path from 'path'; -import { defineConfig, loadEnv } from 'vite'; + +import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; -export default defineConfig(({ mode }) => { - const env = loadEnv(mode, '.', ''); - return { - server: { - port: 3000, - host: '0.0.0.0', - }, - plugins: [react()], - define: { - 'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY), - 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY) - }, - resolve: { - alias: { - '@': path.resolve(__dirname, '.'), - } - } - }; +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], + define: { + 'process.env': process.env + }, + build: { + outDir: 'dist', + emptyOutDir: true, + } });