Skip to content

Commit 9595866

Browse files
committed
fixed readme and removed unused files
1 parent f5b5f5d commit 9595866

File tree

5 files changed

+18
-121
lines changed

5 files changed

+18
-121
lines changed

.gitpod.Dockerfile

Lines changed: 0 additions & 21 deletions
This file was deleted.

.gitpod.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
t# Quickstart in Couchbase with Spring Boot and Java
1+
# Quickstart in Couchbase with Spring Boot and Java
22

33
#### REST API using Couchbase Capella in Java using Spring Boot
44

5-
Often, the first step developers take after creating their database is to create a REST API that can perform Create, Read, Update, and Delete (CRUD) operations for that database. This repo is designed to teach you and give you a starter project (in Java using Spring Boot) to generate such a REST API. After you have installed the travel-sample bucket in your database, you can run this application which is a REST API with Swagger documentation so that you can learn:
5+
Often, the first step developers take after creating their database is to create a REST API that can perform Create, Read, Update, and Delete (CRUD) operations for that database. This repo is designed to teach you and give you a starter project (in Java using Spring Boot) to generate such a REST API. After you have loaded the travel-sample bucket in your database, you can run this application which is a REST API with Swagger documentation so that you can learn:
66

7-
1. How to create, read, update, and delete documents using Key-Value[ operations](https://docs.couchbase.com/java-sdk/current/howtos/kv-operations.html) (KV operations). KV operations are unique to Couchbase and provide super fast (think microseconds) queries.
7+
1. How to create, read, update, and delete documents using Key-Value[ operations](https://docs.couchbase.com/java-sdk/current/howtos/kv-operations.html) (KV operations). KV operations are unique to Couchbase and provide super fast (under millisecond) operations.
88
2. How to write simple parametrized [N1QL queries](https://docs.couchbase.com/java-sdk/current/howtos/n1ql-queries-with-sdk.html) using the built-in travel-sample bucket.
99

1010
Full documentation for the tutorial can be found on the [Couchbase Developer Portal](https://developer.couchbase.com/tutorial-quickstart-java-springboot/).
@@ -15,13 +15,11 @@ To run this prebuilt project, you will need:
1515

1616
- [Couchbase Capella](https://www.couchbase.com/products/capella/) cluster with [travel-sample](https://docs.couchbase.com/java-sdk/current/ref/travel-app-data-model.html) bucket loaded.
1717
- To run this tutorial using a self-managed Couchbase cluster, please refer to the [appendix](#running-self-managed-couchbase-cluster).
18-
- [Java](https://docs.couchbase.com/java-sdk/current/project-docs/compatibility.html#jdk-compat)
19-
- Ensure that the Java version is compatible with the Couchbase SDK. (Please check the link for compatibility)
20-
- Loading Travel Sample Bucket
21-
If travel-sample is not loaded in your Capella cluster, you can load it by following the instructions for your Capella Cluster:
22-
- [Load travel-sample bucket in Couchbase Capella](https://docs.couchbase.com/cloud/clusters/data-service/import-data-documents.html#import-sample-data)
23-
- Maven
24-
- [Install Maven](https://maven.apache.org/install.html)
18+
- [Java SDK 17+](
19+
- Ensure that the Java version is compatible with the Couchbase SDK. [Please check the link for compatibility](https://docs.couchbase.com/java-sdk/current/project-docs/compatibility.html#jdk-compat)
20+
- Loading Travel Sample Bucket:
21+
- If `travel-sample` is not loaded in your Capella cluster, you can load it by following the instructions for your Capella Cluster. [Load travel-sample bucket in Couchbase Capella](https://docs.couchbase.com/cloud/clusters/data-service/import-data-documents.html#import-sample-data)
22+
- [Maven 3.6.3+](https://maven.apache.org/install.html)
2523

2624
## App Setup
2725

@@ -35,7 +33,7 @@ git clone https://github.com/couchbase-examples/java-springboot-quickstart.git
3533

3634
### Install Dependencies
3735

38-
The dependencies for the application are specified in the `pom.xml` file in the source folder. Dependencies can be installed through `mvn` the default package manager for Java.
36+
The dependencies for the application are specified in the `pom.xml` file in the root folder. Dependencies can be installed through `mvn` the default package manager for Java.
3937

4038
```
4139
mvn clean install -DskipTests=true
@@ -56,8 +54,6 @@ Specifically, you need to do the following:
5654

5755
All configuration for communication with the database is read from the application properties. We have provided a convenience feature in this quickstart to read the properties from a local file, `application.properties` in the `src/main/resources` folder.
5856

59-
You can also use your system environment variables to set the properties. The properties are read from the environment variables if they are set. The properties are read from the `application.properties` file if the environment variables are not set.
60-
6157
```properties
6258
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
6359
spring.couchbase.bucket.name=travel-sample
@@ -70,8 +66,12 @@ Instead of the DB_CONN_STR, DB_USERNAME and DB_PASSWORD, you need to add the val
7066

7167
> Note: The connection string expects the `couchbases://` or `couchbase://` part.
7268
69+
You can also use your system environment variables to set the properties. The properties are read from the environment variables if they are set. The properties are read from the `application.properties` file if the environment variables are not set.
70+
7371
## Running The Application
7472

73+
You can add environment variables DB_CONN_STR, DB_USERNAME and DB_PASSWORD to your system environment variables or you can update the `application.properties` file in the `src/main/resources` folder.
74+
7575
### Directly on Machine
7676

7777
At this point, we have installed the dependencies, loaded the travel-sample data and configured the application with the credentials. The application is now ready and you can run it.
@@ -106,6 +106,7 @@ Once the application starts, you can see the details of the application on the l
106106
The application will run on port 8080 of your local machine (http://localhost:8080). You will find the interactive Swagger documentation of the API if you go to the URL in your browser. Swagger documentation is used in this demo to showcase the different API endpoints and how they can be invoked. More details on the Swagger documentation can be found in the [appendix](#swagger-documentation).
107107

108108
![Swagger Documentation](./assets/images/swagger-documentation-spring-boot.png)
109+
109110
## Running Tests
110111

111112
To test your application, you can use Maven (mvn) to run the test suite. Here are the steps to run the tests:
@@ -146,16 +147,16 @@ mvn test -Dtest=org.couchbase.quickstart.springboot.controllers.RouteIntegration
146147

147148
For this quickstart, we use three collections, `airport`, `airline` and `routes` that contain sample airports, airlines and airline routes respectively. The routes collection connects the airports and airlines as seen in the figure below. We use these connections in the quickstart to generate airports that are directly connected and airlines connecting to a destination airport. Note that these are just examples to highlight how you can use SQL++ queries to join the collections.
148149

149-
![travel-sample data model](/assets/images/travel_sample_data_model.png)
150+
![travel-sample data model](./assets/images/travel_sample_data_model.png)
150151

151152
### Extending API by Adding New Entity
152153

153154
If you would like to add another entity to the APIs, these are the steps to follow:
154155

155-
- Create the new entity (collection) in the Couchbase scope. You can create the collection using the [SDK](https://docs.couchbase.com/java-sdk/current/howtos/provisioning-cluster-resources.html#collection-management) or via the [Couchbase Server interface](https://docs.couchbase.com/cloud/n1ql/n1ql-language-reference/createcollection.html).
156+
- Create a new collection in the Couchbase scope. You can create new collections using the [SDK](https://docs.couchbase.com/java-sdk/current/howtos/provisioning-cluster-resources.html#collection-management) or via the [Couchbase Server interface](https://docs.couchbase.com/cloud/n1ql/n1ql-language-reference/createcollection.html).
156157
- Define the routes in a new class in the `controllers` package similar to the existing routes like `AirportController.java`.
157-
- Define the service in a new class in the `services` package similar to the existing services like `AirportService.java`. You'll have to implement the service interface `AirportServiceImpl.java`.
158-
- Define the repository in a new class in the `repositories` package similar to the existing repositories like `AirportRepository.java`. You'll have to implement the repository interface `AirportRepositoryImpl.java`.
158+
- Define the service in a new class in the `services` package similar to the existing services like `AirportService.java`.
159+
- Define the repository in a new class in the `repositories` package similar to the existing repositories like `AirportRepository.java`.
159160

160161
### Running Self-Managed Couchbase Cluster
161162

start.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

startcb.sh

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)