An open API service indexing awesome lists of open source software.

https://github.com/jasonlovesdoggo/abacus

:abacus: A highly-scalable and stateless counting API
https://github.com/jasonlovesdoggo/abacus

countapi countapi-alternative counter go

Last synced: 1 day ago
JSON representation

:abacus: A highly-scalable and stateless counting API

Awesome Lists containing this project

README

          

# Abacus—A highly scalable and stateless counting API

> Note: Abacus was designed as a direct replacement/upgrade for [CountAPI](https://countapi.xyz/) as it got taken down

In order to get started, please visit the docs at https://abacus.jsn.cam


---

### Development

1. Install Golang & Redis

2. Run `go mod install` to install the dependencies
3. Add a `.env` file to the root of the project (or set the environment variables manually) following the format specified in .env.example

4. Run `air` (if installed) or `go run .` to build and run the API locally.

5. The API will be running on `http://0.0.0.0:8080` by default.

## Todos

- [x] Documentation (https://abacus.jsn.cam)
- [x] ~~K8 Deployment~~ (fly.io + Redis on OCI)
- [x] JSONP Support (https://gin-gonic.com/docs/examples/jsonp/)
- [x] impl /create endpoint which creates a new counter initialized to 0 and returns a secret key that can be used to modify the counter via the following endpoints
- [x] /delete endpoint
- [x] /set endpoint
- [x] /reset (alias to /set 0)
- [x] /update endpoint (updates the counter x)
- [x] SSE Stream for the counters? Low priority.
- [x] Tests
- [x] Rate limiting (max 30 requests per 10 second per IP address)
- [ ] Create [Python](https://github.com/BenJetson/py-countapi), [JS Wrappers](https://github.com/mlomb/countapi-js) & Go client libraries