Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| software:monolith [2025/12/21 06:23] – diamond | software:monolith [2025/12/31 13:36] (current) – update services diamond | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | # monolith | + | # Monolith |
| - | This document provides an overview of the DMA monolith, its responsibilities, | + | This document provides an overview of the dma.space |
| - | and how to contribute to its development. | + | |
| ## What is the Monolith? | ## What is the Monolith? | ||
| - | The monolith is the primary backend application for the DMA (Dallas Makerspace) | + | The monolith is the primary backend application for dma.space' |
| - | 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/ | + | |
| - | organizing the different components of the application. | + | |
| ## Architecture | ## Architecture | ||
| - | The monolith is designed to be a central hub for all of DMA's services. For more | + | The monolith is designed to be a central hub for all of dma.space's services. For more detailed information, |
| - | detailed information, | + | |
| - | [source code](https:// | + | |
| - | repository. | + | |
| ### Dependency Injection | ### Dependency Injection | ||
| - | The monolith uses [uber/ | + | The monolith uses [uber/ |
| - | 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 | + | 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. |
| - | API-related services, but the `spaceapi` service can optionally depend on it to | + | |
| - | fetch sensor information from Home Assistant for its JSON output. | + | |
| ### Dependencies | ### Dependencies | ||
| Line 35: | Line 22: | ||
| - **PostgreSQL**: | - **PostgreSQL**: | ||
| - | - **Authentik**: | + | - **Authentik**: |
| - | | + | |
| The monolith can also integrate with the following optional services: | The monolith can also integrate with the following optional services: | ||
| Line 42: | Line 28: | ||
| - **Stripe**: For processing membership dues and other payments. | - **Stripe**: For processing membership dues and other payments. | ||
| - **Home Assistant**: | - **Home Assistant**: | ||
| + | - **Zulip**: For synchronizing profile information. **It is not in charge of user role synchronization; | ||
| + | - **SpaceAPI**: | ||
| ### Responsibilities | ### Responsibilities | ||
| Line 47: | Line 35: | ||
| The monolith is in charge of the following services: | The monolith is in charge of the following services: | ||
| - | - **Member Portal**: Provides a web interface for members to manage their | + | - **Member Portal**: Provides a web interface for members to manage their accounts, memberships, |
| - | | + | - **Membership Dues & Billing**: Handles membership payments, billing cycles, and payment processing through Stripe. |
| - | - **Membership Dues & Billing**: Handles membership payments, billing cycles, | + | - **Member Inviting & Onboarding**: |
| - | | + | - **Notification System**: Sends out notifications to members regarding important events, announcements, |
| - | - **Member Inviting & Onboarding**: | + | - **Authentication**: |
| - | | + | - **API**: Exposes a set of APIs for various frontend applications and services to interact with. |
| - | - **Notification System**: Sends out notifications to members regarding | + | - **Home Assistant Integration**: |
| - | | + | - **Space API**: Implements the Space API protocol to provide information about the makerspace' |
| - | - **Authentication**: | + | |
| - | | + | |
| - | - **API**: Exposes a set of APIs for various frontend applications and services | + | |
| - | | + | |
| - | - **Home Assistant Integration**: | + | |
| - | | + | |
| - | - **Space API**: Implements the Space API protocol to provide information about | + | |
| - | | + | |
| ### Jobs | ### Jobs | ||
| - | The monolith runs a background job worker that is responsible for executing | + | 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: |
| - | various automated tasks. These jobs are managed using a PostgreSQL-based job | + | |
| - | queue. Some of the key jobs include: | + | |
| - | - **Syncing Member Billings**: Regularly syncs billing information for all | + | - **Syncing Member Billings**: Regularly syncs billing information for all members to ensure that their membership status is up-to-date. |
| - | | + | - **Processing Notifications**: |
| - | - **Processing Notifications**: | + | - **Data Synchronization**: |
| - | | + | |
| - | - **Data Synchronization**: | + | |
| - | | + | |
| ### HTTP Routes | ### HTTP Routes | ||
| Line 81: | Line 56: | ||
| The following is a list of all the top-level pages available in the monolith. | The following is a list of all the top-level pages available in the monolith. | ||
| - | - `/`: Renders the home page. This is currently a placeholder and will | + | - `/`: Renders the home page. This is currently a placeholder and will eventually be in charge of rendering the entire dma.space frontpage so that no JavaScript is needed for rendering important information, |
| - | | + | |
| - | | + | |
| - | | + | |
| - `/login`: Begins the authentication process. | - `/login`: Begins the authentication process. | ||
| - `/logout`: Logs the user out. | - `/logout`: Logs the user out. | ||
| - | - `/portal`: Renders the portal dashboard, which contains links to all | + | - `/portal`: Renders the portal dashboard, which contains links to all member-only pages. |
| - | | + | |
| - `/ | - `/ | ||
| Line 97: | Line 68: | ||
| ### Where to Contribute | ### Where to Contribute | ||
| - | The monolith codebase is located in this repository. The main application entry | + | The monolith codebase is located in this repository. The main application entry point is at `cmd/ |
| - | point is at `cmd/ | + | |
| - | under the `services/` directory. | + | |
| ### How to Contribute | ### How to Contribute | ||
| - | 1. **Set up your development environment**: | + | 1. **Set up your development environment**: |
| - | | + | 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. |
| - | | + | |
| - | 2. **Find an issue to work on**: Look for open issues in the issue tracker. If | + | |
| - | | + | |
| - | | + | |
| 3. **Create a new branch**: Create a new branch for your changes. | 3. **Create a new branch**: Create a new branch for your changes. | ||
| - | 4. **Write your code**: Make your changes to the codebase, following the | + | 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. | 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 | + | 6. **Submit a pull request**: Once you are happy with your changes, submit a pull request for review. |
| - | | + | |
| ## Point of Contact | ## Point of Contact | ||
| - | If you have any questions or need help with the monolith, please reach out to | + | If you have any questions or need help with the monolith, please reach out to **@diamond**. |
| - | **@diamond**. | + | |