scaffold: modern rewrite skeleton (backend + frontend PWA) + roadmap
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Frontend README
|
||||
|
||||
This folder contains a minimal React + Vite app scaffold with PWA manifest and a small Service Worker.
|
||||
|
||||
Next steps:
|
||||
- Run `npm install` then `npm run dev` to start local dev server.
|
||||
- Replace placeholder UI with real components and integrate with backend.
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>LifeRPG Modern</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "LifeRPG Modern",
|
||||
"short_name": "LifeRPG",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#ffffff",
|
||||
"description": "A modern, cross-platform habit-leveling app.",
|
||||
"icons": []
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "liferpg-modern-frontend",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "^5.0.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
|
||||
export default function App(){
|
||||
return (
|
||||
<div style={{padding:20,fontFamily:'system-ui, sans-serif'}}>
|
||||
<h1>LifeRPG Modern</h1>
|
||||
<p>Welcome — frontend scaffold. Connect to backend at <code>/api/v1</code>.</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import React from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import App from './App'
|
||||
|
||||
createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
// Minimal service worker (cache-first for shell)
|
||||
const CACHE = 'liferpg-shell-v1'
|
||||
self.addEventListener('install', (e) => {
|
||||
e.waitUntil(
|
||||
caches.open(CACHE).then((cache) => cache.addAll(['/','/index.html']))
|
||||
)
|
||||
})
|
||||
self.addEventListener('fetch', (e) => {
|
||||
e.respondWith(
|
||||
caches.match(e.request).then((r) => r || fetch(e.request))
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user