updating docs

This commit is contained in:
Denis Rosa 2021-04-13 16:29:53 +02:00
parent 27010318e5
commit 31c0604753

View file

@ -1,14 +1,21 @@
# Spring PetClinic Sample Application [![Build Status](https://travis-ci.org/spring-projects/spring-petclinic.png?branch=main)](https://travis-ci.org/spring-projects/spring-petclinic/)
# Couchbase Spring PetClinic Sample Application [![Build Status](https://travis-ci.org/spring-projects/spring-petclinic.png?branch=main)](https://travis-ci.org/spring-projects/spring-petclinic/)
Couchbase Spring PetClinic is a fork from the original Spring Pet Clinic adapted wo work with Couchbase.
## Understanding the Spring Petclinic application with a few diagrams
<a href="https://speakerdeck.com/michaelisvy/spring-petclinic-sample-application">See the presentation here</a>
## Running PetClinic on GitPod
To run this app on GitPod simply click [here](https://gitpod.io/#https://github.com/deniswsrosa/couchbase-spring-petclinic.git)
## Running petclinic locally
Petclinic is a [Spring Boot](https://spring.io/guides/gs/spring-boot) application built using [Maven](https://spring.io/guides/gs/maven/). You can build a jar file and run it from the command line:
```
git clone https://github.com/spring-projects/spring-petclinic.git
git clone https://github.com/deniswsrosa/couchbase-spring-petclinic
cd spring-petclinic
./mvnw package
java -jar target/*.jar
@ -25,26 +32,14 @@ Or you can run it from Maven directly using the Spring Boot Maven plugin. If you
```
## In case you find a bug/suggested improvement for Spring Petclinic
Our issue tracker is available here: https://github.com/spring-projects/spring-petclinic/issues
Our issue tracker is available here: https://github.com/deniswsrosa/couchbase-spring-petclinic/issues
## Database configuration
In its default configuration, Petclinic uses an in-memory database (H2) which
gets populated at startup with data. The h2 console is automatically exposed at `http://localhost:8080/h2-console`
and it is possible to inspect the content of the database using the `jdbc:h2:mem:testdb` url.
A similar setup is provided for MySql in case a persistent database configuration is needed. Note that whenever the database type is changed, the app needs to be run with a different profile: `spring.profiles.active=mysql` for MySql.
The class *CouchbaseConfig* is where you can configure your Couchbase connection. By default it will connect to a bucket called *default* on localhost using the "Administrator" username and "password" as a password.
You could start MySql locally with whatever installer works for your OS, or with docker:
```
docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:5.7.8
```
Further documentation is provided [here](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/resources/db/mysql/petclinic_db_setup_mysql.txt).
## Working with Petclinic in your IDE
## Working with PetClinic in your IDE
### Prerequisites
The following items should be installed in your system:
@ -61,7 +56,7 @@ The following items should be installed in your system:
1) On the command line
```
git clone https://github.com/spring-projects/spring-petclinic.git
git clone https://github.com/deniswsrosa/couchbase-spring-petclinic
```
2) Inside Eclipse or STS
```
@ -87,7 +82,6 @@ The following items should be installed in your system:
|Spring Boot Configuration | Class or Java property files |
|--------------------------|---|
|The Main Class | [PetClinicApplication](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java) |
|Properties Files | [application.properties](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/resources) |
|Caching | [CacheConfiguration](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java) |
## Interesting Spring Petclinic branches and forks
@ -99,21 +93,9 @@ GitHub org is the "canonical" implementation, currently based on Spring Boot and
that could be used to implement the Pet Clinic then please join the community there.
## Interaction with other open source projects
One of the best parts about working on the Spring Petclinic application is that we have the opportunity to work in direct contact with many Open Source projects. We found some bugs/suggested improvements on various topics such as Spring, Spring Data, Bean Validation and even Eclipse! In many cases, they've been fixed/implemented in just a few days.
Here is a list of them:
| Name | Issue |
|------|-------|
| Spring JDBC: simplify usage of NamedParameterJdbcTemplate | [SPR-10256](https://jira.springsource.org/browse/SPR-10256) and [SPR-10257](https://jira.springsource.org/browse/SPR-10257) |
| Bean Validation / Hibernate Validator: simplify Maven dependencies and backward compatibility |[HV-790](https://hibernate.atlassian.net/browse/HV-790) and [HV-792](https://hibernate.atlassian.net/browse/HV-792) |
| Spring Data: provide more flexibility when working with JPQL queries | [DATAJPA-292](https://jira.springsource.org/browse/DATAJPA-292) |
# Contributing
The [issue tracker](https://github.com/spring-projects/spring-petclinic/issues) is the preferred channel for bug reports, features requests and submitting pull requests.
The [issue tracker](https://github.com/deniswsrosa/couchbase-spring-petclinic/issues) is the preferred channel for bug reports, features requests and submitting pull requests.
For pull requests, editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org>. If you have not previously done so, please fill out and submit the [Contributor License Agreement](https://cla.pivotal.io/sign/spring).