Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Draft - Update the spring session example app #9

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions session-state/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ SPDX-License-Identifier: Apache-2.0

# Session State Code Example

This example demonstrates the use of Tanzu GemFire for session state caching and can be used with the [Session State Caching Guide](https://tanzu.vmware.com/developer/data/tanzu-gemfire/guides/session-state-cache-sbdg/).

The application uses [Spring Boot for Apache Geode](https://docs.spring.io/autorepo/docs/spring-boot-data-geode-build/current/reference/html5/).
This example demonstrates the use of VMware GemFire for session state caching.


## When should I use a session state cache?
Expand Down
37 changes: 15 additions & 22 deletions session-state/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ SPDX-License-Identifier: Apache-2.0
*/

plugins {
id 'org.springframework.boot' version '2.4.1'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'java'
id("com.github.node-gradle.node") version "2.2.4"
}

group = 'com.vmware.tanzu.gemfire.session-state-example'
group = 'com.vmware.gemfire.session-state-example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

Expand All @@ -28,17 +28,20 @@ bootBuildImage{

repositories {
mavenCentral()
maven {
credentials {
username "$gemfireRepoUsername"
password "$gemfireRepoPassword"
}
url = uri("https://commercial-repo.pivotal.io/data3/gemfire-release-repo/gemfire")
}
}

ext {
set('springGeodeVersion', "1.4.0")
}

dependencies {
implementation 'org.springframework.geode:spring-geode-starter'
implementation 'org.springframework.geode:spring-geode-starter-session'
implementation 'org.springframework.boot:spring-boot-starter-web'

implementation "com.vmware.gemfire:spring-boot-2.7-gemfire-9.15:1.0.0"
implementation "com.vmware.gemfire:spring-boot-session-2.7-gemfire-9.15:1.0.0"
testImplementation 'org.springframework.boot:spring-boot-starter-test'

}
Expand All @@ -51,9 +54,6 @@ dependencyManagement {
entry('log4j-to-slf4j')
}
}
imports {
mavenBom "org.springframework.geode:spring-geode-bom:${springGeodeVersion}"
}
}

test {
Expand All @@ -63,15 +63,16 @@ test {

node {

version = '14.15.4'
npmVersion = '6.14.10'
version = '18.12.0'
npmVersion = '8.19.2'
download = true

// Set the work directory for unpacking node
workDir = file("build/nodejs")

// Set the work directory for NPM
npmWorkDir = file("build/node")

// Set the work directory for Yarn
yarnWorkDir = file("build/yarn")
}
Expand All @@ -93,16 +94,8 @@ task copyFrontEnd(type: Copy) {
into 'build/resources/main/static/'
}

task appYarnTest(type: YarnTask) {
description = "Builds production version of the frontend"
workingDir = file("frontend")
args = ["run", "test"]
}


appYarnBuild.dependsOn appYarnInstall
copyFrontEnd.dependsOn appYarnBuild
processResources.dependsOn copyFrontEnd

appYarnTest.dependsOn appYarnInstall
test.dependsOn appYarnTest
9 changes: 0 additions & 9 deletions session-state/frontend/cypress.json

This file was deleted.

108 changes: 0 additions & 108 deletions session-state/frontend/cypress/e2e/App.spec.js

This file was deleted.

5 changes: 0 additions & 5 deletions session-state/frontend/cypress/fixtures/example.json

This file was deleted.

16 changes: 0 additions & 16 deletions session-state/frontend/jest.config.js

This file was deleted.

37 changes: 11 additions & 26 deletions session-state/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,21 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.1.0",
"@testing-library/react": "^10.0.1",
"@testing-library/user-event": "^10.0.0",
"acorn": "7.1.1",
"axios": ">=0.21.1",
"acorn": "^8.8.1",
"axios": "^1.1.3",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"minimist": "1.2.6",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "^3.4.4",
"serialize-javascript": "^3.0.0"
},
"resolutions": {
"minimist": "1.2.5",
"acorn": "7.1.1",
"@babel/preset-env": "^7.8.7"
"enzyme-adapter-react-16": "^1.15.6",
"minimist": "^1.2.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1",
"serialize-javascript": "^6.0.0"
},

"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest",
"eject": "react-scripts eject"
"build": "react-scripts build"

},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -41,12 +33,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"babel-jest": "^24.9.0",
"cypress": "^4.2.0",
"react-test-renderer": "^16.13.1"
}
}
5 changes: 3 additions & 2 deletions session-state/frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*/

import React from 'react';
import ReactDOM from 'react-dom';
import {createRoot} from 'react-dom/client';
import App from './components/App';
const root = createRoot(document.getElementById("root"));

ReactDOM.render(<App />, document.getElementById('root'));
root.render(<App />, document.getElementById('root'));
13 changes: 7 additions & 6 deletions session-state/frontend/src/styles/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@

@font-face {
font-family: 'proxima_nova_reg';
src: url('/resources/fonts/proxima_nova_reg/proximanova-reg.woff2') format('woff2'),
url('/resources/fonts/proxima_nova_reg/proximanova-reg.woff') format('woff');
src: local("proxima_nova_reg-reg"), url('./../../public/resources/fonts/proxima_nova_reg/proximanova-reg.woff2') format('woff2'),
url('./../../public/resources/fonts/proxima_nova_reg/proximanova-reg.woff') format('woff');
font-weight: normal;
font-style: normal;
}


@font-face {
font-family: 'proxima_nova_bold';
src: url('/resources/fonts/proxima_nova_bold/proximanova-bold.woff2') format('woff2'),
url('/resources/fonts/proxima_nova_bold/proximanova-bold.woff') format('woff');
src: local("proxima_nova_bold"), url('./../../public/resources/fonts/proxima_nova_bold/proximanova-bold.woff2') format('woff2'),
url('./../../public/resources/fonts/proxima_nova_bold/proximanova-bold.woff') format('woff');
font-weight: bold;
font-style: normal;
}

@font-face {
font-family: 'proxima_nova_semibold';
src: url('/resources/fonts/proxima_nova_semibold/proximanova-semibold.woff2') format('woff2'),
url('/resources/fonts/proxima_nova_semibold/proximanova-semibold.woff') format('woff');
src: local("proxima_nova_semibold"), url('./../../public/resources/fonts/proxima_nova_semibold/proximanova-semibold.woff2') format('woff2'),
url('./../../public/resources/fonts/proxima_nova_semibold/proximanova-semibold.woff') format('woff');
font-weight: 600;
font-style: normal;
}
Loading