Notice: you're looking at a read-only mirror of our Dokuwiki.

login

Monolith

This document provides an overview of the dma.space monolith, its responsibilities, and how to contribute to its development.

What is the Monolith?

The monolith is the primary backend application for dma.space's portal. It is a single, unified codebase that provides a wide range of services and functionalities for members and staff. The monolith is written in Go and utilizes the go.uber.org/fx framework for dependency injection, which helps in organizing the different components of the application.

Architecture

The monolith is designed to be a central hub for all of dma.space's services. For more detailed information, you can refer to the source code and the README.md file in the repository.

Dependency Injection

The monolith uses uber/fx for dependency injection. This allows each service to be designed in a modular way, where each service grabs only the dependencies it needs. This design promotes loose coupling and allows services to seamlessly interoperate with each other.

For example, the homeassistant service exists independently of other API-related services, but the spaceapi service can optionally depend on it to fetch sensor information from Home Assistant for its JSON output.

Dependencies

To run the monolith, the following external services are required:

The monolith can also integrate with the following optional services:

Responsibilities

The monolith is in charge of the following services:

Jobs

The monolith runs a background job worker that is responsible for executing various automated tasks. These jobs are managed using a PostgreSQL-based job queue. Some of the key jobs include:

HTTP Routes

The following is a list of all the top-level pages available in the monolith.

Contributing

We welcome contributions to the monolith! Here’s how you can get started:

Where to Contribute

The monolith codebase is located in this repository. The main application entry point is at cmd/dma-monolith/main.go, and the various services are organized under the services/ directory.

How to Contribute

  1. Set up your development environment: Follow the instructions in the README.md file to set up your local development environment. This includes installing the necessary tools like Go, Nix, and Docker.
  2. Find an issue to work on: Look for open issues in the issue tracker. If you have an idea for a new feature or a bug fix, you can create a new issue to discuss it with the team.
  3. Create a new branch: Create a new branch for your changes.
  4. Write your code: Make your changes to the codebase, following the existing coding style and conventions.
  5. Test your changes: Make sure to add or update tests for your changes.
  6. Submit a pull request: Once you are happy with your changes, submit a pull request for review.

Point of Contact

If you have any questions or need help with the monolith, please reach out to @diamond.