Skip to content

Commit 02a9d0b

Browse files
committed
Initial commit
0 parents  commit 02a9d0b

35 files changed

+4074
-0
lines changed

.eslintrc.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
env: { browser: true, es2020: true },
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:react-hooks/recommended',
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
10+
plugins: ['react-refresh'],
11+
rules: {
12+
'react-refresh/only-export-components': 'warn',
13+
},
14+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<table align="center">
2+
<tr>
3+
<td><img src="./public/vite.svg" alt="Vite" width="100" height="100"></td>
4+
<td><img src="./public/react.svg" alt="React" width="100" height="100"></td>
5+
<td><img src="./public/typescript.svg" alt="TypeScript" width="100" height="100"></td>
6+
<td><img src="./public/tailwind.svg" alt="TailwindCSS" width="100" height="100"></td>
7+
</tr>
8+
</table>
9+
10+
# Vite + React + TypeScript + TailwindCSS Example Project
11+
12+
This example project is a Phone Catalogue and it was created with [Vite](https://vitejs.dev/), [React](https://reactjs.org/), [TypeScript](https://www.typescriptlang.org/) and [TailwindCSS](https://tailwindcss.com/).
13+
14+
This projects purpose is to show how to use these technologies together.
15+
16+
Since this project is only a frontend project, it reads the data from a [`items.json`](./src/assets/items.json) file.
17+
18+
## Usage
19+
20+
### Clone repository
21+
22+
```bash
23+
git clone https://github.com/MemerGamer/vite-react-ts-tailwind-example.git
24+
```
25+
26+
### Install dependencies
27+
28+
```bash
29+
npm install
30+
```
31+
32+
### Run development server
33+
34+
```bash
35+
npm run dev
36+
```
37+
38+
## To recreate this project from the base
39+
40+
### Install vite with react and typescript
41+
42+
```bash
43+
npm init vite@latest
44+
# fill in the project name and select react-ts
45+
```
46+
47+
### Install tailwindcss
48+
49+
```bash
50+
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
51+
```
52+
53+
```bash
54+
npx tailwindcss init -p
55+
```
56+
57+
### Install heroicons
58+
59+
```bash
60+
npm install @heroicons/react
61+
```

index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Phone Catalogue</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script>
12+
(function () {
13+
const darkMode = localStorage.getItem("darkMode");
14+
if (darkMode === "true") {
15+
document.documentElement.classList.add("dark");
16+
}
17+
})();
18+
</script>
19+
<script type="module" src="/src/main.tsx"></script>
20+
</body>
21+
</html>

0 commit comments

Comments
 (0)