jamilvite 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +66 -0
- package/TODO.md +6 -0
- package/package.json +33 -0
- package/src/cli.js +133 -0
- package/templates/template-js-cdn/index.html +13 -0
- package/templates/template-js-cdn/package.json +23 -0
- package/templates/template-js-cdn/postcss.config.js +6 -0
- package/templates/template-js-cdn/src/App.jsx +15 -0
- package/templates/template-js-cdn/src/components/Nav.jsx +28 -0
- package/templates/template-js-cdn/src/main.jsx +13 -0
- package/templates/template-js-cdn/src/pages/About.jsx +23 -0
- package/templates/template-js-cdn/src/pages/Home.jsx +42 -0
- package/templates/template-js-cdn/src/pages/NotFound.jsx +15 -0
- package/templates/template-js-cdn/src/routes/Router.jsx +16 -0
- package/templates/template-js-cdn/src/styles/index.css +11 -0
- package/templates/template-js-cdn/tailwind.config.js +10 -0
- package/templates/template-js-cdn/vite.config.js +6 -0
- package/templates/template-js-local/index.html +12 -0
- package/templates/template-js-local/package.json +23 -0
- package/templates/template-js-local/postcss.config.js +6 -0
- package/templates/template-js-local/src/App.jsx +15 -0
- package/templates/template-js-local/src/components/Nav.jsx +28 -0
- package/templates/template-js-local/src/main.jsx +14 -0
- package/templates/template-js-local/src/pages/About.jsx +23 -0
- package/templates/template-js-local/src/pages/Home.jsx +42 -0
- package/templates/template-js-local/src/pages/NotFound.jsx +15 -0
- package/templates/template-js-local/src/routes/Router.jsx +16 -0
- package/templates/template-js-local/src/styles/index.css +11 -0
- package/templates/template-js-local/src/styles/w3.css +42 -0
- package/templates/template-js-local/tailwind.config.js +10 -0
- package/templates/template-js-local/vite.config.js +6 -0
- package/templates/template-ts-cdn/index.html +13 -0
- package/templates/template-ts-cdn/package.json +26 -0
- package/templates/template-ts-cdn/postcss.config.js +6 -0
- package/templates/template-ts-cdn/src/App.tsx +15 -0
- package/templates/template-ts-cdn/src/components/Nav.tsx +28 -0
- package/templates/template-ts-cdn/src/main.tsx +13 -0
- package/templates/template-ts-cdn/src/pages/About.tsx +23 -0
- package/templates/template-ts-cdn/src/pages/Home.tsx +42 -0
- package/templates/template-ts-cdn/src/pages/NotFound.tsx +15 -0
- package/templates/template-ts-cdn/src/routes/Router.tsx +16 -0
- package/templates/template-ts-cdn/src/styles/index.css +11 -0
- package/templates/template-ts-cdn/tailwind.config.js +10 -0
- package/templates/template-ts-cdn/tsconfig.json +17 -0
- package/templates/template-ts-cdn/vite.config.js +6 -0
- package/templates/template-ts-local/index.html +12 -0
- package/templates/template-ts-local/package.json +26 -0
- package/templates/template-ts-local/postcss.config.js +6 -0
- package/templates/template-ts-local/src/App.tsx +15 -0
- package/templates/template-ts-local/src/components/Nav.tsx +28 -0
- package/templates/template-ts-local/src/main.tsx +14 -0
- package/templates/template-ts-local/src/pages/About.tsx +23 -0
- package/templates/template-ts-local/src/pages/Home.tsx +42 -0
- package/templates/template-ts-local/src/pages/NotFound.tsx +15 -0
- package/templates/template-ts-local/src/routes/Router.tsx +16 -0
- package/templates/template-ts-local/src/styles/index.css +11 -0
- package/templates/template-ts-local/src/styles/w3.css +42 -0
- package/templates/template-ts-local/tailwind.config.js +10 -0
- package/templates/template-ts-local/tsconfig.json +17 -0
- package/templates/template-ts-local/vite.config.js +6 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# jamilvite
|
|
2
|
+
|
|
3
|
+
Jamilvite scaffolds a Vite + React app with React Router, Tailwind CSS, and W3.CSS preconfigured.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g jamilvite
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
jamilvite create my-app
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or via npx:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx jamilvite@latest create my-app
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
You'll be prompted for:
|
|
24
|
+
|
|
25
|
+
- Project name (if not provided)
|
|
26
|
+
- TypeScript (Yes/No)
|
|
27
|
+
- W3.CSS inclusion mode (cdn or local)
|
|
28
|
+
|
|
29
|
+
## What it generates
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
my-app/
|
|
33
|
+
index.html
|
|
34
|
+
package.json
|
|
35
|
+
vite.config.js
|
|
36
|
+
postcss.config.js
|
|
37
|
+
tailwind.config.js
|
|
38
|
+
src/
|
|
39
|
+
main.jsx
|
|
40
|
+
App.jsx
|
|
41
|
+
routes/
|
|
42
|
+
Router.jsx
|
|
43
|
+
pages/
|
|
44
|
+
Home.jsx
|
|
45
|
+
About.jsx
|
|
46
|
+
NotFound.jsx
|
|
47
|
+
components/
|
|
48
|
+
Nav.jsx
|
|
49
|
+
styles/
|
|
50
|
+
index.css
|
|
51
|
+
w3.css
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
TypeScript templates use `.tsx` and include `tsconfig.json`.
|
|
55
|
+
|
|
56
|
+
## Getting started
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cd my-app
|
|
60
|
+
npm install
|
|
61
|
+
npm run dev
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
package/TODO.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jamilvite",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Scaffold Vite + React with Router, Tailwind, and W3.CSS",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"jamilvite": "src/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"templates",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"CHANGELOG.md",
|
|
15
|
+
"TODO.md"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"vite",
|
|
19
|
+
"react",
|
|
20
|
+
"router",
|
|
21
|
+
"tailwind",
|
|
22
|
+
"scaffold",
|
|
23
|
+
"cli"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "",
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"prompts": "^2.4.2"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/cli.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import prompts from 'prompts';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const TEMPLATE_ROOT = path.resolve(__dirname, '..', 'templates');
|
|
11
|
+
|
|
12
|
+
const usage = `
|
|
13
|
+
Usage:
|
|
14
|
+
jamilvite create <project-name>
|
|
15
|
+
npx jamilvite@latest create <project-name>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
function isEmptyDir(entries) {
|
|
19
|
+
return entries.length === 0 || entries.every((entry) => entry === '.git');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function pathExists(targetPath) {
|
|
23
|
+
try {
|
|
24
|
+
await fs.access(targetPath);
|
|
25
|
+
return true;
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function ensureEmptyDir(targetPath) {
|
|
32
|
+
if (!(await pathExists(targetPath))) {
|
|
33
|
+
await fs.mkdir(targetPath, { recursive: true });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const entries = await fs.readdir(targetPath);
|
|
38
|
+
if (!isEmptyDir(entries)) {
|
|
39
|
+
throw new Error(`Target directory "${targetPath}" already exists and is not empty.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function copyTemplate(templateName, targetPath) {
|
|
44
|
+
const templatePath = path.join(TEMPLATE_ROOT, templateName);
|
|
45
|
+
await fs.cp(templatePath, targetPath, { recursive: true });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function updatePackageName(targetPath, projectName) {
|
|
49
|
+
const packagePath = path.join(targetPath, 'package.json');
|
|
50
|
+
const raw = await fs.readFile(packagePath, 'utf8');
|
|
51
|
+
const data = JSON.parse(raw);
|
|
52
|
+
data.name = projectName;
|
|
53
|
+
await fs.writeFile(packagePath, `${JSON.stringify(data, null, 2)}\n`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function run() {
|
|
57
|
+
const [command, projectArg] = process.argv.slice(2);
|
|
58
|
+
|
|
59
|
+
if (!command || command === '--help' || command === '-h') {
|
|
60
|
+
console.log(usage.trim());
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (command !== 'create') {
|
|
65
|
+
console.error(`Unknown command: ${command}`);
|
|
66
|
+
console.log(usage.trim());
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const responses = await prompts([
|
|
71
|
+
{
|
|
72
|
+
type: projectArg ? null : 'text',
|
|
73
|
+
name: 'projectName',
|
|
74
|
+
message: 'Project name',
|
|
75
|
+
initial: 'my-app',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'toggle',
|
|
79
|
+
name: 'useTypeScript',
|
|
80
|
+
message: 'Use TypeScript?',
|
|
81
|
+
initial: false,
|
|
82
|
+
active: 'Yes',
|
|
83
|
+
inactive: 'No',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: 'select',
|
|
87
|
+
name: 'w3Mode',
|
|
88
|
+
message: 'Choose W3.CSS inclusion mode',
|
|
89
|
+
choices: [
|
|
90
|
+
{ title: 'cdn', value: 'cdn' },
|
|
91
|
+
{ title: 'local', value: 'local' },
|
|
92
|
+
],
|
|
93
|
+
initial: 0,
|
|
94
|
+
},
|
|
95
|
+
]);
|
|
96
|
+
|
|
97
|
+
const projectName = projectArg || responses.projectName;
|
|
98
|
+
const useTypeScript = responses.useTypeScript || false;
|
|
99
|
+
const w3Mode = responses.w3Mode || 'cdn';
|
|
100
|
+
|
|
101
|
+
if (!projectName) {
|
|
102
|
+
console.error('Project name is required.');
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const targetPath = path.resolve(process.cwd(), projectName);
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
await ensureEmptyDir(targetPath);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(error.message);
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const templateName = `template-${useTypeScript ? 'ts' : 'js'}-${w3Mode}`;
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
await copyTemplate(templateName, targetPath);
|
|
119
|
+
await updatePackageName(targetPath, projectName);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.error('Failed to scaffold project.');
|
|
122
|
+
console.error(error.message);
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
console.log(`\nSuccess! Created ${projectName} at ${targetPath}`);
|
|
127
|
+
console.log('Next steps:');
|
|
128
|
+
console.log(` cd ${projectName}`);
|
|
129
|
+
console.log(' npm install');
|
|
130
|
+
console.log(' npm run dev');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
run();
|
|
@@ -0,0 +1,13 @@
|
|
|
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" />
|
|
6
|
+
<title>Jamilvite App</title>
|
|
7
|
+
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css" />
|
|
8
|
+
</head>
|
|
9
|
+
<body class="bg-slate-50 text-slate-900">
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jamilvite-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"react": "^18.3.1",
|
|
13
|
+
"react-dom": "^18.3.1",
|
|
14
|
+
"react-router-dom": "^6.26.2"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
18
|
+
"autoprefixer": "^10.4.20",
|
|
19
|
+
"postcss": "^8.4.47",
|
|
20
|
+
"tailwindcss": "^3.4.13",
|
|
21
|
+
"vite": "^5.4.8"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Router from './routes/Router.jsx';
|
|
2
|
+
import Nav from './components/Nav.jsx';
|
|
3
|
+
|
|
4
|
+
const App = () => {
|
|
5
|
+
return (
|
|
6
|
+
<div className="min-h-screen">
|
|
7
|
+
<Nav />
|
|
8
|
+
<main className="mx-auto w-full max-w-5xl px-6 py-10">
|
|
9
|
+
<Router />
|
|
10
|
+
</main>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default App;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NavLink } from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
const navLinkClass = ({ isActive }) =>
|
|
4
|
+
`px-4 py-2 rounded-full text-sm font-medium transition ${
|
|
5
|
+
isActive
|
|
6
|
+
? 'bg-white text-slate-900 shadow'
|
|
7
|
+
: 'text-slate-100 hover:bg-slate-700'
|
|
8
|
+
}`;
|
|
9
|
+
|
|
10
|
+
const Nav = () => {
|
|
11
|
+
return (
|
|
12
|
+
<header className="w3-bar w3-blue px-6 py-3 shadow">
|
|
13
|
+
<div className="mx-auto flex w-full max-w-5xl items-center justify-between">
|
|
14
|
+
<span className="text-lg font-semibold text-white">Jamilvite</span>
|
|
15
|
+
<nav className="flex items-center gap-2">
|
|
16
|
+
<NavLink to="/" className={navLinkClass}>
|
|
17
|
+
Home
|
|
18
|
+
</NavLink>
|
|
19
|
+
<NavLink to="/about" className={navLinkClass}>
|
|
20
|
+
About
|
|
21
|
+
</NavLink>
|
|
22
|
+
</nav>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Nav;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
4
|
+
import App from './App.jsx';
|
|
5
|
+
import './styles/index.css';
|
|
6
|
+
|
|
7
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
8
|
+
<React.StrictMode>
|
|
9
|
+
<BrowserRouter>
|
|
10
|
+
<App />
|
|
11
|
+
</BrowserRouter>
|
|
12
|
+
</React.StrictMode>
|
|
13
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const About = () => {
|
|
2
|
+
return (
|
|
3
|
+
<section className="space-y-4">
|
|
4
|
+
<h1 className="text-2xl font-semibold text-slate-900">About this stack</h1>
|
|
5
|
+
<p className="text-slate-600">
|
|
6
|
+
Jamilvite pairs Vite with React Router, Tailwind CSS, and W3.CSS so you
|
|
7
|
+
can prototype fast and scale into production-friendly structure.
|
|
8
|
+
</p>
|
|
9
|
+
<div className="rounded-2xl bg-slate-900 p-6 text-slate-100">
|
|
10
|
+
<p className="text-sm uppercase tracking-wide text-slate-300">
|
|
11
|
+
Quick tips
|
|
12
|
+
</p>
|
|
13
|
+
<ul className="mt-4 list-disc space-y-2 pl-6 text-sm">
|
|
14
|
+
<li>Start building pages inside <code>src/pages</code>.</li>
|
|
15
|
+
<li>Update navigation in <code>src/components/Nav</code>.</li>
|
|
16
|
+
<li>Tailwind utilities live in <code>src/styles/index.css</code>.</li>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</section>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default About;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const Home = () => {
|
|
2
|
+
return (
|
|
3
|
+
<section className="space-y-6">
|
|
4
|
+
<div className="rounded-3xl bg-white p-8 shadow-sm">
|
|
5
|
+
<p className="text-sm uppercase tracking-wide text-slate-500">Welcome</p>
|
|
6
|
+
<h1 className="mt-2 text-3xl font-semibold text-slate-900">
|
|
7
|
+
Jamilvite React Starter
|
|
8
|
+
</h1>
|
|
9
|
+
<p className="mt-4 text-slate-600">
|
|
10
|
+
This project ships with React Router, Tailwind CSS, and W3.CSS
|
|
11
|
+
preconfigured so you can start building immediately.
|
|
12
|
+
</p>
|
|
13
|
+
<div className="mt-6 flex flex-wrap gap-3">
|
|
14
|
+
<button className="w3-button w3-white w3-border w3-border-blue w3-round-large">
|
|
15
|
+
W3 Button
|
|
16
|
+
</button>
|
|
17
|
+
<span className="rounded-full bg-slate-900 px-4 py-2 text-sm text-white">
|
|
18
|
+
Tailwind Badge
|
|
19
|
+
</span>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div className="grid gap-6 md:grid-cols-2">
|
|
23
|
+
<article className="rounded-2xl border border-slate-200 bg-white p-6">
|
|
24
|
+
<h2 className="text-lg font-semibold text-slate-900">Router Ready</h2>
|
|
25
|
+
<p className="mt-2 text-slate-600">
|
|
26
|
+
Add new routes inside <code>src/routes/Router</code> and keep your
|
|
27
|
+
pages organized.
|
|
28
|
+
</p>
|
|
29
|
+
</article>
|
|
30
|
+
<article className="rounded-2xl border border-slate-200 bg-white p-6">
|
|
31
|
+
<h2 className="text-lg font-semibold text-slate-900">Design System</h2>
|
|
32
|
+
<p className="mt-2 text-slate-600">
|
|
33
|
+
Combine Tailwind utility classes with W3 components to speed up
|
|
34
|
+
layout and styling.
|
|
35
|
+
</p>
|
|
36
|
+
</article>
|
|
37
|
+
</div>
|
|
38
|
+
</section>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Home;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const NotFound = () => {
|
|
2
|
+
return (
|
|
3
|
+
<section className="text-center">
|
|
4
|
+
<p className="text-sm uppercase tracking-wide text-slate-500">404</p>
|
|
5
|
+
<h1 className="mt-2 text-3xl font-semibold text-slate-900">
|
|
6
|
+
Page not found
|
|
7
|
+
</h1>
|
|
8
|
+
<p className="mt-3 text-slate-600">
|
|
9
|
+
The page you are looking for does not exist yet.
|
|
10
|
+
</p>
|
|
11
|
+
</section>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default NotFound;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Routes, Route } from 'react-router-dom';
|
|
2
|
+
import Home from '../pages/Home.jsx';
|
|
3
|
+
import About from '../pages/About.jsx';
|
|
4
|
+
import NotFound from '../pages/NotFound.jsx';
|
|
5
|
+
|
|
6
|
+
const Router = () => {
|
|
7
|
+
return (
|
|
8
|
+
<Routes>
|
|
9
|
+
<Route path="/" element={<Home />} />
|
|
10
|
+
<Route path="/about" element={<About />} />
|
|
11
|
+
<Route path="*" element={<NotFound />} />
|
|
12
|
+
</Routes>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default Router;
|
|
@@ -0,0 +1,12 @@
|
|
|
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" />
|
|
6
|
+
<title>Jamilvite App</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body class="bg-slate-50 text-slate-900">
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jamilvite-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"react": "^18.3.1",
|
|
13
|
+
"react-dom": "^18.3.1",
|
|
14
|
+
"react-router-dom": "^6.26.2"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
18
|
+
"autoprefixer": "^10.4.20",
|
|
19
|
+
"postcss": "^8.4.47",
|
|
20
|
+
"tailwindcss": "^3.4.13",
|
|
21
|
+
"vite": "^5.4.8"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Router from './routes/Router.jsx';
|
|
2
|
+
import Nav from './components/Nav.jsx';
|
|
3
|
+
|
|
4
|
+
const App = () => {
|
|
5
|
+
return (
|
|
6
|
+
<div className="min-h-screen">
|
|
7
|
+
<Nav />
|
|
8
|
+
<main className="mx-auto w-full max-w-5xl px-6 py-10">
|
|
9
|
+
<Router />
|
|
10
|
+
</main>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default App;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NavLink } from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
const navLinkClass = ({ isActive }) =>
|
|
4
|
+
`px-4 py-2 rounded-full text-sm font-medium transition ${
|
|
5
|
+
isActive
|
|
6
|
+
? 'bg-white text-slate-900 shadow'
|
|
7
|
+
: 'text-slate-100 hover:bg-slate-700'
|
|
8
|
+
}`;
|
|
9
|
+
|
|
10
|
+
const Nav = () => {
|
|
11
|
+
return (
|
|
12
|
+
<header className="w3-bar w3-blue px-6 py-3 shadow">
|
|
13
|
+
<div className="mx-auto flex w-full max-w-5xl items-center justify-between">
|
|
14
|
+
<span className="text-lg font-semibold text-white">Jamilvite</span>
|
|
15
|
+
<nav className="flex items-center gap-2">
|
|
16
|
+
<NavLink to="/" className={navLinkClass}>
|
|
17
|
+
Home
|
|
18
|
+
</NavLink>
|
|
19
|
+
<NavLink to="/about" className={navLinkClass}>
|
|
20
|
+
About
|
|
21
|
+
</NavLink>
|
|
22
|
+
</nav>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Nav;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
4
|
+
import App from './App.jsx';
|
|
5
|
+
import './styles/index.css';
|
|
6
|
+
import './styles/w3.css';
|
|
7
|
+
|
|
8
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
9
|
+
<React.StrictMode>
|
|
10
|
+
<BrowserRouter>
|
|
11
|
+
<App />
|
|
12
|
+
</BrowserRouter>
|
|
13
|
+
</React.StrictMode>
|
|
14
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const About = () => {
|
|
2
|
+
return (
|
|
3
|
+
<section className="space-y-4">
|
|
4
|
+
<h1 className="text-2xl font-semibold text-slate-900">About this stack</h1>
|
|
5
|
+
<p className="text-slate-600">
|
|
6
|
+
Jamilvite pairs Vite with React Router, Tailwind CSS, and W3.CSS so you
|
|
7
|
+
can prototype fast and scale into production-friendly structure.
|
|
8
|
+
</p>
|
|
9
|
+
<div className="rounded-2xl bg-slate-900 p-6 text-slate-100">
|
|
10
|
+
<p className="text-sm uppercase tracking-wide text-slate-300">
|
|
11
|
+
Quick tips
|
|
12
|
+
</p>
|
|
13
|
+
<ul className="mt-4 list-disc space-y-2 pl-6 text-sm">
|
|
14
|
+
<li>Start building pages inside <code>src/pages</code>.</li>
|
|
15
|
+
<li>Update navigation in <code>src/components/Nav</code>.</li>
|
|
16
|
+
<li>Tailwind utilities live in <code>src/styles/index.css</code>.</li>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</section>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default About;
|