Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(memorystore): added valkey session demo application #10004

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dackers86
Copy link

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • Appropriate changes to README are included in PR
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • Tests pass: mvn clean verify required
  • Lint passes: mvn -P lint checkstyle:check required
  • Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@dackers86 dackers86 requested review from yoshi-approver and a team as code owners January 31, 2025 18:40
@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: memorystore labels Jan 31, 2025
Copy link
Contributor

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi team,

I'm currently reviewing this pull request and will provide my feedback shortly. In the meantime, here's a summary of the changes for you and other reviewers to quickly get up to speed:

This pull request adds a new demo application for session management using Valkey. The application demonstrates how to use Valkey as an in-memory store for user tokens. The changes include:

  • New demo application: A complete Spring Boot application demonstrating session management with Valkey and PostgreSQL.
  • README.md: A comprehensive README file explaining how to run the application locally (with and without Docker) and how to deploy it to Google Cloud using Terraform. This includes detailed instructions for setting up the database, Valkey server, and deploying to Cloud Run. The README also lists all the application's endpoints.
  • .gitignore: A new .gitignore file added to the app directory to ignore generated files and directories.
  • Dockerfile: A Dockerfile for building a Docker image of the application.
  • docker-compose.yaml: A docker-compose.yaml file for running the application and its dependencies (Valkey and PostgreSQL) using Docker Compose.
  • init.sql: An SQL script for creating the necessary database tables.
  • main.tf: A Terraform configuration file for deploying the application to Google Cloud.
  • Several Java files: New Java classes implementing the application's logic, including controllers for authentication and basket management, data access objects, and utility classes. These files are well-structured and use Spring Boot conventions.

The application uses Valkey for session management, PostgreSQL for user accounts, and Thymeleaf for templating. It includes features for user registration, login, logout, token verification, and a simple shopping basket. The application is well-documented and easy to understand.

I'll be checking the following aspects during my review:

  • Code quality and style
  • Security best practices
  • Error handling and robustness
  • Test coverage
  • Deployment instructions and infrastructure setup

I'll provide a more detailed review in a few minutes. Until then, happy reviewing!

Small code, big impact,
Valkey's speed, a new act,
Sessions now so swift.

Copy link
Contributor

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request adds a session management demo application using Valkey. The application uses Spring Boot, PostgreSQL, and Valkey for session management. The documentation provides clear instructions for running the application locally, with Docker, and deploying to Google Cloud. The code is generally well-structured and follows good practices. Here are a few suggestions for improvement based on commonly used style guides and best practices for Java and related technologies:

Summary of Style Guide Elements Referenced:

  • Javadoc Comments: Ensuring comprehensive Javadoc comments for all public classes and methods.
  • Naming Conventions: Following standard Java naming conventions for variables, methods, and classes.
  • Error Handling: Validating user inputs and providing informative error messages.
  • Security Best Practices: Protecting against common vulnerabilities like SQL injection and storing passwords securely.
  • Dependency Management: Using appropriate and up-to-date dependencies.
  • Testing: Encouraging thorough unit and integration testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: memorystore samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants