Skip to content

Commit

Permalink
Even more README
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Dec 10, 2023
1 parent 26dc751 commit 5e9ba9e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The Money Gopher will help you to keep track of your investments.

Surely, there are a number of programs and services out there that already
manage your portfolio(s), why creating another one? Well there are several
reasons or rather requirements that I need. Note, that these might be very
specific to my use case, but maybe somebody else will appreciate them as well.
reasons or rather requirements that I have. Note, that these might be very
specific to my use-case, but maybe somebody else will appreciate them as well.

* 🏘️ I need to manage several portfolios for several distinct people, for
example my own and my children's. I want to keep these portfolios completely
Expand Down Expand Up @@ -69,13 +69,13 @@ After checking out the source-code, the necessary Go binaries can be compiled
using `go build ./cmd/moneyd` and can be started using `./moneyd`. It will print
out some information, but logging definitely needs to improved.

On startup, an SQLite database named `moneyd.db` will be created (or loaded) in
On startup, an SQLite database named `money.db` will be created (or loaded) in
the same directory as the started binary. If the database is empty, a new
portfolio named `mybank/myportfolio` and one example security will be created.

As a simple check, one can simply interact with the RPC-API with a normal HTTP
client, for example to list all portfolios.
```bash
```zsh
curl \
--header 'Content-Type: application/json' \
--data '{}' \
Expand All @@ -88,6 +88,36 @@ This should print something like the following.
{"portfolios":[{"name":"bank/myportfolio","displayName":"My Portfolio"}]}
```

## Using `mgo`

Alternatively, a simple CLI called `mgo` can be used. Its preferable to install
it for the current user using `go install ./cmd/mgo`. Afterwards, it can for
example used to display all portfolios with `mgo portfolio list`.

### Adding Transactions

To add transactions (buy, sell, etc.) to an existing portfolio, the command `mgo
portfolio transaction create` can be used. The following shows an example for
the security with the ISIN US0378331005.
```zsh
mgo portfolio transactions create US0378331005 --portfolio-name bank/myportfolio --amount 5 --price 120 --time="2022-01-01 10:00"
```

When successful, this should print something like the following.

```zsh
Successfully created a buy transaction (1c12ac28dfbc5440) for security US09075V1026 in bank/myportfolio.
```
The unique identifier (also called 'name') of the transaction can be used in
other calls, e.g., to modify it.
### Available Commands and Shell Completion
For a detailed list of all available commands see `mgo --help`. The CLI also
supports (basic) shell completion. For details how to activate it, please see
`mgo completion`.
# When is it finished?
Since I am working on this in my spare time, it will probably take a while 😃.
2 changes: 2 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v1
3 changes: 3 additions & 0 deletions money-gopher.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
"jotaen",
"kongcompletion",
"modernc",
"moneyd",
"moneygopher",
"mybank",
"myportfolio",
"oxisto",
"portfoliov",
"protobuf",
Expand Down
2 changes: 1 addition & 1 deletion ui/src/lib/gen/mgo_connect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=ts"
// @generated by protoc-gen-connect-es v1.1.4 with parameter "target=ts"
// @generated from file mgo.proto (package mgo.portfolio.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
2 changes: 1 addition & 1 deletion ui/src/lib/gen/mgo_pb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
// @generated by protoc-gen-es v1.5.1 with parameter "target=ts"
// @generated from file mgo.proto (package mgo.portfolio.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down

0 comments on commit 5e9ba9e

Please sign in to comment.