-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from sora-vp/init-client-major
Menambahkan client attendance dan chooser
- Loading branch information
Showing
92 changed files
with
3,849 additions
and
2,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This is useful for development or manual deployment | ||
VITE_TRPC_URL="http://maybeyourlocalip/api/trpc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 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 { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
project: ["./tsconfig.json", "./tsconfig.node.json"], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; | ||
``` | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// @ts-check | ||
|
||
import eslint from "@eslint/js"; | ||
import reactRefresh from "eslint-plugin-react-refresh"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
import { restrictEnvAccess } from "@sora-vp/eslint-config/base"; | ||
import reactConfig from "@sora-vp/eslint-config/react"; | ||
|
||
export default tseslint.config( | ||
{ | ||
ignores: ["dist/**"], | ||
plugins: { | ||
"react-refresh": reactRefresh, | ||
}, | ||
rules: { | ||
"react-refresh/only-export-components": [ | ||
"warn", | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
...reactConfig, | ||
...restrictEnvAccess, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Attendance Client</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"name": "@sora-vp/client-attendance", | ||
"private": true, | ||
"version": "2.3.1", | ||
"type": "module", | ||
"scripts": { | ||
"build": "yarn with-env vite build", | ||
"clean": "git clean -xdf dist .turbo node_modules", | ||
"dev": "yarn with-env vite", | ||
"format": "prettier --check . --ignore-path ../../.gitignore", | ||
"lint": "eslint", | ||
"preview": "vite preview", | ||
"typecheck": "tsc --noEmit", | ||
"with-env": "dotenv -e ../../.env --" | ||
}, | ||
"dependencies": { | ||
"@sora-vp/api": "*", | ||
"@sora-vp/ui": "*", | ||
"@sora-vp/validators": "*", | ||
"@t3-oss/env-core": "^0.10.1", | ||
"@tanstack/react-query": "^5.35.1", | ||
"@trpc/client": "11.0.0-rc.364", | ||
"@trpc/react-query": "11.0.0-rc.364", | ||
"@trpc/server": "11.0.0-rc.364", | ||
"framer-motion": "^11.2.12", | ||
"jotai": "^2.8.4", | ||
"lucide-react": "^0.399.0", | ||
"non.geist": "^1.0.3", | ||
"qr-scanner": "^1.4.2", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-router-dom": "^6.24.0", | ||
"superjson": "2.2.1", | ||
"zod": "^3.23.8" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.6.0", | ||
"@fontsource-variable/noto-sans-sundanese": "^5.0.18", | ||
"@sora-vp/eslint-config": "*", | ||
"@sora-vp/prettier-config": "*", | ||
"@sora-vp/tailwind-config": "*", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@vitejs/plugin-react-swc": "^3.5.0", | ||
"autoprefixer": "^10.4.19", | ||
"dotenv-cli": "^7.4.1", | ||
"eslint": "^9.6.0", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-react-refresh": "^0.4.7", | ||
"postcss": "^8.4.39", | ||
"prettier": "^3.2.5", | ||
"tailwindcss": "^3.4.4", | ||
"typescript": "^5.4.5", | ||
"typescript-eslint": "^7.14.1", | ||
"vite": "^5.3.1" | ||
}, | ||
"prettier": "@sora-vp/prettier-config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable */ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
}, | ||
}; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useState } from "react"; | ||
import { ServerSettingProvider } from "@/context/server-setting"; | ||
import MainPage from "@/routes/main-page"; | ||
import { api } from "@/utils/api"; | ||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
import { httpBatchLink } from "@trpc/client"; | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom"; | ||
import superjson from "superjson"; | ||
|
||
import { env } from "./env"; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <MainPage />, | ||
}, | ||
{ | ||
path: "about", | ||
element: <div>About</div>, | ||
}, | ||
]); | ||
|
||
const getBaseUrl = () => { | ||
if (!env.VITE_IS_DOCKER && env.VITE_TRPC_URL) return env.VITE_TRPC_URL; | ||
|
||
if (import.meta.env.DEV && !env.VITE_IS_DOCKER && !env.VITE_TRPC_URL) | ||
return "http://localhost:3000/api/trpc"; | ||
|
||
return "/api/trpc"; | ||
}; | ||
|
||
export default function App() { | ||
const [queryClient] = useState(() => new QueryClient()); | ||
const [trpcClient] = useState(() => | ||
api.createClient({ | ||
links: [ | ||
httpBatchLink({ | ||
url: getBaseUrl(), | ||
transformer: superjson, | ||
}), | ||
], | ||
}), | ||
); | ||
|
||
return ( | ||
<api.Provider client={trpcClient} queryClient={queryClient}> | ||
<QueryClientProvider client={queryClient}> | ||
<ServerSettingProvider> | ||
<RouterProvider router={router} /> | ||
</ServerSettingProvider> | ||
</QueryClientProvider> | ||
</api.Provider> | ||
); | ||
} |
Oops, something went wrong.