Skip to content

Commit a4ef79d

Browse files
committed
Initialize the JZHub
1 parent 4faa1a1 commit a4ef79d

File tree

202 files changed

+13306
-2
lines changed

Some content is hidden

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

202 files changed

+13306
-2
lines changed

.github/workflows/build.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: test
2+
on:
3+
push:
4+
branches: [main]
5+
jobs:
6+
build:
7+
if: ${{ startsWith(github.ref, 'refs/heads/deployment/') || github.ref == 'refs/heads/main' }}
8+
runs-on: [self-hosted]
9+
steps:
10+
- name: chceck code
11+
uses: actions/checkout@v2
12+
13+
- uses: pnpm/action-setup@v4
14+
name: Install pnpm
15+
with:
16+
version: 9
17+
run_install: false
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: 'pnpm'
24+
25+
- name: Install dependencies
26+
run: pnpm install
27+
- name: Build
28+
run: pnpm run build
29+
30+
- name: Get version
31+
id: version
32+
run: |
33+
if [[ -n "$GITHUB_REF" && "$GITHUB_REF" == "refs/tags/"* ]]; then
34+
echo "tag version"
35+
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
36+
else
37+
echo "commit version"
38+
echo "::set-output name=version::${{ github.sha }}"
39+
fi
40+
41+
- name: Build and push
42+
run: |
43+
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
44+
docker build -t gitdatateam/jzhub:${{ steps.version.outputs.version }} .
45+
docker push gitdatateam/jzhub:${{ steps.version.outputs.version }}
46+
47+
docker tag gitdatateam/jzhub:${{ steps.version.outputs.version }} gitdatateam/jzhub:latest
48+
docker push gitdatateam/jzhub:latest
49+
50+
- name: Deploy
51+
uses: WyriHaximus/github-action-helm3@v3
52+
with:
53+
exec: /usr/sbin/helm upgrade jzhub --install ./chart --namespace gitdata --set-string tag=latest
54+
kubeconfig: ${{ secrets.KUBECONTENT }}
55+
overrule_existing_kubeconfig: "true"

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
package-lock.json
10+
11+
node_modules
12+
dist
13+
dist-ssr
14+
*.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:22.6.0-alpine3.20
2+
WORKDIR /usr/src/app
3+
4+
COPY . .
5+
RUN npm install --global pnpm
6+
RUN pnpm install
7+
8+
RUN pnpm run build
9+
10+
FROM nginx:latest
11+
12+
COPY --from=0 /usr/src/app/dist /usr/share/nginx/html
13+
COPY script/nginx.conf /etc/nginx/nginx.conf
14+
EXPOSE 80

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 JZHub
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+50-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
1-
# jzhub
2-
The AI Data Hub for what's next
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 tseslint.config({
18+
languageOptions: {
19+
// other options...
20+
parserOptions: {
21+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
22+
tsconfigRootDir: import.meta.dirname,
23+
},
24+
},
25+
})
26+
```
27+
28+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31+
32+
```js
33+
// eslint.config.js
34+
import react from 'eslint-plugin-react'
35+
36+
export default tseslint.config({
37+
// Set the react version
38+
settings: { react: { version: '18.3' } },
39+
plugins: {
40+
// Add the react plugin
41+
react,
42+
},
43+
rules: {
44+
// other rules...
45+
// Enable its recommended rules
46+
...react.configs.recommended.rules,
47+
...react.configs['jsx-runtime'].rules,
48+
},
49+
})
50+
```

chart/Chart.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v2
2+
name: jzhub
3+
description: Install jzhub.cn to provide jzhub official web page.
4+
version: 1.0.0
5+
home: https://jzhub.cn/
6+
keywords:
7+
- jzhub
8+
sources:
9+
- https://github.com/GitDataAI/jzhub
10+
maintainers:
11+
- name: gitdata-ai team

chart/templates/deployment.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: jzhub-deployment
5+
namespace: gitdata
6+
labels:
7+
apptype: jzhub
8+
spec:
9+
replicas: 3
10+
selector:
11+
matchLabels:
12+
app: jzhub
13+
template:
14+
metadata:
15+
labels:
16+
app: jzhub
17+
apptype: jzhub
18+
date: "{{ now | unixEpoch }}"
19+
spec:
20+
containers:
21+
- name: jzhub
22+
image: gitdatateam/jzhub:{{ .Values.tag }}
23+
imagePullPolicy: Always
24+
ports:
25+
- containerPort: 80

chart/templates/ingress.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: jzhub
5+
namespace: gitdata
6+
annotations:
7+
meta.helm.sh/release-name: jzhub
8+
nginx.ingress.kubernetes.io/rewrite-target: /
9+
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
10+
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
11+
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
12+
labels:
13+
apptype: jzhub
14+
app.kubernetes.io/managed-by: Helm
15+
heritage: Helm
16+
release: jzhub
17+
spec:
18+
ingressClassName: nginx
19+
rules:
20+
- host: jzhub.cn
21+
http:
22+
paths:
23+
- path: /
24+
pathType: Prefix
25+
backend:
26+
service:
27+
name: jzhub-service
28+
port:
29+
number: 80

chart/templates/service.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: jzhub-service
5+
namespace: gitdata
6+
labels:
7+
apptype: jzhub
8+
spec:
9+
type: ClusterIP
10+
selector:
11+
app: jzhub
12+
ports:
13+
- protocol: TCP
14+
port: 80
15+
targetPort: 80

chart/values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Additional Trusted CAs.
2+
# Enable this flag and add your CA certs as a secret named tls-ca-additional in the namespace.
3+
# See README.md for details.
4+
replicas: 3
5+
ingress_name: nginx
6+
tag: latest

eslint.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

gitdata-logo.png

70.9 KB
Loading

global.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module "*.css";

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="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>JZHub | 使用 JZHub 构建、管理和分享数据产品</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)