# mySample **Repository Path**: ceogo/my-sample ## Basic Information - **Project Name**: mySample - **Description**: my-sample personal - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-02-27 - **Last Updated**: 2024-03-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MySample ### Main directories overview /src (Backend source code directory) /docker (Container building and running script instructions) /app (Terminal project code file directory) -- /app/web (Web frontend directory) -- /app/android (Android frontend directory) ### Development environment preparation 1. Java-JDK 1.8+ 2. Node 21.0+ https://nodejs.org/en You need to use the npm domestic mirror source. npm config set registry http://mirrors.cloud.tencent.com/npm/ 3. Git https://git-scm.com/downloads 4. Gradle 6.8+ https://gradle.org/releases/ ### Software architecture #### Development dependencies and running environment management 1. Use Gradle to manage backend and Android development dependencies and compilation process. If using Idea, you need to set the Gradle setting to Use Gradle from gradle-wrapper.properties. 2. Frontend uses Vue3 for frontend basic development, and uses vite for frontend runtime environment compilation management. #### Build and compilation running guidance 1. Backend: 1.1 If the system gradle is set, you can run gradle bootRun (this run includes recompiling the code modifications) in the main directory. 1.2 If there is no gradle environment, you can use the ide plugin to execute. 1.3 Run the jar package directly in the /dist directory using ```java -jar book-1.0.jar```. 1.4 Once the backend runs, it will create or use book.db as a sqlLite database storage file in the same directory. 1.5 Default port ```555``` is set in application.yml. 1.6 Use gradle build to create 200 data. The specific implementation is in org.example.sys.DataTests. 1.7 Pack using ```gradle bootjar```. It will create book-x.x.jar in the build/libs directory. 2. Frontend 2.1 Install dependencies: ```npm install``` 2.2 Run the service: ```npm run dev``` (using the.env.development specified in the api and host, the default port is ```333``` set in .env) 2.3 Package and publish: ```npm run build``` 3. Android Set the http address of the API service in the code org.example.sys.App. Generally, it needs to be modified the host to be used. 4. Docker 4.1 Image building: In the docker directory, select different versions of the image to execute the Dockerfile file, and run ```docker build -t node21-jdk8-alpine:1.0 . --squash``` 4.2 Run containers: Such as: ```docker run -itd -p 555:555 --privileged=true --restart unless-stopped --name node21-jdk8-alpine node21-jdk8-alpine1.0``` #### Usage guide 1. Source code usage >> git clone https://gitee.com/ceogo/my-sample.git > >> gradle build & gradle bootrun > >> cd app/web & npm run dev 2. Environment usage >> cd app/web & npm run dev > >The above instructions will build a web-based publication, and then we will copy the yaml in the src to the dist directory and add the configuration of the static directory, so that we can directly access it without opening multiple front-end services >> spring >    mvc: >       static-path-pattern: /** >    resources:/** >       static-locations: xxx/dist,classpath:/static > >> cd app/dist & java -jar book-stater-1.0.jar 3. Image usage Refer to Build and compilation running guidance 4 4. Access address http://localhost:555 #### Snap-shot ![Frontend](snapshot/img1.png) ![Android](snapshot/img2.png)