commit 5bff2047c82f7acf5d0d3af42f6e459a0535fde2 Author: Min Zeya Phyo Date: Thu Jan 15 12:26:31 2026 +0630 Initial React test app diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa0926a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +.env +*.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..811b036 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Build stage +FROM node:20-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build + +# Production stage +FROM node:20-alpine + +WORKDIR /app + +RUN npm install -g serve + +COPY --from=builder /app/dist ./dist + +EXPOSE 3000 + +CMD ["serve", "-s", "dist", "-l", "3000"] diff --git a/index.html b/index.html new file mode 100644 index 0000000..9015e37 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + React Test App + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..af4120d --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "react-test", + "version": "1.0.0", + "private": true, + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "start": "serve -s dist -l 3000" + }, + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@types/react": "^18.2.0", + "@types/react-dom": "^18.2.0", + "@vitejs/plugin-react": "^4.2.0", + "serve": "^14.2.0", + "vite": "^5.0.0" + } +} diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..6ddcc0c --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,47 @@ +import { useState, useEffect } from 'react' + +function App() { + const [time, setTime] = useState(new Date().toLocaleString()) + + useEffect(() => { + const timer = setInterval(() => { + setTime(new Date().toLocaleString()) + }, 1000) + return () => clearInterval(timer) + }, []) + + return ( +
+

React Test Application

+

Unity Platform - Coolify Deployment Test

+ +
+

Status

+
+ Application: Running +
+
+ +
+

Environment

+
    +
  • React Version: 18.2.0
  • +
  • Build Tool: Vite 5.0
  • +
  • Mode: {import.meta.env.MODE}
  • +
  • Server Time: {time}
  • +
+
+ +
+

Features

+
    +
  • Hot Module Replacement (HMR)
  • +
  • Fast Refresh
  • +
  • Production optimized build
  • +
+
+
+ ) +} + +export default App diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..0279a88 --- /dev/null +++ b/src/index.css @@ -0,0 +1,76 @@ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + min-height: 100vh; + padding: 40px 20px; +} + +.container { + max-width: 600px; + margin: 0 auto; +} + +h1 { + color: white; + font-size: 2.5rem; + margin-bottom: 10px; + text-shadow: 2px 2px 4px rgba(0,0,0,0.2); +} + +.subtitle { + color: rgba(255,255,255,0.9); + font-size: 1.1rem; + margin-bottom: 30px; +} + +.card { + background: white; + padding: 25px; + border-radius: 12px; + box-shadow: 0 10px 40px rgba(0,0,0,0.2); + margin-bottom: 20px; +} + +.card h3 { + color: #333; + margin-bottom: 15px; + font-size: 1.2rem; +} + +.status { + padding: 12px 20px; + border-radius: 8px; + font-size: 1rem; +} + +.status.ok { + background: #d4edda; + color: #155724; +} + +ul { + list-style: none; +} + +li { + padding: 8px 0; + border-bottom: 1px solid #eee; +} + +li:last-child { + border-bottom: none; +} + +code { + background: #e9ecef; + padding: 3px 8px; + border-radius: 4px; + font-family: 'Monaco', 'Menlo', monospace; + font-size: 0.9em; +} diff --git a/src/main.jsx b/src/main.jsx new file mode 100644 index 0000000..5cc5991 --- /dev/null +++ b/src/main.jsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App' +import './index.css' + +ReactDOM.createRoot(document.getElementById('root')).render( + + + , +) diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..8a8fd1d --- /dev/null +++ b/vite.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +export default defineConfig({ + plugins: [react()], + server: { + host: '0.0.0.0', + port: 3000 + }, + preview: { + host: '0.0.0.0', + port: 3000 + } +})