Skip to content

Commit 725df11

Browse files
committed
❇️ [refactor] Init new frontend
1 parent d905b04 commit 725df11

57 files changed

Lines changed: 10933 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"workbench.editor.customLabels.patterns": {
33
"**/app/**/page.tsx": "${dirname}"
4+
},
5+
"files.readonlyInclude": {
6+
"**/routeTree.gen.ts": true
7+
},
8+
"files.watcherExclude": {
9+
"**/routeTree.gen.ts": true
10+
},
11+
"search.exclude": {
12+
"**/routeTree.gen.ts": true
413
}
514
}

frontend/.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/node,react
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=node,react
3+
4+
### Node ###
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
.pnpm-debug.log*
13+
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
*.lcov
29+
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Compiled binary addons (https://nodejs.org/api/addons.html)
43+
build/Release
44+
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# Snowpack dependency directory (https://snowpack.dev/)
50+
web_modules/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional stylelint cache
62+
.stylelintcache
63+
64+
# Microbundle cache
65+
.rpt2_cache/
66+
.rts2_cache_cjs/
67+
.rts2_cache_es/
68+
.rts2_cache_umd/
69+
70+
# Optional REPL history
71+
.node_repl_history
72+
73+
# Output of 'npm pack'
74+
*.tgz
75+
76+
# Yarn Integrity file
77+
.yarn-integrity
78+
79+
# dotenv environment variable files
80+
.env
81+
.env.development.local
82+
.env.test.local
83+
.env.production.local
84+
.env.local
85+
86+
# parcel-bundler cache (https://parceljs.org/)
87+
.cache
88+
.parcel-cache
89+
90+
# Next.js build output
91+
.next
92+
out
93+
94+
# Nuxt.js build / generate output
95+
.nuxt
96+
dist
97+
98+
# Gatsby files
99+
.cache/
100+
# Comment in the public line in if your project uses Gatsby and not Next.js
101+
# https://nextjs.org/blog/next-9-1#public-directory-support
102+
# public
103+
104+
# vuepress build output
105+
.vuepress/dist
106+
107+
# vuepress v2.x temp and cache directory
108+
.temp
109+
110+
# Docusaurus cache and generated files
111+
.docusaurus
112+
113+
# Serverless directories
114+
.serverless/
115+
116+
# FuseBox cache
117+
.fusebox/
118+
119+
# DynamoDB Local files
120+
.dynamodb/
121+
122+
# TernJS port file
123+
.tern-port
124+
125+
# Stores VSCode versions used for testing VSCode extensions
126+
.vscode-test
127+
128+
# yarn v2
129+
.yarn/cache
130+
.yarn/unplugged
131+
.yarn/build-state.yml
132+
.yarn/install-state.gz
133+
.pnp.*
134+
135+
### Node Patch ###
136+
# Serverless Webpack directories
137+
.webpack/
138+
139+
# Optional stylelint cache
140+
141+
# SvelteKit build / generate output
142+
.svelte-kit
143+
144+
### react ###
145+
.DS_*
146+
**/*.backup.*
147+
**/*.back.*
148+
149+
node_modules
150+
151+
*.sublime*
152+
153+
psd
154+
thumb
155+
sketch
156+
157+
# End of https://www.toptal.com/developers/gitignore/api/node,react
158+
159+
# TanStack Router generated route tree
160+
src/routeTree.gen.ts
161+
162+
# OpenAPI generated client
163+
src/lib/client

frontend/.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**/.git
2+
**/.hg
3+
**/.svn
4+
**/node_modules
5+
dist
6+
src/lib/client
7+
src/routeTree.gen.ts
8+
pnpm-lock.yaml

frontend/.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"trailingComma": "none",
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true,
6+
"plugins": [
7+
"prettier-plugin-tailwindcss",
8+
"@trivago/prettier-plugin-sort-imports"
9+
],
10+
"importOrder": ["^@/(.*)$", "^[./]"],
11+
"importOrderSeparation": true,
12+
"importOrderSortSpecifiers": true
13+
}

frontend/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Kayman Frontend
2+
3+
The frontend API server of Kayman, built with React / Vite.
4+
5+
---
6+
7+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
8+
9+
Currently, two official plugins are available:
10+
11+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
12+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
13+
14+
## React Compiler
15+
16+
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
17+
18+
Note: This will impact Vite dev & build performances.
19+
20+
## Expanding the ESLint configuration
21+
22+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
23+
24+
```js
25+
export default defineConfig([
26+
globalIgnores(['dist']),
27+
{
28+
files: ['**/*.{ts,tsx}'],
29+
extends: [
30+
// Other configs...
31+
32+
// Remove tseslint.configs.recommended and replace with this
33+
tseslint.configs.recommendedTypeChecked,
34+
// Alternatively, use this for stricter rules
35+
tseslint.configs.strictTypeChecked,
36+
// Optionally, add this for stylistic rules
37+
tseslint.configs.stylisticTypeChecked
38+
39+
// Other configs...
40+
],
41+
languageOptions: {
42+
parserOptions: {
43+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
44+
tsconfigRootDir: import.meta.dirname
45+
}
46+
// other options...
47+
}
48+
}
49+
])
50+
```
51+
52+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
53+
54+
```js
55+
// eslint.config.js
56+
import reactDom from 'eslint-plugin-react-dom'
57+
import reactX from 'eslint-plugin-react-x'
58+
59+
export default defineConfig([
60+
globalIgnores(['dist']),
61+
{
62+
files: ['**/*.{ts,tsx}'],
63+
extends: [
64+
// Other configs...
65+
// Enable lint rules for React
66+
reactX.configs['recommended-typescript'],
67+
// Enable lint rules for React DOM
68+
reactDom.configs.recommended
69+
],
70+
languageOptions: {
71+
parserOptions: {
72+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
73+
tsconfigRootDir: import.meta.dirname
74+
}
75+
// other options...
76+
}
77+
}
78+
])
79+
```

frontend/components.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "radix-nova",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"rtl": false,
15+
"aliases": {
16+
"components": "@/components",
17+
"utils": "@/lib/utils",
18+
"ui": "@/components/ui",
19+
"lib": "@/lib",
20+
"hooks": "@/hooks"
21+
},
22+
"menuColor": "default",
23+
"menuAccent": "subtle",
24+
"registries": {}
25+
}

frontend/eslint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import js from '@eslint/js'
2+
import prettier from 'eslint-config-prettier'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import { defineConfig, globalIgnores } from 'eslint/config'
6+
import globals from 'globals'
7+
import tseslint from 'typescript-eslint'
8+
9+
export default defineConfig([
10+
globalIgnores(['dist', 'src/lib/client', 'src/routeTree.gen.ts']),
11+
{
12+
files: ['**/*.{ts,tsx}'],
13+
extends: [
14+
js.configs.recommended,
15+
tseslint.configs.recommended,
16+
reactHooks.configs.flat.recommended,
17+
reactRefresh.configs.vite,
18+
prettier
19+
],
20+
languageOptions: {
21+
globals: globals.browser
22+
}
23+
},
24+
{
25+
files: ['src/routes/**/*.{ts,tsx}', 'src/components/ui/**/*.{ts,tsx}'],
26+
rules: {
27+
'react-refresh/only-export-components': 'off'
28+
}
29+
},
30+
{
31+
files: ['src/hooks/**/*.{ts,tsx}', 'src/components/ui/**/*.{ts,tsx}'],
32+
rules: {
33+
'react-hooks/set-state-in-effect': 'off'
34+
}
35+
}
36+
])

frontend/index.html

Lines changed: 13 additions & 0 deletions
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="/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>kayman</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

frontend/mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
node = "22.16.0"
3+
pnpm = "10.12.1"

frontend/openapi-ts.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from '@hey-api/openapi-ts'
2+
3+
export default defineConfig({
4+
input: '/tmp/openapi.json',
5+
output: 'src/lib/client',
6+
plugins: ['@hey-api/client-axios']
7+
})

0 commit comments

Comments
 (0)