A lightweight simple REST API server for tracking your budget statistics.
Retrieves the current total balance.
Headers:
Authorization: Bearer *TALLYBOX_API_GET_TOTAL_TOKEN*
Response:
{
"total": 1999
}Returns the full transaction history.
Headers:
Authorization: Bearer *TALLYBOX_API_GET_HISTORY_TOKEN*
Response:
{
"history": [
{
"amount": -10,
"comment": "The string (c) copyright",
"timestamp": 170000000 // Unix timestamp
}
]
}Returns both the current total and transaction history.
Headers:
Authorization: Bearer *TALLYBOX_API_SET_TOKEN*
Response:
{
"total": 1999,
"history": [
// Same structure as in /history
]
}Adds a new transaction (income or expense).
Headers:
Authorization: Bearer *TALLYBOX_API_SET_TOKEN*
Request Body:
{
"amount": -362, // Positive = income, Negative = expense
"comment": "Dinner with friends"
}Response:
{
"success": true,
"total": 1637, // Updated total balance after processing the request
"history_record": {
"amount": -362, // Rounded amount
"comment": "Dinner with friends", // Trimmed string
"timestamp": 170000000 // Unix timestamp
}
}- 🔹 Simple and lightweight API
- 🔹 Secure authorization with API tokens
- 🔹 Supports income & expense tracking
- 🔹 Provides a full transaction history
To run TallyBox using Docker, follow these steps:
Before starting the container, define the required environment variables. You can store them in a .env file.
Create a file named tallybox.env and add:
TALLYBOX_API_TOKEN=your_master_token # Optional, used as default for other tokens if not set
TALLYBOX_API_GET_TOTAL_TOKEN=your_total_token
TALLYBOX_API_GET_HISTORY_TOKEN=your_history_token
TALLYBOX_API_SET_TOKEN=your_set_token
TALLYBOX_DATA_DIR_PATH=/var/lib/tallybox # Path to store data inside the container(Remove #comments before save please)
Replace your_master_token, your_total_token, etc., with actual values. (generate random)
Use the following command to start the TallyBox container:
docker run -d \
--publish 1234:8080 \
--env-file /path/to/secrets/tallybox.env \
-v /tallybox-data:/var/lib/tallybox \
--restart=always \
--name=tallybox-container \
fazziclay/tallybox:latest-d→ Runs the container in detached mode.--publish 1234:8080→ Maps port 8080 in the container to port 1234 on the host.--env-file /path/to/secrets/tallybox.env→ Loads environment variables from the.envfile.-v /tallybox-data:/var/lib/tallybox→ Mounts a local directory to store persistent data.--restart=always→ Ensures the container restarts automatically if it crashes or reboots.--name=tallybox-container→ Assigns a custom name to the container.fazziclay/tallybox:latest→ Uses the latest TallyBox image from Docker Hub.
After starting the container, check its status:
docker ps | grep tallybox-containerIf everything is set up correctly, TallyBox should now be running on http://your-host-ip:1234 or your configured port.
Now you’re ready to use TallyBox! 🚀
It's very simple
/path/to/data/
├── total.txt # Stores the total balance
├── history.json # Stores transaction history
├── version.txt # Stores version information- 🔹 Add paginator for history...