This package is REST API for Math requests.
We provide a third-party REST API wrapper for Mathematicator Search engine based on Mathematicator Framework.
This package has 2 main ways how to use it:
- Install it on your server
- Use our hosted Cloud API service
You can call the API in these ways:
- Build your own frontend (e.g. in React or Angular) that calls this REST API
- Call the API from your backend services
Method | URL | Description |
---|---|---|
GET | /v1/search/?q=:query | Solves query and returns response |
GET | /v1/ping | Returns actual server time |
The easiest way to use is to use our public API.
Terms of service: https://cothema.com/terms
Public API: https://math-php.herokuapp.com/
Our cloud API is temporarily free of charge.
You can also download the source code of this repository and run it on your own server or e.g. cloud service.
This package is based on:
- Mathematicator packages: mathematicator-core/search
- Symfony 5 framework
- Codeception Testing framework
Start project:
docker-compose -f docker/docker-compose.dev.yml up -d
Start project:
composer install
symfony server:start
Run tests:
php vendor/bin/codecept run
Feel free create new issues and send pull requests. All pull requests should contain complete unit tests.
We follow standards: PSR-1, PSR-4, PSR-12
We recommend to use PHPStorm IDE.
This project is determined for end usage as REST API, so we tend to use only the latest package versions.
Rest API should be infinitely back-compatible for its major version.
This repository can/should contain:
- Thin API layer as a proxy for query solver repositories.
- API restrictions / limits (not implemented)
- API authentication (not implemented)
- API billing logic (not implemented)
- Store data in a database
This repository should NOT contain:
- Query tokenization
- Query solution logic (e.g. calculations)
The biggest advantage is that you can choose which layer best fits your needs and start build on the top of it, immediately, without the need to create everything by yourself. Our tools are tested for bugs and tuned for performance, so you can save a significant amount of your time, money, and effort.
Framework tend to be modular as much as possible, so you should be able to create an extension on each layer and its sublayers.
Mathematicator framework layers ordered from the most concrete one to the most abstract one:
Search | Modular search engine layer that calls its sublayers and creates user interface. |
Vizualizator |
Elegant graphic visualizer that can render to
SVG, PNG, JPG and Base64. Extensions: Mandelbrot set generator |
Calculator |
Modular advance calculations layer.
Extensions: Integral Solver , Statistics |
Engine | Core logic layer that maintains basic controllers, DAOs, translator, common exceptions, routing etc. |
Tokenizer | Tokenizer that can convert string (user input / LaTeX) to numbers and operators. |
Numbers | Fast & secure storage for numbers with arbitrary precision. It supports Human string and LaTeX output and basic conversions. |