https://github.com/datastaxdevs/spring-boot-astra-spring-data-cassandra
TodoList to run Latest Spring Boot Spring Data Cassandra with AstraDB
https://github.com/datastaxdevs/spring-boot-astra-spring-data-cassandra
Last synced: 10 months ago
JSON representation
TodoList to run Latest Spring Boot Spring Data Cassandra with AstraDB
- Host: GitHub
- URL: https://github.com/datastaxdevs/spring-boot-astra-spring-data-cassandra
- Owner: datastaxdevs
- Created: 2025-02-17T10:11:21.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-17T11:09:42.000Z (12 months ago)
- Last Synced: 2025-02-17T12:22:34.890Z (12 months ago)
- Language: Java
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Installation
- Clone the repository
```console
git@github.com:datastaxdevs/spring-boot-astra-spring-data-cassandra.git
```
- Create an account in Astra DB for free [here](https://astra.datastax.com/)
- Create a Database ( [documentation](https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html))
- Create an Application token ([documentation](https://docs.datastax.com/en/astra-db-serverless/administration/manage-application-tokens.html))
- Get you Secure Connect bundle from Astra ([documentation](https://docs.datastax.com/en/astra-db-serverless/drivers/secure-connect-bundle.html))
## Setup
- Open `application.properties` and change those 2 properties:
```ini
# Replace with your token starting with AstraCS:...
spring.cassandra.password=
# Replace with the path of your secure bundle
datastax.astra.secure-connect-bundle=
```
## Use the application
- Start the application (first start could take up a few seconds as the table is created for you)
```bash
mvn spring-boot:run
```
- List your todos (or in your browser [http://localhost:8080/todos](http://localhost:8080/todos))
```bash
curl -X GET http://localhost:8080/todos
```
- Create a todo
```bash
curl -X POST http://localhost:8080/todos \
-H "Content-Type: application/json" \
-d '{"title": "New Todo", "description": "Todo details", "completed": false}'
```
- You can go to the CQL Console in astra UI to see your data:
