├── .gitpod.Dockerfile ├── images ├── home.png ├── import.png ├── splash.jpeg ├── todomvc.png ├── welldone.jpg ├── gitpod-home.png ├── gitpod-url.png ├── todobackend.png ├── realbackend-test.png ├── spring-initializr.png ├── todobackend-runclient.png ├── todobackend-runtest.png ├── todobackend-output-host.png ├── todobackend-output-client.png └── todobackend-swagger-test.png ├── .theia └── settings.json ├── slides └── Workshop - Spring Data Cassandra.pdf ├── .gitignore ├── .gitpod.yml ├── todobackend-springdata ├── src │ └── main │ │ └── java │ │ └── com │ │ └── datastax │ │ └── workshop │ │ └── TodobackendSpringdataApplication.java └── pom.xml └── README.MD /.gitpod.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-full -------------------------------------------------------------------------------- /images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/home.png -------------------------------------------------------------------------------- /images/import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/import.png -------------------------------------------------------------------------------- /images/splash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/splash.jpeg -------------------------------------------------------------------------------- /images/todomvc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/todomvc.png -------------------------------------------------------------------------------- /images/welldone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/welldone.jpg -------------------------------------------------------------------------------- /images/gitpod-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/gitpod-home.png -------------------------------------------------------------------------------- /images/gitpod-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/gitpod-url.png -------------------------------------------------------------------------------- /images/todobackend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/todobackend.png -------------------------------------------------------------------------------- /images/realbackend-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/realbackend-test.png -------------------------------------------------------------------------------- /images/spring-initializr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/spring-initializr.png -------------------------------------------------------------------------------- /.theia/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.autoSave": "on", 3 | "java.configuration.updateBuildConfiguration": "interactive" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /images/todobackend-runclient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/todobackend-runclient.png -------------------------------------------------------------------------------- /images/todobackend-runtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/todobackend-runtest.png -------------------------------------------------------------------------------- /images/todobackend-output-host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/todobackend-output-host.png -------------------------------------------------------------------------------- /images/todobackend-output-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/todobackend-output-client.png -------------------------------------------------------------------------------- /images/todobackend-swagger-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/images/todobackend-swagger-test.png -------------------------------------------------------------------------------- /slides/Workshop - Spring Data Cassandra.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datastaxdevs/workshop-spring-data-cassandra/main/slides/Workshop - Spring Data Cassandra.pdf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse conf file 2 | .settings 3 | .classpath 4 | .project 5 | .cache 6 | 7 | # idea conf files 8 | .idea 9 | *.ipr 10 | *.iws 11 | *.iml 12 | 13 | # building 14 | target 15 | build 16 | tmp 17 | dist 18 | 19 | # misc 20 | .DS_Store 21 | 22 | .factorypath 23 | .sts4-cache 24 | *.log 25 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: 2 | file: .gitpod.Dockerfile 3 | 4 | tasks: 5 | - name: spring-data-cassandra 6 | command: | 7 | cd todobackend-springdata && mvn clean package install -Dmaven.test.skip=true 8 | ports: 9 | - port: 8080 10 | onOpen: open-browser 11 | visibility: public 12 | 13 | github: 14 | prebuilds: 15 | master: true 16 | branches: true 17 | pullRequests: true 18 | pullRequestsFromForks: false 19 | addCheck: true 20 | addComment: false 21 | addBadge: true 22 | addLabel: false 23 | 24 | vscode: 25 | extensions: 26 | # Lombok 27 | - GabrielBB.vscode-lombok 28 | # Java 29 | - vscjava.vscode-java-pack 30 | # Spring Boot 31 | - Pivotal.vscode-boot-dev-pack 32 | -------------------------------------------------------------------------------- /todobackend-springdata/src/main/java/com/datastax/workshop/TodobackendSpringdataApplication.java: -------------------------------------------------------------------------------- 1 | package com.datastax.workshop; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration; 6 | import org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration; 7 | 8 | @SpringBootApplication(exclude = { CassandraDataAutoConfiguration.class, CassandraAutoConfiguration.class }) 9 | public class TodobackendSpringdataApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(TodobackendSpringdataApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /todobackend-springdata/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.1 9 | 10 | 11 | com.datastax.workshop 12 | todobackend-springdata 13 | 0.0.1-SNAPSHOT 14 | todobackend-springdata 15 | TodoBackend Spring Boot Microservices with Spring Data for Apache Cassandra 16 | 17 | 18 | 11 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-actuator 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-data-cassandra 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-web 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-devtools 38 | runtime 39 | true 40 | 41 | 42 | org.projectlombok 43 | lombok 44 | true 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-starter-test 49 | test 50 | 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-maven-plugin 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | 2 | # Hands-On Spring Data Cassandra 3 | 4 | 5 | [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/DataStax-Academy/workshop-spring-data-cassandra) 6 | [![License Apache2](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0) 7 | [![Discord](https://img.shields.io/discord/685554030159593522)](https://discord.com/widget?id=685554030159593522&theme=dark) 8 | 9 | Today we will develop the famous TodoApplication backend with a storage in **Apache Cassandra™** with **Spring Boot** and **Spring Data** 10 | 11 | ![SplashScreen](https://github.com/DataStax-Academy/workshop-spring-data-cassandra/blob/main/images/splash.jpeg?raw=true) 12 | 13 | ``` 14 | ℹ️ Information 15 | ----------------- 16 | 17 | 💻 There is nothing preventing you from running the workshop on your own laptop. 18 | 19 | If you do so, you will need 20 | - Maven 21 | - A JavaIDE like VSCode, IntelliJ, Eclipse or Spring STS 22 | - Curl. 23 | 24 | You will have to adapt commands and paths based on your environment and 25 | install the dependencies by yourself. We won't provide support during the live to 26 | keep the schedule. 27 | ``` 28 | 29 | ## 1. Launch Gitpod 30 | 31 | [Gitpod](https://www.gitpod.io/) is an IDE 100% online based on VSCode. To initialize your environment simply click on the button below *(CTRL + Click to open in new tab)* You will be asked for you github account. 32 | 33 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/DataStax-Academy/workshop-spring-data-cassandra) 34 | 35 | **👁️ Expected output** 36 | 37 | *The screenshot may be slightly different based on your default skin and a few edits in the read me.* 38 | 39 | ![TodoBackendClient](https://github.com/DataStax-Academy/workshop-spring-data-cassandra/blob/main/images/gitpod-home.png?raw=true) 40 | 41 | You may be asked to import the project, please accept to have Java features enabled for you project. 42 | 43 | ![TodoBackendClient](https://github.com/DataStax-Academy/workshop-spring-data-cassandra/blob/main/images/import.png?raw=true) 44 | 45 | **That's it.** Gitpod provides all tools we will need today including `Maven` and exporting port `8080`. At initialization of the workspace we schedule a `mvn clean install` to download dependencies. 46 | 47 | Also you may have noticed there is a build happening - even before we get started. The sample project already exists and loading the developer enviroment triggers a build to download all the maven dependencies so you don't have to. 48 | 49 | ## 2. Know your gitpod 50 | 51 | The workshop application has opened with an ephemeral URL. To know the URL where your application endpoint will be exposed you can run the following command in the terminal: 52 | 53 | ```bash 54 | gp url 8080 55 | ``` 56 | 57 | **👁️ Expected output** 58 | 59 | ![TodoBackendClient](https://github.com/DataStax-Academy/workshop-spring-data-cassandra/blob/main/images/gitpod-url.png?raw=true) 60 | 61 | 🚀 **Let's get starting** 62 | 63 | To move to branch `PART1`, in a terminal use the following command. 64 | 65 | - You should read the instructions in gitpod now as moving to the next branch will update this README with the new instructions. 66 | 67 | - When you move from one branch to another using checkout you will have the workspace populated with the solution. Your local changes will be lost. 68 | 69 | 70 | ```bash 71 | git checkout PART1 72 | ``` 73 | 74 | --------------------------------------------------------------------------------