Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ec7db3d
VID/PID Checking frame sync board SVC Pro
brandonhs Mar 24, 2026
17ca21e
[WIP] NetworkManager changes
brandonhs Mar 25, 2026
caa04e3
[WIP] Broken - Logic for new network manager system but endpoints are…
brandonhs Mar 25, 2026
f02a903
Add interface selecting
brandonhs Mar 26, 2026
78a5eb0
[WIP] Refactor state management and disable auto-reconnect
brandonhs Mar 27, 2026
cc4c72f
[WIP] Improve how compatible profiles are handled
brandonhs Mar 27, 2026
4fca622
[WIP] NetworkManager: Update architecture to separate profiles from d…
brandonhs Mar 31, 2026
075f195
[WIP] NetworkManager - Begin UI modifications and API integration for…
brandonhs Mar 31, 2026
5a2dbbb
[WIP] Add wired configuration frontend
brandonhs Apr 2, 2026
d8fd60c
[WIP] Fix silent backend crash and add live updates
brandonhs Apr 2, 2026
ba91604
MVP: Add UI changes to emit POST requests and update backend to allow…
brandonhs Apr 3, 2026
5bd4132
Add version label
brandonhs Apr 4, 2026
3f5b374
Add rollback to DHCP on connection failure
brandonhs Apr 4, 2026
26d8389
Add empty wireless config and fix minor state enum bug
brandonhs Apr 7, 2026
fe88e00
Add new VID PID
brandonhs Mar 19, 2026
a5263ac
Add changes for hardware bitrate control
brandonhs Mar 25, 2026
837b99d
Remove videos from release
brandonhs Apr 10, 2026
bd88495
Add local install option to improve development time
brandonhs Apr 10, 2026
87826a0
Remove unused legacy code and fix linting issues
brandonhs Apr 10, 2026
554b6ae
Add polling to improve performance for synchronized streaming
brandonhs Apr 10, 2026
fc04d28
Change version to 0.6.0-dev
brandonhs Apr 10, 2026
44cce77
Add keyboard controls for RangeControl component
brandonhs Apr 10, 2026
41e37bb
Fix linting issues with recordings.tsx
brandonhs Apr 11, 2026
e65c57e
Update PR template to decrease verbosity and thus increase adoption
brandonhs Apr 11, 2026
267d3ae
Remove forums from config.yml
brandonhs Apr 11, 2026
d347e95
Fix linting warnings and errors in frontend
brandonhs Apr 11, 2026
17cdac8
Fix typing issues
brandonhs Apr 11, 2026
a73f536
Add backend & frontend CI/CD pipeline
brandonhs Apr 11, 2026
bc1ba33
Change working directory for backend & frontend CI
brandonhs Apr 11, 2026
f4bc2dd
Update cache dependency-path for frontend CI
brandonhs Apr 11, 2026
1b801ba
Change backend.yml to ubuntu-22.04
brandonhs Apr 11, 2026
0c89eaf
Merge branch 'feature/ci-cd-linting' into refactor/network-manager
brandonhs Apr 11, 2026
1d93025
Merge pull request #495 from DeepWaterExploration/refactor/network-ma…
brandonhs Apr 11, 2026
4b5ea9e
Add ruff formatting
brandonhs Apr 11, 2026
707b998
Fix import errors in preferences.tsx caused by merge
brandonhs Apr 11, 2026
a398f8d
Remove all wildcard imports for ruff linter
brandonhs Apr 11, 2026
cc588a5
Remove lru_cache from recordings and replace with a proper caching sy…
brandonhs Apr 11, 2026
753a814
Refactor imports across multiple files to improve organization and ad…
brandonhs Apr 11, 2026
b162a3f
Add proper shutdown functionality and change line length to 88. Refac…
brandonhs Apr 11, 2026
5b9b264
Remove dead code
brandonhs Apr 11, 2026
e558a50
Fix typing for function that will never return None
brandonhs Apr 11, 2026
c5cfb3c
Correct serial PWM connection logic
brandonhs Apr 11, 2026
3d4345b
Remove unused import
brandonhs Apr 11, 2026
a5eb05d
Fix frontend linting issues
brandonhs Apr 11, 2026
a91a907
Remove CI runs on push or PR to branches other than main
brandonhs Apr 11, 2026
4e433b8
Refactor usage of SerialPWMController to satisfy linting requirements…
brandonhs Apr 13, 2026
ce2937f
Add type checking with ty
brandonhs Apr 13, 2026
b8bdea0
Fix linting issues with ty and bandit
brandonhs Apr 13, 2026
4e44bc1
Add dbus apt dependencies
brandonhs Apr 13, 2026
73c5eae
Add sudo to apt-get
brandonhs Apr 13, 2026
6203e0d
Remove unused type: ignore
brandonhs Apr 13, 2026
7534b06
Require and add return type annotation
brandonhs Apr 14, 2026
b19ed45
Improve annotations across multiple files and introduce SimpleRequest…
brandonhs Apr 15, 2026
8e80859
Switch to sonner from toast
brandonhs Apr 16, 2026
f247a5c
Fix toast issues
brandonhs Apr 16, 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
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ contact_links:
- name: 📚 Documentation
url: https://docs.dwe.ai/
about: View our Setup Documentation
- name: 💬 Community Forums
url: https://discuss.dwe.ai/
about: Join our Forums to ask questions and get help!
43 changes: 14 additions & 29 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
# Description
## Summary

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
[Explain the *what* and *why* of this PR.]

Fixes #[insert issue number(s) here]
Fixes #[issue number(s) here]

## Type of change

Please select all that apply.
- [ ] Bug fix
- [ ] Feature / Refactor
- [ ] Breaking change
- [ ] Misc.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Other: [describe here]
## Quick Checklist

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Make sure code runs/builds on Linux **[REQUIRED]**
- [ ] Code produces no console errors upon launching the software
- [ ] Other (add any other tests run)

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have added 1 or more reviewers to my pull request
- [ ] Reviewer has run the above tests to verify
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] Myself or a reviewer has tested my code to prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes (if applicable)
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have reviewed my own code.
- [ ] I have tested these changes locally.
- [ ] I have tested these changes on the following platforms (optional):
- [ ] SVC
- [ ] microSVC (optional)
- [ ] SVC Pro
51 changes: 51 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Backend CI

on:
# Commented to avoid double runs
push:
branches:
- main
# - "feature/**"
# - "fix/**"
# - "bugfix/**"
# - "refactor/**"
# paths:
# - backend_py/**
# - ".github/workflows/backend.yml"
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-22.04

defaults:
run:
working-directory: ./backend_py

steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: | # TODO: switch to using proper dev dependencies
sudo apt-get install build-essential libdbus-glib-1-dev libdbus-1-dev libpython3-dev -y # For dbus-python
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff bandit ty # dev dependencies

- name: Ruff linting
run: ruff check --output-format=github .

- name: Ruff formatting
run: ruff format --check .

- name: Bandit security check (high severity)
run: bandit -r . -lll

- name: Type checking (ty)
run: ty check
47 changes: 47 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Frontend CI

on:
# Commented to avoid double runs
push:
branches:
- main
# - "feature/**"
# - "fix/**"
# - "bugfix/**"
# - "refactor/**"
# paths:
# - frontend/**
# - ".github/workflows/frontend.yml"
pull_request:
branches: ["main"]

jobs:
Frontend:
runs-on: ubuntu-22.04

defaults:
run:
working-directory: ./frontend

steps:
- name: "Checkout code"
uses: actions/checkout@v6

- name: "Set up Node.js"
uses: actions/setup-node@v6
with:
node-version: "22"
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"

- name: "Install frontend dependencies"
run: npm ci

- name: "Run frontend linting"
run: npm run lint

- name: "Security audit"
run: npm audit --audit-level=high

- name: "Build frontend"
run: npm run build
File renamed without changes.
27 changes: 27 additions & 0 deletions backend_py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tool.ruff]
line-length = 88
indent-width = 4
exclude = ["v4l2.py"] # exclude v4l2.py, since it's included as a lib directly

[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
"ANN2",
]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"

[tool.ty.rules]
39 changes: 25 additions & 14 deletions backend_py/run.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
# run.py runs the backend, creating a async socketio server and a FastAPI web framework, then
# both are passed into a Server instance to handle logic, and a combination of the two is hosted
# as a uvicorn server, which handles traffic
# run.py runs the backend, creating a async socketio server and a FastAPI web
# framework, then
# both are passed into a Server instance to handle logic, and a combination of the
# two is hosted as a uvicorn server, which handles traffic

import asyncio
import logging
from contextlib import asynccontextmanager

from src import Server, FeatureSupport
import socketio
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import asyncio
from contextlib import asynccontextmanager
import logging

from src import FeatureSupport, Server

# TODO: narrow
ORIGINS = ["*"]

# Use AsyncServer
sio = socketio.AsyncServer(
cors_allowed_origins='*', async_mode="asgi", transports=["websocket"]
cors_allowed_origins="*", async_mode="asgi", transports=["websocket"]
)


# Define events
@asynccontextmanager
async def lifespan(app: FastAPI):
server.serve()
async def lifespan(app: FastAPI): # noqa: ANN201
await server.serve()
yield
print("Shutting down server...")
try:
server.shutdown()
except Exception as e:
print(f"Error during shutdown: {e}")


# FastAPI application
Expand All @@ -44,7 +51,12 @@ async def lifespan(app: FastAPI):
# Server instance
# server = Server(FeatureSupport.none(), sio, app, settings_path='.')
server = Server(
FeatureSupport(ttyd=True, wifi=True, serial=True), sio, app, settings_path=".", log_level=logging.DEBUG, is_dev_mode=True
FeatureSupport(ttyd=True, wifi=True, serial=True),
sio,
app,
settings_path=".",
log_level=logging.DEBUG,
is_dev_mode=True,
)

# Combine FastAPI and Socket.IO ASGI apps
Expand All @@ -54,9 +66,8 @@ async def lifespan(app: FastAPI):
if __name__ == "__main__":
import uvicorn

async def main():
config = uvicorn.Config(app, host="0.0.0.0",
port=5000, log_level="warning")
async def main() -> None:
config = uvicorn.Config(app, host="0.0.0.0", port=5000, log_level="warning")
server = uvicorn.Server(config)
await server.serve()

Expand Down
4 changes: 3 additions & 1 deletion backend_py/src/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .server import *
from .server import FeatureSupport, Server

__all__ = ["Server", "FeatureSupport"]
6 changes: 4 additions & 2 deletions backend_py/src/logging/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .log_handler import *
from .log_schemas import *
from .log_handler import LogHandler
from .log_schemas import LogSchema

__all__ = ["LogHandler", "LogSchema"]
16 changes: 6 additions & 10 deletions backend_py/src/logging/log_handler.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import logging

import socketio
from typing import List

from .log_schemas import LogSchema
import datetime


class LogHandler(logging.Handler):
def __init__(self, sio: socketio.AsyncServer, level: int | str = 0) -> None:
super().__init__(level)
self.sio = sio
self.logs: List[LogSchema] = []
self.to_emit: List[LogSchema] = []
self.file_path = self._create_path()

def _create_path(self):
datetime.datetime.now().strftime("%Y-%m-%d--%H-%M-%S.log")
self.logs: list[LogSchema] = []
self.to_emit: list[LogSchema] = []

def pop_logs(self):
def pop_logs(self) -> list[LogSchema]:
logs = self.to_emit
self.to_emit = []
return logs

def emit(self, record):
def emit(self, record) -> None:
log = {
"timestamp": record.asctime,
"level": record.levelname,
Expand Down
3 changes: 2 additions & 1 deletion backend_py/src/logging/log_schemas.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from pydantic import BaseModel


class LogSchema(BaseModel):
timestamp: str
level: str
name: str
filename: str
lineno: int
function: str
message: str
message: str
28 changes: 19 additions & 9 deletions backend_py/src/routes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
from .cameras import *
from .lights import *
from .logs import *
from .preferences import *
from .wifi import *
from .system import *
from .wired import *
from .recordings import *
from .pwm import *
from .cameras import camera_router
from .lights import lights_router
from .logs import logs_router
from .network import network_router
from .preferences import preferences_router
from .pwm import pwm_router
from .recordings import recordings_router
from .system import system_router

__all__ = [
"camera_router",
"lights_router",
"logs_router",
"preferences_router",
"system_router",
"recordings_router",
"pwm_router",
"network_router",
]
Loading
Loading