Shoptrac is a simple web application designed to track my costs of living by registering the total price spent whenever I went to the grocery store, or any other store I want to keep tabs on.
It consists of a backend application (this repository) and a corresponding Vue.js frontend (https://github.com/mandrakey/shoptrac-frontend).
The backend is built using the following technology:
-
Go
-
ArangoDB
The software is not officially provided with any package managers as far as I know, and there are no plans for me to do this. If you want to try Shoptrac for yourself, you will have to build the applications yourself.
To build the backend application, thanks to Go being very easy to handle, you simply download a copy of the repository and issue go build
. This will compile the source code to a file called shoptrac
(or shoptrac.exe
if you are on Windows). You then put a configuration file (see shoptrac.json.dist
for examples) beside it and simply run ./shoptrac serve
.
Shoptrac uses ArangoDB (https://arangodb.com), an open source object database, for data storage. Install it, create a user/password and a database, and you should be fine - Shoptrac contains migrations logic to create necessary collections and base information on startup. I’ve never tried it on an empty database, but it should work.
{
"address": "127.0.0.1",
"loglevel": "debug",
"access-policy": {
"default": "deny",
"rules": [
{
"origin": "(127.0.0.1|\\[::1\\])",
"policy": "allow"
}
]
},
"database": {
"protocol": "http",
"host": "127.0.0.1",
"port": 8529,
"user": "user",
"password": "password",
"database": "shoptrac"
}
}
The following values are understood:
Name | Default | Description |
---|---|---|
address |
0.0.0.0 |
The address to bind the server to / to listen on. Defaults to |
loglevel |
debug |
Specify the granularity of the created logfile. For available loglevels see https://github.com/op/go-logging. |
access-policy |
- |
Access policies are basically a miniature, unsafe version of a "firewall". They allow you to deny or allow usage of the API from certain addresses or address ranges - both IPv4 and IPv6 are supported. I use this to only allow my personal home IP to speak to the application hosted on my server. |
access-policy.default |
deny |
The default policy for access if no rules match the remote IP address of the request. Can be |
access-policy.rules |
- |
List of access policy rules. Each rule consists of a JSON object with two fields:
|
database |
- |
Contains the configuration of the ArangoDB database to connect to. |
database.protocol |
http |
The protocol to use when talking to ArangoDB. Defaults to |
database.host |
127.0.0.1 |
Hostname or IP address of the database server. |
database.port |
8529 |
Port on the database server to connect to. Defaults to ArangoDB’s default port. |
database.user |
- |
Username to use when connecting to the database. |
database.password |
- |
Password for the provided database username. |
database.database |
- |
Name of the database inside ArangoDB to use. |
As this is a private project, created mostly for my personal benefit (and for fun, being able to use something else than Java and PostgreSQL for a change), it is really only maintained when I feel I need to change it, and when my spare time allows it. Feel free to create tickets, but I don’t give any guarantee I’ll even look at them in a timely fashion.
The source code is licensed under BSD-3-Clause license, as can be found under LICENSES/BSD-3-Clause.txt.