Skip to content

Commit

Permalink
initail commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dvp-tae committed Oct 6, 2024
1 parent c483513 commit 2972a76
Show file tree
Hide file tree
Showing 22 changed files with 3,890 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.env
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
# claco-client
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@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
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
25 changes: 25 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
}
);
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Claco</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "claco-client",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-query": "^5.59.0",
"@types/node": "^22.7.4",
"autoprefixer": "^10.4.20",
"axios": "^1.7.7",
"postcss": "^8.4.47",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.2",
"recoil": "^0.7.7",
"tailwindcss": "^3.4.13"
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/parser": "^8.8.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.10.0",
"prettier": "^3.3.3",
"typescript": "^5.5.3",
"typescript-eslint": "^8.8.0",
"vite": "^5.4.8",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^5.0.1"
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
1 change: 1 addition & 0 deletions public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { RouterProvider } from 'react-router-dom';
import AppRegister from '@/libraries/index';
import Router from '@/routes/router';

export default function App() {
return (
<AppRegister>
<RouterProvider router={Router} fallbackElement={null} />
</AppRegister>
);
}
72 changes: 72 additions & 0 deletions src/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
@font-face {
font-family: 'Pretendard';
src: url('https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable.min.css');
}
html {
font-size: 62.5%;
font-family: pretendard;
}
body {
display: flex;
justify-content: center;
align-items: center;

border: 1px solid #222;

max-width: 430px;
min-height: 100vh;
}
}

@layer components {
.display1-bold {
@apply text-[3.5rem] font-bold leading-normal tracking-[-0.01em];
}
.display2-medium {
@apply text-[2.5rem] font-bold leading-normal tracking-[-0.01em];
}
.title1-bold {
@apply text-[2rem] font-bold leading-normal tracking-[-0.01em];
}
.title2-bold {
@apply text-[1.75rem] font-bold leading-normal tracking-[-0.01em];
}
.title3-bold {
@apply text-[1.5rem] font-bold leading-normal tracking-[-0.01em];
}
.heading1-bold {
@apply text-[1.375rem] font-bold leading-normal tracking-[-0.01em];
}
.heading1-semibold {
@apply text-[1.375rem] font-semibold leading-normal tracking-[-0.01em];
}
.heading2-bold {
@apply text-[1.25rem] font-bold leading-normal tracking-[-0.01em];
}
.heading2-semibold {
@apply text-[1.25rem] font-semibold leading-normal tracking-[-0.01em];
}
.headline1-bold {
@apply text-[1.125rem] font-bold leading-normal tracking-[-0.01em];
}
.headline2-bold {
@apply text-[1.0625rem] font-bold leading-normal tracking-[-0.01em];
}
.body1-medium {
@apply text-[1rem] font-medium leading-normal tracking-[-0.01em];
}
.body1-regular {
@apply text-[1rem] font-regular leading-normal tracking-[-0.01em];
}
.body2-medium {
@apply text-[0.9375rem] font-medium leading-normal tracking-[-0.01em];
}
.body2-regular {
@apply text-[0.9375rem] font-regular leading-normal tracking-[-0.01em];
}
}
11 changes: 11 additions & 0 deletions src/libraries/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { PropsWithChildren } from 'react';
import { RecoilRoot } from 'recoil';
import ReactQuerySetting from '@/libraries/reactQuery/ReactQuerySetting';

export default function AppRegister({ children }: PropsWithChildren) {
return (
<ReactQuerySetting>
<RecoilRoot>{children}</RecoilRoot>
</ReactQuerySetting>
);
}
19 changes: 19 additions & 0 deletions src/libraries/reactQuery/ReactQuerySetting.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { PropsWithChildren } from 'react';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const MINUTES = 1000 * 60;

const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: 1,
retryDelay: 1000,
staleTime: 5 * MINUTES,
},
},
});

export default function ReactQuerySetting({ children }: PropsWithChildren) {
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
}
3 changes: 3 additions & 0 deletions src/libraries/reactQuery/queryKeys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const enum QueryKeys {}

export default QueryKeys;
10 changes: 10 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App.tsx';
import './globals.css';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>
);
33 changes: 33 additions & 0 deletions src/pages/Login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export const LoginPage = () => {
return (
<div>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
<p className="display1-bold">글자 크기</p>
<p className="display2-medium">글자 크기</p>
<p className="title1-bold">글자 크기</p>
</div>
);
};
20 changes: 20 additions & 0 deletions src/routes/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { LoginPage } from '@/pages/Login/page';
import { createBrowserRouter, Outlet, RouteObject } from 'react-router-dom';

const routes: RouteObject[] = [
{
path: '/',
element: <Outlet />,
children: [
{
path: '',
element: <LoginPage />,
},
],
},
{ path: '*', element: <>Not found page</> },
];

const Router = createBrowserRouter(routes);

export default Router;
2 changes: 2 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference types="vite/client" />
/// <reference types="vite-plugin-svgr/client" />
15 changes: 15 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {
height: {
'real-screen': 'calc(var(--vh) * 100)',
},
},
minHeight: {
'real-screen': 'calc(var(--vh) * 100)',
},
},
plugins: [],
};
Loading

0 comments on commit 2972a76

Please sign in to comment.