{"id":18524501,"url":"https://github.com/stelligent/microservice-exemplar","last_synced_at":"2025-04-09T12:30:54.062Z","repository":{"id":145835462,"uuid":"68036856","full_name":"stelligent/microservice-exemplar","owner":"stelligent","description":"Sample microservice built with Spring Boot to manage bananas. :banana:","archived":false,"fork":false,"pushed_at":"2020-01-07T15:39:11.000Z","size":516,"stargazers_count":23,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T05:26:21.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stelligent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-12T18:38:50.000Z","updated_at":"2023-08-27T03:51:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"27d3cbd2-fc8d-4d6f-89f8-d089e061cafd","html_url":"https://github.com/stelligent/microservice-exemplar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stelligent%2Fmicroservice-exemplar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stelligent%2Fmicroservice-exemplar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stelligent%2Fmicroservice-exemplar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stelligent%2Fmicroservice-exemplar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stelligent","download_url":"https://codeload.github.com/stelligent/microservice-exemplar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248040088,"owners_count":21037813,"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":[],"created_at":"2024-11-06T17:42:05.820Z","updated_at":"2025-04-09T12:30:54.052Z","avatar_url":"https://github.com/stelligent.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\nThis is a *sample microservice* application built with [Spring Boot](http://projects.spring.io/spring-boot/) and [Docker](https://www.docker.com/), deployed on Amazon ECS, to manage bananas :banana:\n\n![Architecture Diagram](architecture.png)\n\nReview the steps below to learn how it was created and how to create your own:\n\n# Step 1: Set up your environment\n\nYou will need to install the [Spring Boot CLI](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#getting-started-installing-the-cli) to get started.  The recommended way is to use [SDKMAN!](http://sdkman.io/index.html).  First install SDKMAN! with:\n\n```\n$ curl -s \"https://get.sdkman.io\" | bash\n```\n\nThen, install Spring Boot with:\n\n```\n$ sdk install springboot\n```\n\nAlternatively, you could install with [Homebrew](http://brew.sh/):\n\n```\n$ brew tap pivotal/tap\n$ brew install springboot\n```\n\nOr [MacPorts](http://www.macports.org/):\n\n```\n$ sudo port install spring-boot-cli\n```\n\n# Step 2: Scaffold out your microservice project\n\nUse the Spring Boot CLI to create a project:\n\n```\n$ spring init --build=gradle --package-name=com.stelligent --dependencies=web,actuator,hateoas -n Banana banana-service\n```\n\n# Step 3: Create a REST domain, repository, resource and controller\n\nwrite some code...\n\n\n# Step 4: Run it locally\n\nStart the app by running:\n\n```\n$ gradle bootRun\n``` \n\nTry it out:\n\n```\n$ curl http://localhost:8080/bananas\n```\n\n\n# Step 5: Create a Docker image\n\nUpdate gradle to build the docker image:\n\n```\nbuildscript {\n    ...\n    dependencies {\n        ...\n        classpath(\"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}\")\n        classpath 'com.bmuschko:gradle-docker-plugin:3.0.3'\n    }\n}\n\ngroup = 'stelligent'\n\n...\n\napply plugin: 'application'\napply plugin: 'spring-boot'\napply plugin: 'com.bmuschko.docker-java-application'\n\ndocker {\n\turl = 'unix:///var/run/docker.sock'\n\tjavaApplication {\n\t\tbaseImage = 'java:8'\n\t\tmaintainer = 'Casey Lee \"casey.lee@stelligent.com\"'\n\t\tports = [8080]\n\t\ttag = \"${project.repoUrl}:${project.revision}\"\n\t}\n\tregistryCredentials {\n\t\tdef ecrAuthData = new JsonSlurper().parseText('aws ecr get-authorization-token'.execute().text).authorizationData[0]\n\t\tdef credentials = new String(ecrAuthData.authorizationToken.decodeBase64()).tokenize(':')\n\n\t\tusername = credentials[0]\n\t\tpassword = credentials[1]\n\t\turl = ecrAuthData.proxyEndpoint\n\t}\n}\n```\n\nThen run:\n\n```\n$ gradle dockerBuildImage\n```\n \n\nRun it with:\n\n```\n$ docker run -p 8080:8080 -t stelligent/banana-service\n```\n\n# Step 6: Deploy to ECS\n\nSetup the stack with:\n\n```\n$ gradle platformUp\n```\n\nPush latest image to ECR and update the ECS service:\n```\n$ gradle deploy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstelligent%2Fmicroservice-exemplar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstelligent%2Fmicroservice-exemplar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstelligent%2Fmicroservice-exemplar/lists"}