{"id":20977424,"url":"https://github.com/ruferdz/simple-calculator","last_synced_at":"2026-05-10T05:38:28.848Z","repository":{"id":218325006,"uuid":"744396248","full_name":"RuFerdZ/simple-calculator","owner":"RuFerdZ","description":"🛠️ This project implements a simple calculator API using Spring Boot, providing endpoints for basic arithmetic operations, string concatenation, exponentiation, and mathematical functions. 🔢✨   Check it out: Technical Report ⬇️⬇️⬇️","archived":false,"fork":false,"pushed_at":"2024-05-05T15:15:58.000Z","size":1386,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T06:14:52.082Z","etag":null,"topics":["azure","devops","jenkins","spring-boot"],"latest_commit_sha":null,"homepage":"https://drive.google.com/drive/folders/1iPApm64tJi_DasmMHUlFPXXBN3IiTtoy?usp=sharing","language":"HTML","has_issues":true,"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/RuFerdZ.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-17T08:04:20.000Z","updated_at":"2024-10-16T15:14:43.000Z","dependencies_parsed_at":"2024-05-05T18:29:23.208Z","dependency_job_id":"1de99334-3631-4e6e-a773-71de9b3e4910","html_url":"https://github.com/RuFerdZ/simple-calculator","commit_stats":null,"previous_names":["ruferdz/simple-spring-boot-calculator","ruferdz/simple-calculator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuFerdZ%2Fsimple-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuFerdZ%2Fsimple-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuFerdZ%2Fsimple-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuFerdZ%2Fsimple-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RuFerdZ","download_url":"https://codeload.github.com/RuFerdZ/simple-calculator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243382781,"owners_count":20282007,"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":["azure","devops","jenkins","spring-boot"],"created_at":"2024-11-19T04:58:44.712Z","updated_at":"2026-05-10T05:38:28.806Z","avatar_url":"https://github.com/RuFerdZ.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Calculator API 💻\r\n\r\nThis project implements a simple calculator API using Spring Boot. It provides endpoints for performing basic arithmetic operations, string concatenation, exponentiation, and mathematical functions.\r\n\r\n## Endpoints (Documentation) 📝\r\n\r\n## Arithmetic Operations ➕➖✖️➗\r\n\r\n| Endpoint             | Description                                     | Request Parameters       | Return Type |\r\n|----------------------|-------------------------------------------------|---------------------------|-------------|\r\n| `/calc/add`          | Adds two integers                               | `a` (int), `b` (int)      | `int`       |\r\n| `/calc/subtract`     | Subtracts one integer from another              | `a` (int), `b` (int)      | `int`       |\r\n| `/calc/multiply`     | Multiplies two integers                         | `a` (int), `b` (int)      | `int`       |\r\n| `/calc/divide`       | Divides one integer by another (handles division by zero) | `a` (int), `b` (int) | `int`       |\r\n| `/calc/remainder`    | Calculates the remainder of dividing one integer by another | `a` (int), `b` (int) | `int`       |\r\n\r\n**Note:** The `/calc/divide` endpoint gracefully handles division by zero, returning a suitable error message.\r\n\r\n## String Manipulation 🔤\r\n\r\n| Endpoint             | Description                                     | Request Parameters       | Return Type |\r\n|----------------------|-------------------------------------------------|---------------------------|-------------|\r\n| `/calc/concat`       | Concatenates two strings                        | `a` (String), `b` (String)| `String`    |\r\n\r\n## Mathematical Functions 🧮\r\n\r\n| Endpoint             | Description                                     | Request Parameters       | Return Type |\r\n|----------------------|-------------------------------------------------|---------------------------|-------------|\r\n| `/calc/power`        | Calculates `a` raised to the power of `b` (handles negative powers) | `a` (double), `b` (double) | `long` |\r\n| `/calc/square`       | Calculates the square of a number              | `a` (double)              | `long` |\r\n| `/calc/sqrt`         | Calculates the square root of a number          | `a` (double)              | `double` |\r\n| `/calc/log`          | Calculates the natural logarithm (base e) of a number | `a` (double)         | `double` |\r\n\r\n**Note:** The `/calc/power` endpoint can handle negative powers.\r\n\r\n**Note:**\r\n- The `/calc/divide` endpoint handles division by zero gracefully, returning a suitable error message.\r\n- The `/calc/power` endpoint can handle negative powers.\r\n\r\n## Environments 🌐\r\n\r\nThis project supports three environments: development (dev), staging, and production. The base URL for each environment will vary depending on your deployment setup. You'll need to replace `[BASE_URL]` in the links below with the appropriate values.\r\n\r\n## Postman Collection 📦\r\n\r\nA Postman collection for testing these endpoints across all environments is available at [link to Postman collection] (link not provided for security reasons). However, you can easily create your own collection using the information provided in the \"Endpoints (Documentation)\" table.\r\n\r\n## Environment Links 🔗\r\n\r\n- Development: `[BASE_URL]/calc`\r\n- Staging: `[BASE_URL]/calc`\r\n- Production: `[BASE_URL]/calc`\r\n\r\n## Building and Running 🏃‍♂️\r\n\r\n1. Clone this repository.\r\n2. Ensure you have Gradle installed.\r\n3. Run `gradle build` to build the project.\r\n4. Start the application using your preferred method (e.g., Spring Boot application runner).\r\n\r\n## Running with Docker 🐳\r\n\r\nTo run the Spring Boot Calculator API using Docker, follow these steps:\r\n\r\n1. Install Docker on your machine by following the instructions on the official Docker website: [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)\r\n2. Build the Docker image using the provided Dockerfile:\r\n\r\n\r\n\r\n        docker build -t calculator-api .\r\n    \r\n3. Once the image is built, you can run the container:\r\n\r\n        docker run -p 8080:8080 calculator-api\r\n\r\nThe API will be accessible at `http://localhost:8080`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruferdz%2Fsimple-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruferdz%2Fsimple-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruferdz%2Fsimple-calculator/lists"}