{"id":13840513,"url":"https://github.com/CleverCloud/springboot-mongo-example","last_synced_at":"2025-07-11T09:32:02.947Z","repository":{"id":43176798,"uuid":"96413042","full_name":"CleverCloud/springboot-mongo-example","owner":"CleverCloud","description":"Run Spring Boot with MongoDB on Clever Cloud","archived":false,"fork":false,"pushed_at":"2022-03-15T08:53:09.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-07-06T10:45:41.622Z","etag":null,"topics":["clevercloud-example","mongodb","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleverCloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-06T09:28:48.000Z","updated_at":"2022-03-15T08:53:13.000Z","dependencies_parsed_at":"2022-09-15T12:31:41.867Z","dependency_job_id":null,"html_url":"https://github.com/CleverCloud/springboot-mongo-example","commit_stats":null,"previous_names":["clevercloud/demo-springboot-mongo-rest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CleverCloud/springboot-mongo-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverCloud%2Fspringboot-mongo-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverCloud%2Fspringboot-mongo-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverCloud%2Fspringboot-mongo-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverCloud%2Fspringboot-mongo-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleverCloud","download_url":"https://codeload.github.com/CleverCloud/springboot-mongo-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverCloud%2Fspringboot-mongo-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264777753,"owners_count":23662553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clevercloud-example","mongodb","spring-boot"],"created_at":"2024-08-04T17:00:49.848Z","updated_at":"2025-07-11T09:32:02.661Z","avatar_url":"https://github.com/CleverCloud.png","language":"Java","funding_links":[],"categories":["Examples"],"sub_categories":["Java, Kotlin \u0026 Co"],"readme":"# Spring Boot as RESTful Demo for Clever-Cloud\n\n## Description\n\nThis is a small Spring Boot app that uses java + maven Clever Cloud application type.\n\nThis is a RESTful app which is using the MongoDB addon.\n\n## Features\n\nAs a RESTful you can use HTTP requests like:\n\n-   `GET /users`\n-   `GET /users/{userId}`\n-   `POST /users \"body\": {\"firstName\":\"Robert\", \"lastName\":\"Cloud\"}`\n-   `DELETE /users/{userId}`\n\n## Model\n\n```json\n\"users\":[\n    {\n        \"id\" : \"...\",\n        \"firstName\" : \"...\",\n        \"lastName\" : \"...\"\n    }\n]\n```\n\n## Configuration\n\n### MongoDB\n\nMongoDB URI is set in `src/main/resources/application.properties` and looks like:\n\n```java\nspring.data.mongodb.uri=${MONGODB_ADDON_URI}\n```\n\nWhere `MONGODB_ADDON_URI` is an environment variable which is specified by MongoDB addon link.\n\n## Install and run locally\n\n-   install dependencies: `mvn install`\n-   tests: `mvn test`\n-   run: `mvn spring-boot:run`\n\n## Deploy on the Clever Cloud console\n\nCreate a mongodb add-on and link it to your app.\n\n### Set the goal in the environment\n\nIn the environment variables, create `MAVEN_DEPLOY_GOAL` and set it to `spring-boot:run`\n\n## Example\n\nCreate new user\n\n```bash\ncurl -d '{\"firstName\":\"Robert\", \"lastName\":\"Cloud\"}' -H \"Content-Type: application/json\" -X POST https://\u003cappId\u003e.cleverapps.io/users\n```\n\nGet users list\n\n```bash\ncurl -X GET https://\u003cappId\u003e.cleverapps.io/users\n```\n\nFind user by id\n\n```bash\ncurl -X GET https://\u003cappId\u003e.cleverapps.io/users/\u003cuserId\u003e\n```\n\nRemove user by id\n\n```bash\ncurl -X DELETE https://\u003cappId\u003e.cleverapps.io/users/\u003cuserId\u003e\n```\n\n## Test\n\nI wrote an example of test in `src/test/java/com/cc/demo/test/UserMongoRepositoryTest.java` which is called during `mvn test`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCleverCloud%2Fspringboot-mongo-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCleverCloud%2Fspringboot-mongo-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCleverCloud%2Fspringboot-mongo-example/lists"}