Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 6 additions & 8 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Is your feature request related to a problem? Please describe.** A clear and concise description
of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe the solution you'd like** A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Describe alternatives you've considered** A clear and concise description of any alternative
solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
**Additional context** Add any other context or screenshots about the feature request here.
13 changes: 5 additions & 8 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
**Describe at a high level the solution you're providing**
A clear and concise description of what you changed.
**Describe at a high level the solution you're providing** A clear and concise description of what
you changed.

**Is this a patch, a minor version change, or a major version change**
Patch, minor, or major.
**Is this a patch, a minor version change, or a major version change** Patch, minor, or major.

**Is this related to an open issue?**
Please provide the link.
**Is this related to an open issue?** Please provide the link.

**Additional context**
Add any other technical detail or considerations here.
**Additional context** Add any other technical detail or considerations here.
44 changes: 44 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Shared Prettier configuration for all Pyrrha projects
// Based on proven Pyrrha-Dashboard configuration
module.exports = {
// Core formatting rules (from Dashboard .prettierrc)
singleQuote: true,
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine

// Additional standardization
semi: true,
trailingComma: 'es5',
printWidth: 80,
tabWidth: 2,
useTabs: false,

// Language-specific overrides
overrides: [
{
files: '*.json',
options: {
printWidth: 120,
},
},
{
files: '*.md',
options: {
printWidth: 100,
proseWrap: 'always',
},
},
{
files: '*.scss',
options: {
singleQuote: false,
},
},
{
files: '*.{js,jsx}',
options: {
singleQuote: true,
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine
},
},
],
};
44 changes: 44 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Shared Prettier configuration for all Pyrrha projects
// Based on proven Pyrrha-Dashboard configuration
module.exports = {
// Core formatting rules (from Dashboard .prettierrc)
singleQuote: true,
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine

// Additional standardization
semi: true,
trailingComma: 'es5',
printWidth: 80,
tabWidth: 2,
useTabs: false,

// Language-specific overrides
overrides: [
{
files: '*.json',
options: {
printWidth: 120,
},
},
{
files: '*.md',
options: {
printWidth: 100,
proseWrap: 'always',
},
},
{
files: '*.scss',
options: {
singleQuote: false,
},
},
{
files: '*.{js,jsx}',
options: {
singleQuote: true,
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine
},
},
],
};
73 changes: 39 additions & 34 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Contributing

When contributing a major change to this repository, please first discuss the change you wish to make via an [issue](contributing/ISSUES.md) or via
[Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack). Minor issues can simply be addressed by sending by a pull request.
When contributing a major change to this repository, please first discuss the change you wish to
make via an [issue](contributing/ISSUES.md) or via
[Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack). Minor issues can simply be
addressed by sending by a pull request.

All [pull requests](contributing/PULL-REQUESTS.md) will require you to ensure the change is certified via the [Developer Certificate of Origin (DCO)](https://github.com/apps/dco/). The DCO is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project.
All [pull requests](contributing/PULL-REQUESTS.md) will require you to ensure the change is
certified via the [Developer Certificate of Origin (DCO)](https://github.com/apps/dco/). The DCO is
a lightweight way for contributors to certify that they wrote or otherwise have the right to submit
the code they are contributing to the project.

Please note we have a [Code of Conduct](#code-of-conduct), please follow it in all your interactions with the project and its community.
Please note we have a [Code of Conduct](#code-of-conduct), please follow it in all your interactions
with the project and its community.

## Pull Request Process

Expand All @@ -19,14 +25,14 @@ Please note we have a [Code of Conduct](#code-of-conduct), please follow it in a

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers
pledge to making participation in our project and our community a harassment-free experience for
everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level
of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:
Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
Expand All @@ -36,50 +42,49 @@ include:

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
- Publishing others' private information, such as a physical or electronic address, without explicit
permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers are responsible for clarifying the standards of acceptable behavior and are
expected to take appropriate and fair corrective action in response to any instances of unacceptable
behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
This Code of Conduct applies both within project spaces and in public spaces when an individual is
representing the project or its community. Examples of representing a project or community include
using an official project e-mail address, posting via an official social media account, or acting as
an appointed representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team on [Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack).
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
the project team on [Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack).

All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.Further details of specific enforcement policies may be posted separately.
All complaints will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident.Further details of specific enforcement
policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
temporary or permanent repercussions as determined by other members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
[http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Pyrrha website - pyrrha-platform.org

[![License](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Slack](https://img.shields.io/static/v1?label=Slack&message=%23prometeo-pyrrha&color=blue)](https://callforcode.org/slack)
[![License](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Slack](https://img.shields.io/static/v1?label=Slack&message=%23prometeo-pyrrha&color=blue)](https://callforcode.org/slack)

This is the pyrrha-platform.org website code. It's based on the Carbon Design System and React.

Expand All @@ -27,7 +28,8 @@ You will also see any lint errors in the console.
### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests)
for more information.

### `yarn build`

Expand All @@ -39,11 +41,13 @@ Your app is ready to be deployed!

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting Pyrrha pull requests.
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process
for submitting Pyrrha pull requests.

### Submitting pull requests for the website

Please send pull requests against the `main` branch. Changes will then automatically be deployed to the `gh-pages` branch by a GitHub action.
Please send pull requests against the `main` branch. Changes will then automatically be deployed to
the `gh-pages` branch by a GitHub action.

## License

Expand Down
116 changes: 116 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// Shared ESLint configuration for all Pyrrha JavaScript/React projects
import js from '@eslint/js';
import globals from 'globals';
import prettier from 'eslint-config-prettier';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import jest from 'eslint-plugin-jest';
import testingLibrary from 'eslint-plugin-testing-library';
import jestDom from 'eslint-plugin-jest-dom';

export default [

Check warning on line 11 in eslint.config.js

View workflow job for this annotation

GitHub Actions / lint

Assign array to a variable before exporting as module default

Check warning on line 11 in eslint.config.js

View workflow job for this annotation

GitHub Actions / lint

Assign array to a variable before exporting as module default
js.configs.recommended,
prettier,

{
ignores: [
'**/node_modules/**',
'**/build/**',
'**/dist/**',
'**/coverage/**',
'**/venv/**',
'**/.git/**',
],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
// Core JavaScript rules
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': 'off', // Allow console for server-side logging
'prefer-const': 'error',
eqeqeq: 'error',
'no-var': 'error',
'no-duplicate-imports': 'error',
'no-unreachable': 'error',
},
},

// CommonJS files (require/module.exports)
{
files: ['**/*.cjs', '**/check-workspace.js'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'commonjs',
globals: { ...globals.node },
},
rules: {
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': 'off',
'prefer-const': 'error',
},
},

// Node.js server files (API backends, MQTT client, WebSocket server)
{
files: [
'**/server.js',
'**/api.py', // Flask entry points
'**/mqttclient.js',
'**/logger.js',
'api-auth/**/*.js',
'api-main/**/*.py',
],
languageOptions: {
globals: { ...globals.node },
},
rules: {
'no-process-exit': 'warn',
},
},

// React frontend files
{
files: ['src/**/*.{js,jsx,ts,tsx}'],
plugins: {
react,
'react-hooks': reactHooks,
},
languageOptions: {
globals: { ...globals.browser },
parserOptions: { ecmaFeatures: { jsx: true } },
},
settings: {
react: { version: 'detect' },
},
rules: {
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'warn',
},
},

// Test files
{
files: [
'**/__tests__/**/*.{js,jsx,ts,tsx}',
'**/*.{test,spec}.{js,jsx,ts,tsx}',
'**/test/**/*.js',
],
plugins: {
jest,
'testing-library': testingLibrary,
'jest-dom': jestDom,
},
languageOptions: {
globals: { ...globals.jest, ...globals.browser },
},
rules: {
...jest.configs.recommended.rules,
...testingLibrary.configs['react'].rules,
...jestDom.configs.recommended.rules,
},
},
];
Loading