Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3c9403e
fix readme
gwill1337 Jul 28, 2026
bb632fe
Added api versioning
gwill1337 Jul 29, 2026
de58703
added pre commit
gwill1337 Jul 29, 2026
f0ad88a
added contributing.md
gwill1337 Jul 29, 2026
f2702cc
enhanced frontend and added new page
gwill1337 Aug 27, 2026
1e985b3
added scripts for deploying and docker-compose files
gwill1337 Aug 27, 2026
7c15dc0
cleared comments
gwill1337 Aug 27, 2026
0e3bcbc
dev update
gwill1337 Aug 28, 2026
162f312
frontend update
gwill1337 Aug 28, 2026
7301117
API update
gwill1337 Aug 28, 2026
37c6b3b
fix mypy
gwill1337 Aug 28, 2026
6903b0d
fix
gwill1337 Aug 28, 2026
6c8f9d2
tests update
gwill1337 Aug 28, 2026
97b0bd4
Rename dockerfile.celery to Dockerfile.celery
gwill1337 Aug 28, 2026
bb528ba
Rename dockerfile.fastapi to Dockerfile.fastapi
gwill1337 Aug 28, 2026
a06d673
Rename dockerfile.react to Dockerfile.react
gwill1337 Aug 28, 2026
3f3bee1
fix Dockerfile.fastapi
gwill1337 Aug 28, 2026
d08ba73
Merge branch 'dev' of https://github.com/gwill1337/MONA into dev
gwill1337 Aug 28, 2026
706619e
fix
gwill1337 Aug 28, 2026
989ee4d
fix
gwill1337 Aug 28, 2026
bcde074
fix
gwill1337 Aug 28, 2026
42a3c25
fix
gwill1337 Aug 28, 2026
dc67921
fix
gwill1337 Aug 28, 2026
3dc1448
fix
gwill1337 Aug 28, 2026
a4e543c
fix
gwill1337 Aug 28, 2026
50d0677
fix
gwill1337 Aug 28, 2026
fdfab29
fix
gwill1337 Aug 28, 2026
669af14
fix
gwill1337 Aug 28, 2026
8121c52
fix
gwill1337 Aug 28, 2026
3727a9e
fix
gwill1337 Aug 28, 2026
42a0028
readme update
gwill1337 Aug 31, 2026
00a1820
docker compose fix
gwill1337 Aug 31, 2026
2730bf6
tests update
gwill1337 Aug 31, 2026
0e724aa
logger update
gwill1337 Sep 8, 2026
b5c078f
tests update
gwill1337 Sep 8, 2026
e248a43
update changelog
gwill1337 Sep 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ conftest.py
**/terraform.tfvars*
**/*.tfvars
**/.env
**/.env.dev
dev/.env.dev

deploy.ps1
Makefile
Expand All @@ -49,4 +51,4 @@ tfplan
kube_prom_matches.txt
kube_prom_values.txt
loki_stack_matches.txt
loki_stack_values.txt
loki_stack_values.txt
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ jobs:

- name: Build Docker images
run: |
docker build -f docker/dockerfile.celery -t local/celery:test .
docker build -f docker/dockerfile.fastapi -t local/fastapi:test .
docker build -f docker/dockerfile.react -t local/react:test .
docker build -f docker/Dockerfile.celery -t local/celery:test .
docker build -f docker/Dockerfile.fastapi -t local/fastapi:test .
docker build -f docker/Dockerfile.react -t local/react:test .

- name: Scan FastAPI image with Trivy
uses: aquasecurity/trivy-action@master
Expand All @@ -144,6 +144,7 @@ jobs:
exit-code: '1'
ignore-unfixed: true
severity: 'CRITICAL,HIGH'
skip-files: '**/pip/_vendor/bom.cdx.json'

- name: Scan Celery image with Trivy
uses: aquasecurity/trivy-action@master
Expand All @@ -153,6 +154,7 @@ jobs:
exit-code: '1'
ignore-unfixed: true
severity: 'CRITICAL,HIGH'
skip-files: '**/pip/_vendor/bom.cdx.json'

- name: Scan React image with Trivy
uses: aquasecurity/trivy-action@master
Expand All @@ -161,4 +163,4 @@ jobs:
format: 'table'
exit-code: '1'
ignore-unfixed: true
severity: 'CRITICAL,HIGH'
severity: 'CRITICAL,HIGH'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ __pycache__/
.env
venv/
.venv/
**/.env.dev
dev/.env.dev

# OS
.DS_Store
Expand Down
70 changes: 70 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
default_install_hook_types: [pre-commit, pre-push]

repos:
# =========================================================================
# 1. git commit
# =========================================================================

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.0
hooks:
- id: ruff
args: [--fix]
files: ^mona_core/
stages: [pre-commit]
- id: ruff-format
files: ^mona_core/
stages: [pre-commit]

- repo: https://github.com/adrienverge/yamllint
rev: v1.38.0
hooks:
- id: yamllint
args: [-c, .yamllint.yaml]
stages: [pre-commit]

- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
stages: [pre-commit]

- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.108.1
hooks:
- id: terraform_fmt
stages: [pre-commit]

# =========================================================================
# 2. git push
# =========================================================================

- repo: local
hooks:
- id: mypy
name: Mypy type check (uv)
entry: uv run mypy mona_core/
language: system
pass_filenames: false
stages: [pre-push]

- id: pytest
name: Pytest (uv)
entry: uv run pytest tests/
language: system
pass_filenames: false
stages: [pre-push]

- id: terraform-validate
name: Terraform validate
entry: bash -c "cd terraform && terraform init -backend=false && terraform validate"
language: system
pass_filenames: false
stages: [pre-push]

- id: helm-lint
name: Helm lint
entry: helm lint ./mona-chart
language: system
pass_filenames: false
stages: [pre-push]
17 changes: 17 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends: default

ignore: |
mona-chart/templates/
.github/workflows/

rules:
line-length:
max: 200
braces:
min-spaces-inside: 0
max-spaces-inside: 1
document-start: disable
new-line-at-end-of-file: disable
new-lines: disable
trailing-spaces: disable
comments-indentation: disable
34 changes: 30 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
# CHANGELOG

All notable changes to this project will be documented in this file.
## [v0.7.0] - 2026-09-14 - Major update
### Added
- backend: Added API versioning except probes and prometheus endpoints.
- backend: Added return type annotations to API endpoints.
- backend: Added Pydantic schemes in response model for each enpoints except probes and prometheus endpoints.
- backend: Added formatter for HTTPExceptions like [MessageResponse]()
- backend: Added manual CRUD user for admins.
- backend: Added pagination for devices[GET] endpoint.
- backend: Added redis to health probe.
- backend: Added CRUD for users.
- backend: Added `docker-compose.dev.yml` for development.
- backend: Added `docker-compose.prod.yml` as second way to setup MONA.
- bachend: Added logger.
- bachend: Added formatter for logger.
- frontend: Added page `userboard`.
- frontend: Added config with `API_URL` and `API_VERSION`.
- frontend: Added formatter for `status codes` and `error` into `apiFetch`.

### Changed
- backend: Moved to `uv sync` & `uv lock` from `pip install` in docker images.
- backend: Moved to `httpx2` from `requests`.
- frontend: Split Dashboard.tsx and DeviceAdmin.tsx to components.
- frontend: Split endpoints to folder routes on backend.
- frontend: Moved to axios from fetch.
- frontend: Moved API versioning to custom `apiFetch` on frontend.

## [v0.6.0] - 2026-07-28 - Security update
### Added
- Added limiter for login
- Added config for .env
- Added security checks into CI pipeline
- Added tests for limiter
- Added limiter for login.
- Added config via pydantic-settings.
- Added security checks into CI pipeline.
- Added tests for limiter.

### Changed
- Changed docker images from docker hub to local
Expand Down
76 changes: 76 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributing to MONA

Thank you for considering contributing to MONA! This document provides guidelines and instructions for contributing code, reporting issues, and setting up your local development environment.

---

## Local Development Setup
Requirements:
* **Python 3.13+**
* [**uv**](https://github.com/astral-sh/uv) for packages
* **Docker Desktop** / **kind** / **helm** / **Terraform** for IaC


### 1. Clone the repository
```bash
git clone [https://github.com/gwill1337/MONA.git](https://github.com/gwill1337/MONA.git)
cd MONA
```

### 2. Install dependencies
```bash
uv sync --frozen --group dev
```

### 3. Set up pre-commit & pre-push hooks
```
uv run pre-commit install --hook-type pre-commit --hook-type pre-push
```


## Running Checks Manually
```bash
# Run pre-commit checks on all files
uv run pre-commit run --hook-stage pre-commit --all-files

# Run pre-push checks (Mypy & Pytest)
uv run pre-commit run --hook-stage pre-push --all-files

# Run tests directly with pytest
uv run pytest tests/
```

## MONA's dev build
For fust testing and preview use `docker-compose.dev.yml` with `Dockerfile.dev` and `.env.dev`
```bash
docker compose -p mona-dev --env-file dev/.env.dev -f dev/docker-compose.dev.yml up -d --build
```

## Workflow & Branching
### 1. Fork or Create a Branch
Always create a descriptive feature branch off the dev branch:
```bash
git checkout dev
git pull origin dev
git checkout -b feature/short-description
# or
git checkout -b fix/short-description
```
### 2. Commit Guidelines
* Keep commits atomic and focused.
* Write clear and concise commit messages.
* Do not use `--no-verify` to bypass Git hooks unless absolutely necessary.

### 3. Submitting a Pull Request (PR)
* Push your branch to GitHub and open a PR targeting the `dev` branch.
* Provide a concise description of your changes and reference any related issues.
* Ensure all automated GitHub Actions CI checks pass (Gitleaks, Checkov, Ruff, Mypy, Pytest, Docker Trivy scan).

## Coding Standards & Linting
* **Python:** Core code (`mona_core/`) must strictly pass `Ruff` (linting & formatting) and `Mypy` type checks. Test files are exempt from strict Ruff rules (e.g., `assert` statements).
* **Infrastructure:** Ensure Terraform files are formatted using `terraform fmt` and Helm charts pass `helm lint`.
* **Security:** Never commit real API keys, passwords, or secrets. `Gitleaks` will reject commits with hardcoded credentials.

## Reporting Bugs & Requesting Features
* Use **GitHub Issues** to report bugs or request new features.
* Include reproduction steps, environment details (OS, Docker version, etc.), and relevant logs when reporting bugs.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ help:

build:
@echo "=== Building Docker images ==="
docker build -t mona-fastapi:local -f ./docker/dockerfile.fastapi .
docker build -t mona-react:local -f ./docker/dockerfile.react .
docker build -t mona-celery:local -f ./docker/dockerfile.celery .
docker build -t mona-fastapi:local -f ./docker/Dockerfile.fastapi .
docker build -t mona-react:local -f ./docker/Dockerfile.react .
docker build -t mona-celery:local -f ./docker/Dockerfile.celery .

deploy:
@echo "=== Deploying infrastructure (Terraform) ==="
helm repo update
terraform -chdir=terraform init
terraform -chdir=terraform apply -auto-approve

Expand Down
Loading
Loading