diff --git a/apps/react/.gitignore b/apps/react/.gitignore new file mode 100644 index 000000000..d72db9efe --- /dev/null +++ b/apps/react/.gitignore @@ -0,0 +1,21 @@ +# dependencies +node_modules/ +*.lock +package-lock.json + +# production +dist/ +dist-ssr/ +*.local + +# compiled output +src/**/*.js +src/**/*.js.map + +# misc +.DS_Store +*.log +*.swp +*.swo +.vscode +.idea diff --git a/apps/react/index.html b/apps/react/index.html new file mode 100644 index 000000000..703f949e3 --- /dev/null +++ b/apps/react/index.html @@ -0,0 +1,13 @@ + + + + + + + Aeroflot Flights + + +
+ + + diff --git a/apps/react/package.json b/apps/react/package.json new file mode 100644 index 000000000..0328d4367 --- /dev/null +++ b/apps/react/package.json @@ -0,0 +1,32 @@ +{ + "name": "@aeroflot-flights/react", + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-router-dom": "^6.15.0", + "primereact": "^10.0.0", + "primeicons": "^6.0.0", + "leaflet": "^1.7.1", + "i18next": "^23.7.0", + "i18next-http-backend": "^2.4.0", + "react-i18next": "^13.5.0", + "axios": "^1.6.0", + "@tanstack/react-query": "^5.28.0", + "zustand": "^4.4.0" + }, + "devDependencies": { + "vite": "^5.0.0", + "@vitejs/plugin-react": "^4.2.0", + "typescript": "^5.3.0", + "@types/react": "^18.2.0", + "@types/react-dom": "^18.2.0", + "sass": "^1.69.0" + } +} diff --git a/apps/react/src/app/App.tsx b/apps/react/src/app/App.tsx new file mode 100644 index 000000000..925de583d --- /dev/null +++ b/apps/react/src/app/App.tsx @@ -0,0 +1,8 @@ +export default function App() { + return ( +
+

Aeroflot Flights - React Migration

+

Coming soon...

+
+ ) +} diff --git a/apps/react/src/main.tsx b/apps/react/src/main.tsx new file mode 100644 index 000000000..e37672a01 --- /dev/null +++ b/apps/react/src/main.tsx @@ -0,0 +1,7 @@ +import ReactDOM from 'react-dom/client' +import App from './app/App' +import './styles/index.scss' + +ReactDOM.createRoot(document.getElementById('root')!).render( + , +) diff --git a/apps/react/src/styles/index.scss b/apps/react/src/styles/index.scss new file mode 100644 index 000000000..d8c60b97a --- /dev/null +++ b/apps/react/src/styles/index.scss @@ -0,0 +1,41 @@ +/* Main styles for Aeroflot Flights React App */ + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + background-color: #f5f5f5; +} + +#root { + width: 100%; + height: 100%; +} + +.app { + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 20px; + + h1 { + font-size: 2.5rem; + margin-bottom: 1rem; + color: #333; + } + + p { + font-size: 1.1rem; + color: #666; + } +} diff --git a/apps/react/tsconfig.json b/apps/react/tsconfig.json new file mode 100644 index 000000000..fee72036f --- /dev/null +++ b/apps/react/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "resolveJsonModule": true, + "moduleResolution": "bundler", + "jsx": "react-jsx", + "baseUrl": ".", + "paths": { + "@app/*": ["./src/app/*"], + "@styles/*": ["./src/styles/*"], + "@assets/*": ["./src/assets/*"] + } + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/apps/react/tsconfig.node.json b/apps/react/tsconfig.node.json new file mode 100644 index 000000000..42872c59f --- /dev/null +++ b/apps/react/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/apps/react/vite.config.ts b/apps/react/vite.config.ts new file mode 100644 index 000000000..161d289e1 --- /dev/null +++ b/apps/react/vite.config.ts @@ -0,0 +1,22 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import path from 'path' + +export default defineConfig({ + plugins: [react()], + server: { + port: 3001, + open: false, + }, + resolve: { + alias: { + '@app': path.resolve(__dirname, './src/app'), + '@styles': path.resolve(__dirname, './src/styles'), + '@assets': path.resolve(__dirname, './src/assets'), + }, + }, + build: { + outDir: 'dist', + sourcemap: false, + }, +})