Skip to content

Code Requirements

Guryash edited this page Jun 14, 2024 · 9 revisions

Code Quality

Code quality is essential for this project, as the people using it wouldn't have worked on it. Hundreds of people will use this website, and the people who will continue working or maintaining it will be different from the people who designed it. We must maintain a high code quality level to ensure this website is easy to work on. We have linting to enforce best practices.

Responsive Design

We aim for a "Mobile-first" approach, meaning that all our UI/UX will be designed for mobile first, then desktop. We expect that when developing each page, resizability is taken into account and tested to make sure it is usable for both mobile and desktop.

Naming Conventions

GitHub Branches

Branches should follow this naming convention: author/category/issue number/issue name author = your name category = feature or test or bugfix or document issue number = issue number that you have been assigned issue name = name of issue you have been assigned

General Naming Information

  • Please use descriptive names
  • Do NOT use the type within the name (eg. nameString is not a good name)
  • Comment your code!
  • No need to comment on every line, just use comments to explain anything that could be misunderstood, most of your code should describe itself

PascalCase

  • Component
  • Interface
  • Type
  • Enum
  • Parameters

camelCase

  • Variable
  • Parameter
  • Function
  • Method

CONSTANT_CASE

  • Global Constant
  • Enum

Testing Conventions

  • Create unit tests for each page as you work on it; make sure all tests pass.
  • Integration tests to be created for workflows

Cyber Security

  • Make sure API keys are hidden
  • Make sure that passwords and banking information is transported safely (Firebase and Stripe JS should handle most of it)
  • Before pushing any password collection or payment information to main branch, it must be approved by two experienced people to make sure that information is handled securely.

Accessability

  • Make sure images have alt text for screen readers
  • Make sure that all text and backgrounds they are placed on have a high contrast ratio for readability for people with colour blindness
  • Make sure all text is at least 16px
  • Make sure all images have a fallback