https://github.com/d-ashesss/mah-moneh
Personal finance management API
https://github.com/d-ashesss/mah-moneh
budgeting finance golang postgresql restful
Last synced: 2 months ago
JSON representation
Personal finance management API
- Host: GitHub
- URL: https://github.com/d-ashesss/mah-moneh
- Owner: d-ashesss
- License: mit
- Created: 2022-10-18T21:42:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-08T20:03:20.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T10:06:16.106Z (about 2 years ago)
- Topics: budgeting, finance, golang, postgresql, restful
- Language: Go
- Homepage:
- Size: 232 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mah Moneh
[](https://github.com/d-ashesss/mah-moneh/actions)
[](https://goreportcard.com/report/github.com/d-ashesss/mah-moneh)
[](https://github.com/d-ashesss/mah-moneh/blob/main/go.mod)
[](https://github.com/d-ashesss/mah-moneh/tags)
[](https://opensource.org/licenses/MIT)
[](https://github.com/d-ashesss/mah-moneh)
Personal finance management API.
## Running the app
The easiest way to run the app is to run it in Docker (provide environment variables as needed):
```bash
docker run -p 8080:8080 \
-e 'DB_HOST=postgres' \
-e 'DB_PASSWORD=postgres-password' \
-e 'AUTH_OPENID_CONFIGURATION_URL=https://accounts.google.com/.well-known/openid-configuration' \
ashesss/mah-moneh:latest
```
Or even with docker compose, where you can configure the environment in `docker-compose.override.yml` (see [example](https://github.com/d-ashesss/mah-moneh/wiki/example-docker%E2%80%90compose.override.yml)), then simply run:
```bash
docker-compose up
```
## Configuration
The configuration is done via environment variables.
* `PORT` - the port to run the web server on, default: 8080
### Authentication
The API handles authentication using JWT tokens. The token is passed in the `Authorization` header as a bearer token. It is possible to use OIDC service like [Auth0](https://auth0.com) to obtain the token and then use it with this API. It is required to provide the app with the URL to the OIDC discovery documents in the `AUTH_OPENID_CONFIGURATION_URL` environment variable.
### Database
The API uses PostgreSQL database. The connection must be with following environment variables:
* `DB_HOST` - the hostname of the database server, default: localhost
* `DB_PORT` - the port of the database server, default: 5432
* `DB_NAME` - the name of the database, default: postgres
* `DB_USER` - database user, default: postgres
* `DB_PASSWORD` - database user's password, required
* `DB_DEBUG` - whether to use the database in debug mode
### CORS
To configure CORS to allow access from a specific domain, set the `CORS_ALLOWED_ORIGINS` environment variable to semicolon-separated list of allowed URLs,
for example `CORS_ALLOWED_ORIGINS=http://localhost:5000;http://example.com`.