Skip to content

Commit 9b1142e

Browse files
committed
🎉 Git init
0 parents  commit 9b1142e

26 files changed

+2522
-0
lines changed

.eslintrc.cjs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['react-refresh'],
12+
rules: {
13+
'react-refresh/only-export-components': [
14+
'warn',
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
}

.gitignore

+24
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

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13+
14+
- Configure the top-level `parserOptions` property like this:
15+
16+
```js
17+
export default {
18+
// other rules...
19+
parserOptions: {
20+
ecmaVersion: 'latest',
21+
sourceType: 'module',
22+
project: ['./tsconfig.json', './tsconfig.node.json'],
23+
tsconfigRootDir: __dirname,
24+
},
25+
}
26+
```
27+
28+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "sba_frontend_admin",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0",
15+
"react-router-dom": "^6.20.1",
16+
"vite-plugin-svgr": "^4.2.0"
17+
},
18+
"devDependencies": {
19+
"@types/react": "^18.2.37",
20+
"@types/react-dom": "^18.2.15",
21+
"@typescript-eslint/eslint-plugin": "^6.10.0",
22+
"@typescript-eslint/parser": "^6.10.0",
23+
"@vitejs/plugin-react": "^4.2.0",
24+
"autoprefixer": "^10.4.16",
25+
"eslint": "^8.53.0",
26+
"eslint-plugin-react-hooks": "^4.6.0",
27+
"eslint-plugin-react-refresh": "^0.4.4",
28+
"postcss": "^8.4.32",
29+
"tailwindcss": "^3.3.6",
30+
"typescript": "^5.2.2",
31+
"vite": "^5.0.0"
32+
}
33+
}

postcss.config.js

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

public/vite.svg

+1
Loading

src/App.css

Whitespace-only changes.

src/App.tsx

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
2+
import { LoginPage, SigninPage, ReportPage, MainPage } from './pages';
3+
import NavBar from './components/NavBar';
4+
import './App.css';
5+
6+
const ROUTER = createBrowserRouter([
7+
{
8+
path: '/',
9+
element: <MainPage />,
10+
},
11+
{
12+
path: '/auth/login',
13+
element: <LoginPage />,
14+
},
15+
{
16+
path: '/auth/signin',
17+
element: <SigninPage />,
18+
},
19+
{
20+
path: '/report',
21+
element: <ReportPage />,
22+
},
23+
]);
24+
25+
function App() {
26+
return (
27+
<div className="flex">
28+
<NavBar />
29+
<div className="w-full h-screen bg-slate-100">
30+
<RouterProvider router={ROUTER} />
31+
</div>
32+
</div>
33+
);
34+
}
35+
36+
export default App;

src/assets/Logo.png

265 KB
Loading

src/assets/Logo.svg

+27
Loading

src/assets/react.svg

+1
Loading

src/components/NavBar.tsx

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Logo from '../assets/Logo.svg?react';
2+
3+
const NavBar: React.FC = () => {
4+
return (
5+
<div className="w-60 bg-white">
6+
<div className="flex items-center gap-x-1">
7+
<Logo className="w-6 h-6" />
8+
<div className="text-2xl font-bold text-primary-default">S-BA</div>
9+
</div>
10+
<p>회원 관리</p>
11+
<p>신고 관리</p>
12+
<p>로그인</p>
13+
<p>회원가입</p>
14+
</div>
15+
);
16+
};
17+
18+
export default NavBar;

src/index.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

src/main.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom/client'
3+
import App from './App.tsx'
4+
import './index.css'
5+
6+
ReactDOM.createRoot(document.getElementById('root')!).render(
7+
<React.StrictMode>
8+
<App />
9+
</React.StrictMode>,
10+
)

src/pages/Login.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const Login: React.FC = () => {
2+
return <div></div>;
3+
};
4+
5+
export default Login;

src/pages/Main.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const Main: React.FC = () => {
2+
return <div className="bg-slate-100">Hello World</div>;
3+
};
4+
5+
export default Main;

src/pages/Report.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const Report: React.FC = () => {
2+
return <div></div>;
3+
};
4+
5+
export default Report;

src/pages/Signin.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const Signin: React.FC = () => {
2+
return <div></div>;
3+
};
4+
5+
export default Signin;

src/pages/index.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import LoginPage from './Login';
2+
import ReportPage from './Report';
3+
import SigninPage from './Signin';
4+
import MainPage from './Main';
5+
6+
export { LoginPage, SigninPage, ReportPage, MainPage };

src/vite-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

tailwind.config.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
export const content = ['./src/**/*.{js,jsx,ts,tsx}'];
2+
export const theme = {
3+
extend: {
4+
keyframes: {
5+
'fade-in-down': {
6+
'0%': {
7+
opacity: '0',
8+
transform: 'translateY(-10px)',
9+
},
10+
'100%': {
11+
opacity: '1',
12+
transform: 'translateY(0)',
13+
},
14+
},
15+
'slide-down': {
16+
'0%': {
17+
transform: 'translateY(-10px)',
18+
},
19+
'100%': {
20+
transform: 'translateY(0)',
21+
},
22+
},
23+
},
24+
colors: {
25+
primary: {
26+
100: '#ebf1fd',
27+
200: '#D9E5FD',
28+
400: '#2724B7',
29+
default: '#0064FF',
30+
600: '#3730F2',
31+
900: '#06051A',
32+
},
33+
gray: {
34+
light: '#6C6C6C',
35+
dark: '#333333',
36+
},
37+
},
38+
animation: {
39+
'fade-in-down': 'fade-in-down 0.5s ease-out',
40+
'slide-down': 'slide-down 0.5s ease-out',
41+
},
42+
},
43+
};
44+
export const plugins = [];

tsconfig.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6+
"module": "ESNext",
7+
"skipLibCheck": true,
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"noEmit": true,
15+
"jsx": "react-jsx",
16+
17+
/* Linting */
18+
"strict": true,
19+
"noUnusedLocals": true,
20+
"noUnusedParameters": true,
21+
"noFallthroughCasesInSwitch": true
22+
},
23+
"include": ["src"],
24+
"references": [{ "path": "./tsconfig.node.json" }]
25+
}

tsconfig.node.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"skipLibCheck": true,
5+
"module": "ESNext",
6+
"moduleResolution": "bundler",
7+
"allowSyntheticDefaultImports": true
8+
},
9+
"include": ["vite.config.ts"]
10+
}

vite.config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'vite';
2+
import react from '@vitejs/plugin-react';
3+
import svgr from 'vite-plugin-svgr';
4+
5+
// https://vitejs.dev/config/
6+
export default defineConfig({
7+
plugins: [react(), svgr()],
8+
});

0 commit comments

Comments
 (0)