Skip to content

App sample spring-boot-redis application #82

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
114 changes: 114 additions & 0 deletions spring-boot-redis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
Here’s a README for the Product application you developed using Spring Boot and Redis:

```markdown
# Product Spring Application

This is a simple Product application built with Spring Boot and Redis. The application provides RESTful APIs to manage Product items.

## Prerequisites

- Java 8
- Maven
- Docker

## Installation

### 1. Clone the Repository

```sh
git clone https://github.com/yourusername/product-spring-app.git
cd product-spring-app
```

### 2. Build the Application

```sh
mvn clean install
```

### 3. Set Up Docker Containers

#### Redis Container

1. Pull the Redis Docker Image:

```sh
docker pull redis:latest
```

2. Run the Redis Container:

```sh
docker run --name redis-product -p 6379:6379 -d redis:latest
```

### 4. Configure Application Properties

Update the `src/main/resources/application.properties` file with your Redis settings:

```properties
spring.redis.host=localhost
spring.redis.port=6379
```

### 5. Run the Application

```sh
mvn spring-boot:run
```

## Usage

### API Endpoints

#### Create a Product Item

```sh
curl -X POST http://localhost:8080/api/products \
-H "Content-Type: application/json" \
-d '{
"name": "Sample Product",
"description": "This is a sample product description",
"price": 29.99
}'
```

#### Get All Product Items

```sh
curl -X GET http://localhost:8080/api/products
```

#### Get a Product Item by ID

```sh
curl -X GET http://localhost:8080/api/products/{id}
```
Replace `{id}` with the actual ID of the Product item you want to retrieve.

#### Update a Product Item

```sh
curl -X PUT http://localhost:8080/api/products/{id} \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Product",
"description": "This is an updated product description",
"price": 39.99
}'
```
Replace `{id}` with the actual ID of the Product item you want to update.

#### Delete a Product Item

```sh
curl -X DELETE http://localhost:8080/api/products/{id}
```
Replace `{id}` with the actual ID of the Product item you want to delete.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
```

Feel free to adjust any details specific to your project, such as the repository link, product attributes, or additional instructions!
50 changes: 50 additions & 0 deletions spring-boot-redis/keploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
path: ""
appId: 0
appName: ""
command: ""
port: 0
proxyPort: 16789
dnsPort: 26789
debug: false
disableANSI: false
disableTele: false
generateGithubActions: false
containerName: ""
networkName: ""
buildDelay: 30
test:
selectedTests: {}
ignoredTests: {}
globalNoise:
global: {}
test-sets: {}
delay: 5
apiTimeout: 5
coverage: false
goCoverage: false
coverageReportPath: ""
ignoreOrdering: true
mongoPassword: "default@123"
language: ""
removeUnusedMocks: false
basePath: ""
mocking: true
disableLineCoverage: false
fallbackOnMiss: false
disableMockUpload: true
record:
recordTimer: 0s
filters: []
contract:
driven: "consumer"
servicesMapping: {}
self: "s1"
configPath: ""
bypassRules: []
cmdType: "native"
enableTesting: false
inDocker: false
keployContainer: "keploy-v2"
keployNetwork: "keploy-network"

# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file.
2 changes: 2 additions & 0 deletions spring-boot-redis/keploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

/reports/
Loading