Calculator provides an easy to use API to evaluate mathematical expressions

Related tags

App calculator
Overview

Calculator example workflow

Calculator provides an easy to use API to evaluate mathematical expressions created with following operators:

  1. +
  2. -
  3. *
  4. /
  5. (
  6. )

For example: This expression 1 + 2 * (9 / 3 - 1) * 2 would evaluate to 9

API Reference

Evaluate mathematical expression

  GET /calculus
Parameter Type Description
query string Required. UTF-8 Base64 encoded string

Tech Stack

Server: JDK-11, Kotlin, Spring-Boot v2.6, Docker, Gradle

Run Locally

Clone the project

git clone https://github.com/ashish-bhatt-go/calculator

Go to the project directory

cd calculator

Build the project - Make sure you have JDK-11 installed and its path set correctly

./gradlew clean build

Start the server(by default it would start server on port 8080)

./gradlew bootRun

Running Tests

Run the following command from the project's root directory

./gradlew clean build test

Demo/Example

You can access and play with the public API deployed on Heroku here. Below is a sample curl request to evaluate an expression using the deployed public API.

curl --location --request GET 'https://calculus-128.herokuapp.com/calculus?query=MiArIDMgKiAoIDUgLSA2ICogOSAvIDMpICogNCAvIDM='

Deployment

Deploy Locally

You can deploy locally using Docker. Please install it first and make sure Docker daemon is running.

Create a local Docker image

docker build -t calculus .

Run the created Docker image

docker run calculus

Deploy to Production

This project uses GitHub actions to build and test the gradle project. After that it builds a docker image and then deploy to Heroku instance. This is completely an automated process though some manual steps were taken to setup project on Heroku.

Manual steps:

  1. Create an account on Heroku, if you don't have one
  2. Create a new public Java project
  3. Create appropriate secrets in GitHub project e.g. Heroku app name, email and API
  4. Use GitHub action to build, push and deploy the docker image to Heroku with the new project that you created

Automated steps in the CI/CD pipeline:

  1. Push the code to main branch
  2. It would run the pipeline as configured with GitHub actions
  3. If all the actions are successful, you could access your latest changes here: https://calculus-128.herokuapp.com using the API as described in the Demo section
You might also like...
The BirthYaay app provides an organized way of documenting birthdays of friends, colleagues, family members and so on. The app provides a beauty UI with suggestions of birthday gifts and messages crafted based on celebrant interests. A calculator for quick simple calculations with a nice user interface and no ads
A calculator for quick simple calculations with a nice user interface and no ads

Simple Calculator A calculator with the basic functions and a customizable widget. You can copy the result or formula to clipboard by long pressing it

Build your first Android app - a tip calculator!
Build your first Android app - a tip calculator!

Tippy - A Simple Tip Calculator for Android Build Tippy as your first Android app! Follow the YouTube walkthrough video Author: Rahul Pandey Features:

A Simple Calculator For Android With Java .

Installation Open Aide : Please at the first open AIDE app on your mobile . Create XML files : Copy XML files from the [ Res ] folder and paste them i

A Simple Calculator developed in Kotlin
A Simple Calculator developed in Kotlin

Calculator developed in Kotlin This was my first contact with mobile programming using Kotlin. The calc is basic, but it was the first project I did.

Calculator Neumorphism

Calculator Created UI With Neumorphism Arash Altafi personal website Screenshots Appendix This Library For Fornewid :) 🔗 Links https://github.com/for

A calculator app based on Material You
A calculator app based on Material You

Kotlin Calculator 🧮 A calculator app based on Material You. 🧮 This is a basic calculator app made from Kotlin, which uses Monet Engine on Android 12

A Tip Calculator app written in Kotlin that takes Total cost as an input and calculate tip according to the feedbacks.
A Tip Calculator app written in Kotlin that takes Total cost as an input and calculate tip according to the feedbacks.

Create a Tip Calculator App Code for the Android Basics in Kotlin: Create a Tip Calculator app codelab. In this codelab, you will be writing code for

BMI Calculator App Made in Kotlin
BMI Calculator App Made in Kotlin

BMR-Diet Details of Project It is an Android application Made in Kotlin Layout is made in XML Tools used : Android studio RecyclerView is used for Mem

Owner
null
Calculator is a simple 4 function calculator

Calculator Calculator is a simple 4 function calculator, with a panel that has more advanced functions when you need them. It includes history, real t

Will 207 Jan 8, 2023
Kotlin-basic-calculator - Basic calculator to understand syntax and the methods of Kotlin

KotlinBasicCalculator I always love to create a calculater for understand the sy

Onur Serbes 1 Mar 8, 2022
Calculator - A Simple Calculator Application Using Kotlin Language

Calculator A Simple Calculator Application Using Kotlin Language Some Screenshot

Shounak Das 3 Oct 17, 2022
BigNumber-Calculator - Big Number Calculator in Kotlin Tornadofx

BigNumber-Calculator Big Number Calculator in Kotlin Tornadofx

null 10 Dec 9, 2022
Calculator - A Simple Calculator for android

SimpleCalculator Calculator for android

Midoriya 0 Feb 12, 2022
Tip Calculator- Add extensions to this tip calculator.

Add extensions to this repository- Here are some ideas: Change the color scheme of the app, e.g. the background/primary/secondary color. Modify the th

null 2 Oct 21, 2022
This application was created internally for Aseman Company to evaluate the performance of its employee

AsemanTile-HRM This application was created internally for Aseman Company to evaluate the performance of its employees Uses Each of the managers of th

yasinrezaei 2 Mar 23, 2022
Math World is an Android Application specialized in mathematics, where the application includes some sections related to arithmetic, unit conversion, scientific math laws and constants, as well as some mathematical questions that need some intelligence to reach the solution.

Math World is an Android Application specialized in mathematics, where the application includes some sections related to arithmetic, unit conversion, scientific math laws and constants, as well as some mathematical questions that need some intelligence to reach the solution.

null 7 Mar 12, 2022
A simple and stright-forward library for displaying mathematical equations or formulas in your android application

MathRenderer Simple and easy library written in kotlin language for displaying mathematical equations or formulas using MathJax. MathRenderView is bac

QuantaDot 2 Sep 26, 2022
An educational android app that provides services like notes, online videos and visualization calculator to learn and understand deep concepts of DSA.

Aldo ALDO is a free education app for the young programmers who are desiring to master the concepts of Data Structure and Algorithms. ALDO offers prac

Siddharth Singh 2 Aug 8, 2022