Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
Pull Request #69
  • Loading branch information
ShoshinNikita authored Jan 23, 2020
2 parents 36bef5c + 7ccfa73 commit 3c8331e
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 13 deletions.
96 changes: 83 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,82 @@
# Budget Manager

**Budger Manager** is an easy-to-use, lightweight and self-hosted solution to track your finances

![Month Page](./docs/images/month_page_large.png)

It was inspired by [Poor-Man's Budgeting Spreadsheet](https://www.reddit.com/r/personalfinance/comments/2tymvf/poormans_budgeting_spreadsheet/) and [You have less money than you think (rus)](https://journal.tinkoff.ru/spreadsheet/). These projects have a fatal flaw: you can't add multiple spends in a single day. **Budger Manager** resolves that issue

**Features:**

- **Easy-to-use** - simple and intuitive UI

- **Lightweight** - backend is written in [Go](https://golang.org/), HTML is prepared with [Go templates](https://golang.org/pkg/text/template/). Vanilla JavaScript is used just to make frontend interactive. So, JS code is very primitive and lightweight: it won't devour all your CPU and RAM (even with Chrome 😉)

- **Self-hosted** - you don't need to trust any proprietary software to store your financial information

You can find more screenshots [here](./docs/images/README.md)

***

- [Install](#install)
- [Configuration](#configuration)
- [Development](#development)
- [Run](#run)
- [Test](#test)
- [API](#api)
- [General](#general)
- [Income](#income)
- [Monthly Payment](#monthly-payment)
- [Spend](#spend)
- [Spend Type](#spend-type)
- [Endpoints](#endpoints)
- [Pages](#pages)
- [API](#api)

## Install

You need [Docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/) (optional)

1. Create `docker-compose.yml` with the following content (you can find more settings in [Configuration](#configuration) section):

```yaml
version: "2.4"

services:
budget-manager:
image: docker.pkg.github.com/shoshinnikita/budget-manager/budget-manager:latest
container_name: budget-manager
environment:
DB_TYPE: postgres
DB_PG_HOST: postgres
DB_PG_PORT: 5432
DB_PG_USER: postgres
DB_PG_PASSWORD: very_strong_password
DB_PG_DATABASE: postgres
SERVER_PORT: 8080
SERVER_CREDENTIALS: your credentials # more info in 'Configuration' section
ports:
- "8080:8080"

postgres:
image: postgres
container_name: budget-manager_postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: very_strong_password
POSTGRES_DB: postgres
volumes:
# Store data in ./var/pg_data directory
- type: bind
source: ./var/pg_data
target: /var/lib/postgresql/data
command: -c "log_statement=all"
```
2. Run `docker-compose up -d`
3. Go to `http://localhost:8080` (change the port if needed)
4. Profit!

## Configuration

| Env Var | Default value | Description |
| ------------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DEBUG` | `false` | Is Debug Mode on |
| `LOGGER_MODE` | `prod` | Logger mode. Available options: `prod` (or `production`), `dev` (or `develop`). | **** |
| `LOGGER_MODE` | `prod` | Logger mode. Available options: `prod` (or `production`), `dev` (or `develop`). |
| `LOGGER_LEVEL` | `info` | Min level of log messages. Available options: `debug`, `info`, `warn`, `error`, `fatal`.<br><br>**Note:** level is always `debug` when Debug Mode is on |
| `DB_TYPE` | `postgres` | Database type. Only `postgres` is available now |
| `DB_PG_HOST` | `localhost` | Host for connection to the db |
Expand Down Expand Up @@ -68,13 +128,23 @@ make test
make test-integ
```

## API
## Endpoints

### Pages

You can find screenshots of pages [here](./docs/images/README.md)

- `/overview` - Overview Page (it is not ready yet)
- `/overview/{year}` - Year Page
- `/overview/{year}/{month_number}` - Month Page

### API

All endpoints return json response with `Content-Type: application/json` header.

Requests and responses can be found in [internal/web/models](internal/web/models/models.go) package

### General
#### General

- `GET /api/months` - get month

Expand All @@ -86,7 +156,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.GetDayReq` or `models.GetDayByDate`
**Response:** `models.GetDayResp` or `models.Response`

### Income
#### Income

- `POST /api/incomes` - add a new income

Expand All @@ -103,7 +173,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.RemoveIncomeReq`
**Response:** `models.Response`

### Monthly Payment
#### Monthly Payment

- `POST /api/monthly-payments` - add new Monthly Payment

Expand All @@ -120,7 +190,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.DeleteMonthlyPaymentReq`
**Response:** `models.Response`

### Spend
#### Spend

- `POST /api/spends` - add new Spend

Expand All @@ -137,7 +207,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.RemoveSpendReq`
**Response:** `models.Response`

### Spend Type
#### Spend Type

- `GET /api/spend-types` - get list of all Spend Types

Expand Down
25 changes: 25 additions & 0 deletions docs/images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Screenshots

## Month Page

### Large screen

![Large screen](./month_page_large.png)

### Medium screen

![Medium screen](./month_page_medium.png)

### Small screen

![Small screen](./month_page_small.png)

## Year Page

### Large screen

![Large screen](./year_page_large.png)

### Medium screen

![Medium screen](./year_page_medium.png)
Binary file added docs/images/month_page_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/month_page_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/month_page_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/year_page_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/year_page_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c8331e

Please sign in to comment.