Skip to content

Commit

Permalink
Migrate eventmesh-admin (#11)
Browse files Browse the repository at this point in the history
* Archive old frontend project

* Migrate eventmesh-admin from https://github.com/apache/eventmesh pil0txia_feat_4501

* Extract project to root path

* Rename project from eventmesh-admin to eventmesh-dashboard

* Rename package from .admin to .dashboard
  • Loading branch information
Pil0tXia authored Jan 4, 2024
1 parent 7757db8 commit b5970c4
Show file tree
Hide file tree
Showing 94 changed files with 8,467 additions and 184 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
out/
dist/
build/
167 changes: 36 additions & 131 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,131 +1,36 @@
# https://github.com/github/gitignore/blob/main/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
54 changes: 12 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,24 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Getting Started

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Getting Started with Docker

Pull the image and run the container by following commands:
## Build on source code

```
docker pull apache/eventmesh-dashboard:latest
cd eventmesh-dashboard
./gradlew clean bootJar
```

```
docker run -d --name eventmesh-dashboard -p 8080:80 -t apache/eventmesh-dashboard:latest
java -jar build/libs/eventmesh-dashboard-0.0.1-SNAPSHOT.jar
```

Open [http://localhost:8080](http://localhost:8080) in your browser to see the result.

You can also build a mirror of your own by executing the following command in the root of your git repository:
## Build and Run with Docker

```
docker build -t <your-name>/eventmesh-dashboard:latest -f docker/Dockerfile .
cd eventmesh-dashboard
./gradlew clean bootJar
docker build -t yourname/eventmesh-dashboard -f docker/Dockerfile .
```

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
```
docker run -d --name eventmesh-dashboard -p 8080:8080 yourname/eventmesh-dashboard
```
76 changes: 76 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'java'
id 'idea'
id 'org.springframework.boot' version '2.7.15'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'org.apache.eventmesh'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '1.8'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/public/' }
}

ext {
// utility
commonsLang3Version = '3.13.0'
guavaVersion = '32.1.2-jre' // not used for now
fastjsonVersion = '2.0.40'
// swagger
springdocVersion = '1.7.0'
// unit test
mockitoVersion = '5.5.0'
// meta
nacosVersion = '2.2.4'
}

dependencies {
// versions managed by spring.dependency-management
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// utility
implementation "org.apache.commons:commons-lang3:${commonsLang3Version}"
implementation("com.alibaba.fastjson2:fastjson2:${fastjsonVersion}")
// swagger
implementation "org.springdoc:springdoc-openapi-ui:${springdocVersion}"
implementation "org.springdoc:springdoc-openapi-javadoc:${springdocVersion}"
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0'
// unit test
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
// meta
implementation("com.alibaba.nacos:nacos-client:${nacosVersion}")
}
30 changes: 21 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM node:18.15 as builder
WORKDIR /build
COPY . .
RUN npm install
RUN npm run build
RUN npm run export
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM nginx:stable-alpine
COPY docker/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /build/out /usr/share/nginx/html
FROM openjdk:8-jre-alpine
VOLUME /tmp
COPY build/libs/eventmesh-dashboard-*.jar eventmesh-dashboard.jar
ENV JAVA_OPTS=""
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /eventmesh-dashboard.jar"]
1 change: 1 addition & 0 deletions docs/UserGuide_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO
1 change: 1 addition & 0 deletions docs/UserGuide_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO
2 changes: 2 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
out/
Loading

0 comments on commit b5970c4

Please sign in to comment.