Skip to content

Commit f0b8163

Browse files
added app.jsx + files (#1)
* upload app.jsx added master code into repo * Initialize package.json for project manager app * Add initial HTML structure * Initialize React application in main.jsx added a source folder and main.jsx file for app rendering * Initialize Vite configuration with React plugin using VITE react plugin to bundle and parse JSX components * Rename App.jsx to src/App.jsx moving to src file * Add Tailwind CSS configuration file for css rendering * Add PostCSS configuration with Tailwind CSS and Autoprefixer * Create index.css with Tailwind and safe area styles Add mobile safe area styling for padding. * Rename src/tailwind.config.js to tailwind.config.js moved to root folder * Rename src/postcss.config.js to postcss.config.js moved to root folder * Add manifest.json for web app configuration for PWA mobile app rendering * Add service worker for asset caching Implement a service worker to cache assets for offline use. * Add service worker registration to index.html updated index.html for app routing * Update project name and short name in manifest * Rename cache from 'project-mgr' to 'project-hub' * Update .gitignore to include additional patterns rewritten for react and vite common .gitignore files. * Rename project and update version in package.json * Update cache name to version 0.2.0 for versioning and update continuity
1 parent a15ae9b commit f0b8163

11 files changed

Lines changed: 858 additions & 19 deletions

File tree

.gitignore

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
1-
# Compiled class file
2-
*.class
1+
# Dependencies
2+
node_modules/
3+
.pnpm-store/
34

4-
# Log file
5-
*.log
5+
# Build outputs
6+
dist/
7+
dist-ssr/
8+
*.local
9+
10+
# Editor directories and files
11+
.vscode/*
12+
!.vscode/extensions.json
13+
.idea/
14+
*.suo
15+
*.ntvs*
16+
*.njsproj
17+
*.sln
18+
*.sw?
619

7-
# BlueJ files
8-
*.ctxt
20+
# Logs
21+
logs
22+
*.log
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
pnpm-debug.log*
27+
lerna-debug.log*
928

10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
29+
# Environment variables
30+
.env
31+
.env.local
32+
.env.*.local
1233

13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
34+
# OS
35+
.DS_Store
36+
Thumbs.db
2137

22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
24-
replay_pid*
38+
# Vite specific
39+
*.env.*.local
40+
!*.env.*.local.sample

index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6+
<title>Project Hub</title>
7+
<link rel="manifest" href="/manifest.json" />
8+
<meta name="theme-color" content="#111827" />
9+
</head>
10+
<body class="bg-gray-900 selection:bg-pink-500 selection:text-white">
11+
<div id="root"></div>
12+
<script type="module" src="/src/main.jsx"></script>
13+
<script>
14+
if ('serviceWorker' in navigator) {
15+
window.addEventListener('load', () => {
16+
navigator.serviceWorker.register('/sw.js')
17+
.then(reg => console.log('Service Worker registered successfully!', reg))
18+
.catch(err => console.log('Service Worker registration failed: ', err));
19+
});
20+
}
21+
</script>
22+
</body>
23+
</html>

package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "project-hub",
3+
"private": true,
4+
"version": "0.2.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"lucide-react": "^0.400.0",
13+
"react": "^18.3.1",
14+
"react-dom": "^18.3.1"
15+
},
16+
"devDependencies": {
17+
"@types/react": "^18.3.3",
18+
"@types/react-dom": "^18.3.0",
19+
"@vitejs/plugin-react": "^4.3.1",
20+
"autoprefixer": "^10.4.19",
21+
"postcss": "^8.4.38",
22+
"tailwindcss": "^3.4.4",
23+
"vite": "^5.3.1"
24+
}
25+
}

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

public/manifest.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"short_name": "Project Hub",
3+
"name": "Project manager for solo devs",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "icon-192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "icon-512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"background_color": "#111827",
23+
"theme_color": "#111827",
24+
"display": "standalone",
25+
"orientation": "portrait"
26+
}

public/sw.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const CACHE_NAME = 'project-hub-v0.2.0';
2+
const ASSETS = [
3+
'/',
4+
'/index.html',
5+
'/src/main.jsx',
6+
'/src/App.jsx',
7+
'/src/index.css',
8+
'/manifest.json'
9+
];
10+
11+
// Install Service Worker and Cache Assets
12+
self.addEventListener('install', (e) => {
13+
e.waitUntil(
14+
caches.open(CACHE_NAME).then((cache) => {
15+
return cache.addAll(ASSETS);
16+
})
17+
);
18+
});
19+
20+
// Cache and Return Requests
21+
self.addEventListener('fetch', (e) => {
22+
e.respondWith(
23+
caches.match(e.request).then((response) => {
24+
return response || fetch(e.request);
25+
})
26+
);
27+
});

0 commit comments

Comments
 (0)