Skip to content

wp777/stv-web

Repository files navigation

STV Web

This project contains STV web interface.

UI development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

This mode is intended for UI development purposes only. stv-server is not available in this mode and therefore no server-side computations are available.

Build and full development server

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

In this mode stv-server is available (it has to be started separately). Use ng build --watch to enable automatic rebuild on source code changes.

Coding guidelines

  1. Don't commit code that does not compile.
  2. Commits must contain a short message that describes changes.
  3. Commits should be reasonably small.
  4. Always review changes before commiting. VS Code has a great diff viewer available under Ctrl+Shift+G G shortcut.
  5. Don't commit dead code (commented out code, if (false) {...} etc.).
  6. Use const instead of let whenever possible. Avoid var.
  7. Naming: use CamelCase for classes and camelCase for variables/methods. Use English. Names should be descriptive. For example use variable name firstRenderTimestampMs rather than t0.
  8. Indentation: use 4 spaces to keep the code readable. Keep current indentation in lines that contain no code.
  9. Strings:
    • For single-line strings without embedded expressions use double quotation marks: ". Example:
      container.classList.add("withStateLabels"`);
    • For multi-line strings and template literals use backticks: `. Examples:
      container.classList.add(`splitter-${orientation}`);
      const html = `
          <div>
              <stv-example></stv-example>
          </div>
      `;
  10. Use semicolons.
  11. Use spaces around operators. Bad example: 1/1.2. Good example: 1 / 1.2.
  12. Always use braces and put returns in separate lines:
    if (...) {
        return;
    }
  13. If-elseIf-else:
    if (...) {
        ...
    }
    else if (...) {
        ...
    }
    else {
        ...
    }
  14. "Todo" comments:
    • // @todo short description
    • // @todo XY short description where XY should be replaced by initials of the person that is expected to address the issue.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •