{"id":26317225,"url":"https://github.com/alexmarqs/springboot-rest-api-mongodb","last_synced_at":"2025-03-15T13:18:50.425Z","repository":{"id":47523434,"uuid":"213393518","full_name":"alexmarqs/springboot-rest-api-mongodb","owner":"alexmarqs","description":"📊 A simple example of a REST API using SpringBoot + MongoDB + Docker","archived":false,"fork":false,"pushed_at":"2021-08-25T13:49:05.000Z","size":80,"stargazers_count":4,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-06T23:46:13.415Z","etag":null,"topics":["docker","docker-compose","embedded-mongodb","mongodb","spring-boot","springboot","swagger2"],"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/alexmarqs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-07T13:40:00.000Z","updated_at":"2022-08-07T21:23:01.000Z","dependencies_parsed_at":"2022-07-25T01:02:20.209Z","dependency_job_id":null,"html_url":"https://github.com/alexmarqs/springboot-rest-api-mongodb","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmarqs%2Fspringboot-rest-api-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmarqs%2Fspringboot-rest-api-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmarqs%2Fspringboot-rest-api-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmarqs%2Fspringboot-rest-api-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmarqs","download_url":"https://codeload.github.com/alexmarqs/springboot-rest-api-mongodb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732199,"owners_count":20338839,"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":["docker","docker-compose","embedded-mongodb","mongodb","spring-boot","springboot","swagger2"],"created_at":"2025-03-15T13:18:49.836Z","updated_at":"2025-03-15T13:18:50.410Z","avatar_url":"https://github.com/alexmarqs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Campaigns REST API example\nThis is a simple example how you can use spring boot + mongodb + docker to create a rest api. Any suggestions, new features or corrections are welcome!\n\n- [x] Spring Boot\n- [x] Spring Data\n- [x] MongoDB \n- [x] Log4j2 (instead of logback)\n- [x] Docker\n- [x] Swagger 2 (api documentation)\n- [x] CORS filter\n- [x] Unit Tests\n- [x] Integration Tests\n\n**System requirements**\n- JDK 11\n- Maven\n- Docker\n\n## API documentation \nThis example uses Swagger 2. Access http://localhost:8080/swagger-ui.html to check the documentation.\n\n## Build and run application\nThe file [docker-compose.yml](docker-compose.yml) contains all the necessary settings to configure the environemnt. As this is a very simple application, we will basically have only two containers/services - the rest api and the database. If you want to  build or rebuild services to include any code changes in the docker image(s), run `docker-compose build`. To start all the services, you need to run `docker-compose up` (use `-d` to run in detached mode). The docker image for the rest api application service is defined by the file [Dockerfile](Dockerfile) using multi stages in order to build and execute the application.\n\nIf you prefer not to use docker, you can manually build and generate the executable file with `mvn clean package` and then run the maven spring boot plugin (`mvn spring-boot:run`) or directly the java command `java -jar \u003cjar file location\u003e`. Do not forget to set the required environment variables for the [application.properties](/src/main/resources/application.properties). You must be running an instance of MongoDB server.\n\nThe rest api application will be available at http://localhost:8080.\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmarqs%2Fspringboot-rest-api-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmarqs%2Fspringboot-rest-api-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmarqs%2Fspringboot-rest-api-mongodb/lists"}