diff --git a/.cursor/rules/general.mdc b/.cursor/rules/general.mdc new file mode 100644 index 00000000..7e627f8b --- /dev/null +++ b/.cursor/rules/general.mdc @@ -0,0 +1,33 @@ +--- +description: +globs: +alwaysApply: true +--- +# General + +- Anthias uses Django as the web framework + +# Project Structure + +- [anthias_app](mdc:anthias_app) and [anthias_django](mdc:anthias_django) is where the Django source code lives. +- Django HTML templates live in the [templates](mdc:templates) directory. +- The [static](mdc:static) directory contains static files like HTML, CSS, and JavaScript + files used for the web interface. + - The source code was written in CoffeeScript, which gets transpiled to JavaScript. +- The [webpack.common.js](mdc:webpack.common.js), [webpack.dev.js](mdc:webpack.dev.js), and [webpack.prod.js](mdc:webpack.prod.js) are configuration files + necessary for transpiling CoffeeScript and SCSS source files to JavaScript and CSS files, + respectively. +- This project uses Docker for containerization. + - [docker-compose.yml.tmpl](mdc:docker-compose.yml.tmpl) is used for instances installed on Raspberry Pi and x86 devices + that runs Raspberry Pi OS Lite or Debian. + - [docker-compose.dev.yml](mdc:docker-compose.dev.yml) is used for Anthias in development mode (e.g., in a laptop or + personal computer). + - [docker-compose.balena.yml.tmpl](mdc:docker-compose.balena.yml.tmpl) is used for instances installed on devices that runs + balenaOS. + - The [docker](mdc:docker) directory contains all the necessary Dockerfiles needed by Anthias. +- The [requirements](mdc:requirements) directory contains all the requirements files required by Anthias +- [webview](mdc:webview) contains C++ (Qt) source code necessary for the WebView, which is + a custom-built web browser that makes display of assets (images, videos, or web pages) in + a connected display (like a TV) possible. +- [viewer](mdc:viewer) contains the Python source files used by the viewer service, which is + responsible for driving a screen to display content. diff --git a/.cursor/rules/javascript.mdc b/.cursor/rules/javascript.mdc new file mode 100644 index 00000000..99fb0213 --- /dev/null +++ b/.cursor/rules/javascript.mdc @@ -0,0 +1,10 @@ +--- +description: +globs: +alwaysApply: true +--- +- CoffeeScript is used for front-end code, which gets transpiled to JavaScript. + - See [anthias.coffee](mdc:static/js/anthias.coffee) and [settings.coffee](mdc:static/js/settings.coffee) for details. +- Backbone.js is used as the front-end framework. +- CoffeeScript and Backbone.js will be deprecated in favor of modern frameworks + that are more stable and still maintained. \ No newline at end of file diff --git a/.cursor/rules/python.mdc b/.cursor/rules/python.mdc new file mode 100644 index 00000000..3ca474cf --- /dev/null +++ b/.cursor/rules/python.mdc @@ -0,0 +1,10 @@ +--- +description: +globs: +alwaysApply: true +--- +- Most of Anthias' source code is written in Python. +- Django is used as the web framework. +- [Ruff](mdc:https:/github.com/astral-sh/ruff) is used for linting and formatting Python files. + - See [pyproject.toml](mdc:pyproject.toml) for linting and formatting rules. +- Use [type hints](mdc:https:/docs.python.org/3/library/typing.html) when updating and generating Python files. \ No newline at end of file diff --git a/.cursor/rules/qt.mdc b/.cursor/rules/qt.mdc new file mode 100644 index 00000000..ca05c2a1 --- /dev/null +++ b/.cursor/rules/qt.mdc @@ -0,0 +1,10 @@ +--- +description: +globs: +alwaysApply: true +--- +- The [webview](mdc:webview) consists of purely C++ files. +- The WebView binary used for Raspberry Pi (1 to 4) devices uses Qt 5. +- The WebView binary used for Raspberry Pi 5 and x86 devices uses Qt 6. +- Use C++ macros when updating or generating code so that changes support + both Qt 5 and Qt 6 code. \ No newline at end of file diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index de1639a4..6c9c41aa 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -21,6 +21,7 @@ on: - '!bin/start_development_server.sh' - '!tests/**' - '!docker/Dockerfile.dev' + - '!.cursor/**' jobs: run-tests: diff --git a/.github/workflows/docker-test.yaml b/.github/workflows/docker-test.yaml index dbe653d0..42d66290 100644 --- a/.github/workflows/docker-test.yaml +++ b/.github/workflows/docker-test.yaml @@ -13,6 +13,7 @@ on: - '!.github/workflows/build-webview.yaml' - '!.github/workflows/build-balena-disk-image.yaml' - '!docs/**' + - '!.cursor/**' pull_request: branches: - master @@ -24,6 +25,7 @@ on: - '!.github/workflows/build-webview.yaml' - '!.github/workflows/build-balena-disk-image.yaml' - '!docs/**' + - '!.cursor/**' workflow_call: jobs: diff --git a/.github/workflows/generate-openapi-schema.yml b/.github/workflows/generate-openapi-schema.yml index f6d57d22..5540e6bd 100644 --- a/.github/workflows/generate-openapi-schema.yml +++ b/.github/workflows/generate-openapi-schema.yml @@ -18,6 +18,7 @@ on: - '!bin/install.sh' - '!bin/upgrade_containers.sh' - '!tests/**' + - '!.cursor/**' pull_request: branches: - master @@ -34,6 +35,7 @@ on: - '!bin/install.sh' - '!bin/upgrade_containers.sh' - '!tests/**' + - '!.cursor/**' workflow_call: inputs: release: