backend

command module
v1.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

README

Envelope Zero backend

Release Go Reference Go Report Card

Envelope Zero is fundamentally rooted in two ideas:

  • Using the envelope method to budget expenses into envelopes.
  • Zero Based Budeting, meaning that you assign all your money to an envelope. Saving for a vacation? Create an envelope and archive it after your vacation. Rent? Create an envelope that gets a fixed amount of money added every month.

Features

For a high level view of planned complex features, check the milestones.

To see all planned features, check the list of issues with the enhancement label.

Usage

Upgrading

See docs/upgrading.md.

Configuration

⚠ You need to configure a persistent storage to be mounted to /data, e.g. a docker volume. If you do not do this, upon deleting the container, all your data will be lost.

The backend can be configured with the following environment variables.

Name Type Default Description
API_URL string none, must be set The URL of the API, e.g. https://ez.example.com/api
GIN_MODE One of release, debug release The mode that gin runs in. Only set this to debug on your development environment!
PORT number 8080 The port the backend listens on
LOG_FORMAT One of json, human json if GIN_MODE is release, otherwise human If log output is written human readable or as JSON.
CORS_ALLOW_ORIGINS string "" hosts that are allowed to use cross origin requests, separated by spaces. Only set this when your frontend runs on a different host and/or port than the backend!
ENABLE_PPROF bool false If set to true, pprof profiles for application profiling are made available at /debug/pprof. ⚠ If you do not know what this means, do not turn this on.
Deployment methods

The recommended way for production deployments is to run the backend with the OCI image or a binary directly. For up-to-date binaries, check out the Releases page.

If you want to deploy with a method not listed here, you are welcome to open a discussion to ask any questions needed so that this documentation can be improved.

On Kubernetes

You can run the backend on any Kubernetes cluster with a supported version using the morremeyer/generic helm chart with the following values:

image:
  repository: ghcr.io/envelope-zero/backend
  tag: v0.2.1

# Only set this when you want to use sqlite as database backend.
# In this case, you need to make sure the database is regularly backed up!
persistence:
  enabled: true
  mountPath: /data

affinity:
  podAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchLabels:
            app.kubernetes.io/instance: ez-backend # Replace this with the name of your helm release
            app.kubernetes.io/name: generic
        topologyKey: "kubernetes.io/hostname"

ports:
  - name: http
    containerPort: 8080
    protocol: TCP

ingress:
  enabled: true
  hosts:
    - host: envelope-zero.example.com
      paths:
        - path: /api
  tls:
    - hosts:
        - envelope-zero.example.com

Supported Versions

As the backend is constantly developed, only the latest minor version is supported (versions are MAJOR.MINOR.PATCH). If you encounter an issue, please update to the latest version of the backend and verify that it still exists in that version.

Please check the releases page for the latest release.

Contributing

Please see the contribution guidelines.

Versioning

This project is versioned using Semantic Versioning 2.0.0.

The public API is defined as:

  • The API endpoints, meaning the routes, parameters, HTTP respone codes and response body format (for a function, we'd just say “the function signature“)
  • The behavior of the API endpoints no matter the signature of the endpoint is
  • Planned: Public functions and methods of the code - this enables anybody wrapping the backend (e.g. the standalone version) to rely on the version numbers. This will be added to the definition once all methods and functions intended to be private are private. Track #423 if you're interested in this.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package api GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package api GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
internal
types
Package types implements special types for Envelope Zero.
Package types implements special types for Envelope Zero.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL