Initial commit from react-vite boilerplate

This commit is contained in:
Min Zeya Phyo
2026-01-20 12:14:35 +06:30
commit 92f4d037b1
19 changed files with 420 additions and 0 deletions

14
src/App.tsx Normal file
View File

@@ -0,0 +1,14 @@
import { Routes, Route } from 'react-router-dom'
import Home from './pages/Home'
import NotFound from './pages/NotFound'
function App() {
return (
<Routes>
<Route path="/" element={<Home />} />
<Route path="*" element={<NotFound />} />
</Routes>
)
}
export default App

25
src/main.tsx Normal file
View File

@@ -0,0 +1,25 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import App from './App'
import './styles/index.css'
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 1000 * 60 * 5, // 5 minutes
retry: 1,
},
},
})
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<BrowserRouter>
<App />
</BrowserRouter>
</QueryClientProvider>
</React.StrictMode>,
)

32
src/pages/Home.tsx Normal file
View File

@@ -0,0 +1,32 @@
export default function Home() {
return (
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 flex items-center justify-center">
<div className="text-center">
<h1 className="text-4xl font-bold text-gray-900 mb-4">
Welcome to bp-rect
</h1>
<p className="text-lg text-gray-600 mb-8">
Your React + Vite application is running!
</p>
<div className="space-x-4">
<a
href="https://vitejs.dev"
target="_blank"
rel="noopener noreferrer"
className="inline-block px-6 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition"
>
Vite Docs
</a>
<a
href="https://react.dev"
target="_blank"
rel="noopener noreferrer"
className="inline-block px-6 py-3 bg-white text-indigo-600 border border-indigo-600 rounded-lg hover:bg-indigo-50 transition"
>
React Docs
</a>
</div>
</div>
</div>
)
}

18
src/pages/NotFound.tsx Normal file
View File

@@ -0,0 +1,18 @@
import { Link } from 'react-router-dom'
export default function NotFound() {
return (
<div className="min-h-screen bg-gray-50 flex items-center justify-center">
<div className="text-center">
<h1 className="text-6xl font-bold text-gray-900 mb-4">404</h1>
<p className="text-xl text-gray-600 mb-8">Page not found</p>
<Link
to="/"
className="inline-block px-6 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition"
>
Go Home
</Link>
</div>
</div>
)
}

15
src/styles/index.css Normal file
View File

@@ -0,0 +1,15 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
}
body {
margin: 0;
min-width: 320px;
min-height: 100vh;
}

9
src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_API_URL: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}