Skip to content

Commit 674667e

Browse files
authored
Merge pull request #1538 from rocket-admin/rocketadmin-ws-server
Rocketadmin ws server
2 parents b217614 + 12e40e4 commit 674667e

Some content is hidden

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

50 files changed

+42016
-48099
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,7 @@ Thumbs.db
5454
!.yarn/plugins
5555
!.yarn/releases
5656
!.yarn/sdks
57-
!.yarn/versions
57+
!.yarn/versions
58+
59+
# PGLite storage
60+
pglite-storage

autoadmin-ws-server/.dockerignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
node_modules
2-
npm-debug.log
2+
dist
3+
.env
4+
*.log
5+
.git
6+
.gitignore
7+
*.md
8+
.env.*

autoadmin-ws-server/.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HTTP_PORT=8008
2+
WS_PORT=8009
3+
HOST=0.0.0.0
4+
5+
JWT_SECRET=MySuperSecretJwtSecret
6+
PRIVATE_KEY=MySuperSecretEncryptionPrivateKey
7+
8+
CHECK_CONNECTION_TOKEN_URL=http://backend:3000/connection/token
9+
10+
LOG_LEVEL=info

autoadmin-ws-server/.gitignore

100755100644
Lines changed: 11 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,14 @@
1-
2-
# Created by https://www.gitignore.io/api/node
3-
# Edit at https://www.gitignore.io/?templates=node
4-
5-
### Node ###
6-
# Logs
7-
logs
8-
*.log
9-
npm-debug.log*
10-
yarn-debug.log*
11-
yarn-error.log*
12-
lerna-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
461
node_modules/
47-
jspm_packages/
48-
49-
# TypeScript v1 declaration files
50-
typings/
51-
52-
# TypeScript cache
53-
*.tsbuildinfo
54-
55-
# Optional npm cache directory
56-
.npm
57-
.yarn/*
58-
# Optional eslint cache
59-
.eslintcache
60-
61-
# Optional REPL history
62-
.node_repl_history
63-
64-
# Output of 'npm pack'
65-
*.tgz
66-
67-
# Yarn Integrity file
68-
.yarn-integrity
69-
70-
# dotenv environment variables file
71-
.env
72-
.test.env
73-
.encryption.env
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# next.js build output
79-
.next
80-
81-
# nuxt.js build output
82-
.nuxt
83-
84-
# rollup.js default build output
852
dist/
3+
.env
4+
*.log
5+
.DS_Store
866

87-
# Uncomment the public line if your project uses Gatsby
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
90-
# public
91-
92-
# Storybook build outputs
93-
.out
94-
.storybook-out
95-
96-
# vuepress build output
97-
.vuepress/dist
98-
99-
# Serverless directories
100-
.serverless/
101-
102-
# FuseBox cache
103-
.fusebox/
104-
105-
# DynamoDB Local files
106-
.dynamodb/
107-
108-
# Temporary folders
109-
tmp/
110-
temp/
111-
112-
#IDE integration files
113-
.idea
114-
115-
#private data
116-
.env.dev
117-
.amazon.env
118-
.development.env
119-
# End of https://www.gitignore.io/api/node
7+
# Yarn
8+
.yarn/*
9+
!.yarn/patches
10+
!.yarn/plugins
11+
!.yarn/releases
12+
!.yarn/sdks
13+
!.yarn/versions
14+
.pnp.*

autoadmin-ws-server/.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
JWT_SECRET=MySuperSecretJwtSecret
2-
HTTP_PORT=
3-
WS_PORT=
1+
HTTP_PORT=8008
2+
WS_PORT=8009
43
HOST=0.0.0.0
4+
5+
JWT_SECRET=MySuperSecretJwtSecret
56
PRIVATE_KEY=MySuperSecretEncryptionPrivateKey
6-
CHECK_CONNECTION_TOKEN_URL=http://backend:3000/connection/token
7+
8+
CHECK_CONNECTION_TOKEN_URL=http://backend:3000/connection/token
9+
10+
LOG_LEVEL=info

autoadmin-ws-server/Dockerfile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1-
FROM node:22-slim
1+
FROM node:22-alpine AS builder
2+
23
WORKDIR /app
3-
COPY package.json yarn.lock /app/
4-
RUN yarn install --network-timeout 1000000
5-
COPY . /app
6-
EXPOSE 8008
7-
CMD ["yarn", "start"]
4+
5+
COPY package.json yarn.lock ./
6+
RUN yarn install --frozen-lockfile
7+
8+
COPY tsconfig.json ./
9+
COPY src ./src
10+
11+
RUN yarn build
12+
13+
FROM node:22-alpine
14+
15+
WORKDIR /app
16+
17+
RUN addgroup -g 1001 -S nodejs && \
18+
adduser -S nodejs -u 1001
19+
20+
COPY package.json yarn.lock ./
21+
RUN yarn install --frozen-lockfile --production && yarn cache clean
22+
23+
COPY --from=builder /app/dist ./dist
24+
25+
USER nodejs
26+
27+
EXPOSE 8008 8009
28+
29+
CMD ["node", "dist/index.js"]

autoadmin-ws-server/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

autoadmin-ws-server/buildspec.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

autoadmin-ws-server/package.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
{
2-
"name": "autoadmin-ws-server",
2+
"name": "rocketadmin-ws-server",
33
"version": "1.0.0",
4-
"main": "src/index.js",
5-
"license": "MIT",
64
"type": "module",
5+
"license": "UNLICENSED",
76
"scripts": {
8-
"start": "node src/index.js"
7+
"dev": "tsx watch src/index.ts",
8+
"build": "tsc",
9+
"start": "node dist/index.js",
10+
"lint": "biome check src/",
11+
"lint:fix": "biome check --write src/"
912
},
1013
"dependencies": {
11-
"axios": "^1.13.2",
12-
"express": "^5.2.1",
14+
"@hono/node-server": "^1.19.9",
15+
"hono": "^4.11.7",
1316
"jsonwebtoken": "^9.0.3",
14-
"lru-cache": "^11.2.4",
17+
"lru-cache": "^11.2.5",
1518
"nanoid": "^5.1.6",
16-
"ws": "^8.18.3"
19+
"pino": "^10.3.0",
20+
"ws": "^8.19.0",
21+
"zod": "^4.3.6"
22+
},
23+
"devDependencies": {
24+
"@biomejs/biome": "2.3.13",
25+
"@types/jsonwebtoken": "^9.0.10",
26+
"@types/node": "^22.10.2",
27+
"@types/ws": "^8.18.1",
28+
"tsx": "^4.21.0",
29+
"typescript": "^5.9.3"
1730
}
1831
}

0 commit comments

Comments
 (0)