Skip to content

Commit 8365ff3

Browse files
committed
Merge branch 'main' into update-ruby-on-rails-tutorial
2 parents 64f6e67 + c26a862 commit 8365ff3

File tree

17 files changed

+1334
-261
lines changed

17 files changed

+1334
-261
lines changed

test/test-markdown-frontmatter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const chalk = require('chalk')
66
// accepted data field values
77
const sdk_languages = ['nodejs', 'scala', 'python', 'swift', 'csharp', 'objective-c', 'android-java', 'any', 'java', 'kotlin', 'dart', 'golang', 'ruby']
88

9-
const tags = ['Ottoman', 'Ktor', 'REST API', 'Express', 'Flask', 'TLS', 'Configuration', 'Next.js', 'iOS', 'Xcode', '.NET', 'Xamarin', 'Authentication', 'OpenID', 'Keycloak', 'Android', 'P2P', 'UIKit', 'Installation', 'Spring Boot', 'Spring Data', 'Transactions', 'SQL++ (N1QL)', 'Optimization', 'Community Edition', 'Docker', 'Data Modeling', 'Metadata', 'Best Practices', 'Data Ingestion', 'Kafka', 'Support', 'Customer', 'Prometheus', 'Monitoring', 'Observability', 'Metrics', 'Query Workbench', 'ASP.NET', 'linq', 'DBaaS', 'App Services', 'Flutter', 'Gin Gonic', 'FastAPI', "Rails", 'LangChain', "OpenAI", "Streamlit"]
9+
const tags = ['Ottoman', 'Ktor', 'REST API', 'Express', 'Flask', 'TLS', 'Configuration', 'Next.js', 'iOS', 'Xcode', '.NET', 'Xamarin', 'Authentication', 'OpenID', 'Keycloak', 'Android', 'P2P', 'UIKit', 'Installation', 'Spring Boot', 'Spring Data', 'Transactions', 'SQL++ (N1QL)', 'Optimization', 'Community Edition', 'Docker', 'Data Modeling', 'Metadata', 'Best Practices', 'Data Ingestion', 'Kafka', 'Support', 'Customer', 'Prometheus', 'Monitoring', 'Observability', 'Metrics', 'Query Workbench', 'ASP.NET', 'linq', 'DBaaS', 'App Services', 'Flutter', 'Gin Gonic', 'FastAPI', "Rails", 'LangChain', "OpenAI", "Streamlit", 'Google Gemini', 'Nvidia NIM', 'LLama3']
1010

1111
const technologies = ['connectors', 'kv', 'query', 'capella', 'server', 'index', 'mobile', 'fts', 'sync gateway', 'eventing', 'analytics', 'udf']
1212

tutorial/markdown/couchbase-server/couchbase-installation-options.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ length: 10 Mins
2121
---
2222

2323
- [Couchbase Capella](#couchbase-capella)
24-
- [Playground](#playground)
2524
- [Local Installation](#local-installation)
2625
- [Container Deployment](#container-deployment)
2726
- [Cloud Deployment](#cloud-deployment)
@@ -34,20 +33,6 @@ You can sign-up for Couchbase Capella following the link below:
3433

3534
- [Deploy with Couchbase Capella](https://developer.couchbase.com/tutorial-capella-sign-up-ui-overview?learningPath=learn/capella)
3635

37-
## Playground
38-
39-
With Couchbase Playground, developers can get a temporary sandbox Couchbase cluster to experiment for free with no download or installation required for the developer. A web browser is all you need to experiment with various SDKs. Couchbase Playground also enables developers to 'Test-Drive' their Couchbase Capella trial instance with code samples from 9 SDK for many programming languages. Developers can even modify these code examples and run them against a Couchbase database, all from within the browser.
40-
41-
Playground works in three different modes:
42-
43-
- Zero-friction session-less mode
44-
- Short-lived sandbox session
45-
- Long-lived Capella session
46-
47-
Try Couchbase Playground now by following the link below:
48-
49-
- <a href="https://couchbase.live" target="_blank">Open Couchbase Playground</a>
50-
5136
## Local Installation
5237

5338
Couchbase Database Server can be downloaded and installed locally on a developers' machine. The links below will guide you through the installation process in different development machines:

tutorial/markdown/java/spring-boot/spring-boot.md

Lines changed: 15 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# frontmatter
33
path: "/tutorial-quickstart-java-springboot"
44
# title and description do not need to be added to markdown, start with H2 (##)
5-
title: Start with Java and Spring Boot
5+
title: Quickstart in Couchbase with Java and Spring Boot
66
short_title: Java and Spring Boot
77
description:
8-
- Learn how to configure Spring Data with Couchbase
8+
- Learn to build a REST API in Java using Spring Boot and Couchbase
99
- Explore key-based operations and SQL++ querying using Spring Data Couchbase repositories
10-
- Build a simple REST APIs that stores user profiles on a Couchbase cluster
10+
- Explore CRUD operations in action with Couchbase
1111
content_type: quickstart
1212
filter: sdk
1313
technology:
@@ -27,42 +27,6 @@ length: 30 Mins
2727

2828
<!-- TODO: Figure out how to add width to image size in try it now links -->
2929

30-
## Table of Contents
31-
32-
- [Getting Started](#getting-started)
33-
- [Prerequisites](#prerequisites)
34-
- [Source Code](#source-code)
35-
- [Install Dependencies](#install-dependencies)
36-
- [Database Server Configuration](#database-server-configuration)
37-
- [Application Properties](#application-properties)
38-
- [Running The Application](#running-the-application)
39-
- [Directly on the machine](#directly-on-the-machine)
40-
- [Docker](#docker)
41-
- [Data Model](#data-model)
42-
- [Airline Document Structure](#airline-document-structure)
43-
- [Let's Review the Code](#lets-review-the-code)
44-
- [Code Organization](#code-organization)
45-
- [Model](#model)
46-
- [Controller](#controller)
47-
- [Service](#service)
48-
- [Repository](#repository)
49-
- [Mapping Workflow](#mapping-workflow)
50-
- [GET Mapping Workflow](#get-mapping-workflow)
51-
- [POST Mapping Workflow](#post-mapping-workflow)
52-
- [PUT Mapping Workflow](#put-mapping-workflow)
53-
- [DELETE Mapping Workflow](#delete-mapping-workflow)
54-
- [Custom SQL++ Queries](#custom-sql-queries)
55-
- [Get all airlines by country](#get-all-airlines-by-country)
56-
- [Get all airlines by destination airport](#get-all-airlines-by-destination-airport)
57-
- [Running The Tests](#running-the-tests)
58-
- [Run Individual Tests](#run-individual-tests)
59-
- [Project Setup Notes](#project-setup-notes)
60-
- [Contributing](#contributing)
61-
- [Appendix](#appendix)
62-
- [Extending API by Adding New Entity](#extending-api-by-adding-new-entity)
63-
- [Running Self Managed Couchbase Cluster](#running-self-managed-couchbase-cluster)
64-
- [Swagger Documentation](#swagger-documentation)
65-
6630
## Getting Started
6731

6832
### Prerequisites
@@ -87,19 +51,19 @@ git clone https://github.com/couchbase-examples/java-springboot-quickstart.git
8751
mvn package
8852
```
8953

90-
> Note: Maven packages auto restore when building the project in IntelliJ IDEA or Eclipse depending on IDE configuration.
54+
> Note: Maven automatically restores packages when building the project. in IntelliJ IDEA or Eclipse depending on IDE configuration.
9155
9256
### Database Server Configuration
9357

9458
- The `CouchbaseConfig` class is a Spring configuration class responsible for setting up the connection to a Couchbase database in a Spring Boot application. It defines two beans:
9559

9660
- `getCouchbaseCluster()`: This bean creates and configures a connection to the Couchbase cluster using the provided hostname, username, and password.
9761

98-
- `getCouchbaseBucket(Cluster cluster)`: This bean creates a Couchbase bucket within the cluster if it doesn't already exist and returns the Bucket object associated with the specified bucket name.
62+
- `getCouchbaseBucket(Cluster cluster)`: This bean retrieves a Couchbase bucket from a cluster, ensuring it exists and is ready within a timeout, throwing exceptions if not found or if connection times out.
9963

10064
### Application Properties
10165

102-
You need to configure the connection details to your Couchbase Server in the application.properties file located in the src/main/resources directory.
66+
You need to configure the connection details to your Couchbase Server in the `application.properties` file located in the `src/main/resources` directory.
10367

10468
In the connection string, replace `DB_CONN_STR` with the connection string of your Couchbase cluster. Replace `DB_USERNAME` and `DB_PASSWORD` with the username and password of a Couchbase user with access to the bucket.
10569

@@ -144,7 +108,7 @@ docker build -t java-springboot-quickstart .
144108
Run the Docker image
145109

146110
```sh
147-
docker run -d --name springboot-container -p 9440:8080 java-springboot-quickstart -e DB_CONN_STR=<connection_string> -e DB_USERNAME=<username> -e DB_PASSWORD=<password>
111+
docker run -d --name springboot-container -p 8080:8080 java-springboot-quickstart -e DB_CONN_STR=<connection_string> -e DB_USERNAME=<username> -e DB_PASSWORD=<password>
148112
```
149113

150114
Note: The `application.properties` file has the connection information to connect to your Capella cluster. You can also pass the connection information as environment variables to the Docker container.
@@ -166,7 +130,7 @@ For this tutorial, we use three collections, `airport`, `airline` and `route` th
166130

167131
## Airline Document Structure
168132

169-
We will be setting up a REST API to manage some airline documents. The `name` field is the name of the airline. The `callsign` field is the callsign of the airline. The `iata` field is the IATA code of the airline. The `icao` field is the ICAO code of the airline. The `country` field is the country of the airline.
133+
We will be setting up a REST API to manage some airline documents. The `name` field is the name of the airline. The `callsign` field is the callsign of the airline. The `iata` field is the IATA code of the airline. The `icao` field is the ICAO code of the airline. The `country` field is the country of the airline.
170134

171135
Our airline document will have a structure similar to the following example:
172136

@@ -176,7 +140,7 @@ Our airline document will have a structure similar to the following example:
176140
"callsign": "Couchbase",
177141
"iata": "CB",
178142
"icao": "CBA",
179-
"country": "United States",
143+
"country": "United States"
180144
}
181145
```
182146

@@ -387,7 +351,7 @@ These workflows illustrate how each HTTP method interacts with the `AirlineServi
387351

388352
## Custom SQL++ Queries
389353

390-
1. Get all airlines by country
354+
### 1. Get all airlines by country
391355

392356
```java
393357

@@ -411,7 +375,7 @@ In the query, we are using the `country` parameter to filter the results by coun
411375

412376
Once the query is executed, the `AirlineController` constructs an HTTP response with a status code of 200 OK and includes the list of airlines in the response body as a list of JSON objects.
413377

414-
2. Get all airlines by destination airport
378+
### 2. Get all airlines by destination airport
415379

416380
```java
417381
@Override
@@ -437,12 +401,12 @@ Once the query is executed, the `AirlineController` constructs an HTTP response
437401

438402
## Running The Tests
439403

404+
This command will execute all the test cases in your project.
405+
440406
```sh
441407
mvn test
442408
```
443409

444-
This command will execute all the test cases in your project.
445-
446410
### Run Individual Tests:
447411

448412
Additionally, you can run individual test classes or methods using the following commands:
@@ -467,9 +431,9 @@ mvn test -Dtest=org.couchbase.quickstart.springboot.controllers.RouteIntegration
467431

468432
## Project Setup Notes
469433

470-
This project was based on the standard [Spring Boot project](https://spring.io/guides/gs/rest-service/). The HealthCheckController is provided as a santity check and is used in unit tests.
434+
This project was based on the standard [Spring Boot project](https://spring.io/guides/gs/rest-service/).
471435

472-
A full list of packages are referenced in the pom.xml file.
436+
A full list of packages are referenced in the `pom.xml` file.
473437

474438
## Contributing
475439

0 commit comments

Comments
 (0)