From 81db74aa635766ce1be0bb56d28218bdc1867935 Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Sai Potteri Date: Fri, 22 May 2026 22:28:56 +0530 Subject: [PATCH] Add Vite/TS/Tailwind root scaffolding so frontgen runs npm build --- .gitignore | 4 ++++ index.html | 16 ++++++++++++++++ package.json | 29 +++++++++++++++++++++++++++++ postcss.config.js | 6 ++++++ src/vite-env.d.ts | 11 +++++++++++ tailwind.config.js | 13 +++++++++++++ tsconfig.app.json | 19 +++++++++++++++++++ tsconfig.json | 7 +++++++ tsconfig.node.json | 15 +++++++++++++++ vite.config.ts | 28 ++++++++++++++++++++++++++++ 10 files changed, 148 insertions(+) create mode 100644 .gitignore create mode 100644 index.html create mode 100644 package.json create mode 100644 postcss.config.js create mode 100644 src/vite-env.d.ts create mode 100644 tailwind.config.js create mode 100644 tsconfig.app.json create mode 100644 tsconfig.json create mode 100644 tsconfig.node.json create mode 100644 vite.config.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b08070 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +.env +*.local diff --git a/index.html b/index.html new file mode 100644 index 0000000..2f77b97 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + + + + Test Drive Lead Manager + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..61a4748 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "tech-mahindra", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "typecheck": "tsc -b", + "preview": "vite preview" + }, + "dependencies": { + "@tanstack/react-query": "^5.60.5", + "lucide-react": "^0.441.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-dom": "^6.26.0" + }, + "devDependencies": { + "@types/react": "^18.3.5", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.1", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.41", + "tailwindcss": "^3.4.10", + "typescript": "~5.5.4", + "vite": "^5.4.2" + } +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..2e7af2b --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..8b9be6e --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1,11 @@ +/// + +interface ImportMetaEnv { + readonly VITE_ZINO_API_URL?: string; + readonly VITE_ZINO_MOCK?: string; + readonly VITE_BASE_URL?: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..2eba43a --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,13 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], + darkMode: 'class', + theme: { + extend: { + fontFamily: { + sans: ['Inter', 'system-ui', '-apple-system', 'sans-serif'], + }, + }, + }, + plugins: [], +} diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 0000000..0a8be2d --- /dev/null +++ b/tsconfig.app.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + "strict": false, + "noUnusedLocals": false, + "noUnusedParameters": false + }, + "include": ["src"] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..816a195 --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "strict": true + }, + "include": ["vite.config.ts"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..4303f2e --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,28 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; + +const devTarget = "https://sandbox.getzino.in"; +const proxy = (target: string) => ({ target, changeOrigin: true, secure: false }); + +export default defineConfig({ + plugins: [react()], + base: process.env.VITE_BASE_URL ?? "/tech_mahindra/", + server: { + port: 3005, + proxy: { + "/login": proxy(devTarget), + "/apps": proxy(devTarget), + "/agents": proxy(devTarget), + "/start": proxy(devTarget), + "/activity": proxy(devTarget), + "/instance": proxy(devTarget), + "/form": proxy(devTarget), + "/pa": proxy(devTarget), + "/recordview": proxy(devTarget), + "/detailview": proxy(devTarget), + "/audit": proxy(devTarget), + "/api-docs": proxy(devTarget), + "/app/": proxy(devTarget), + }, + }, +});