Skip to content

Modernize code style and unify mobile/desktop frontend#3

Open
MatteoFormentin wants to merge 1 commit into
masterfrom
claude/modern-code-style-refactor-gxdnd5
Open

Modernize code style and unify mobile/desktop frontend#3
MatteoFormentin wants to merge 1 commit into
masterfrom
claude/modern-code-style-refactor-gxdnd5

Conversation

@MatteoFormentin

Copy link
Copy Markdown
Owner

Backend:

  • Eliminate implicit globals (db, logger, moment, passport, etc.) across
    the whole src tree in favor of explicit require()s per module
  • Break the database.js/query-module circular dependency by introducing
    database/connection.js as the single source for the raw mysql connection
  • Replace var with const/let, == with ===, string concatenation with
    template literals, and callback-style code with async/await where used
  • Fix bugs surfaced by removing globals and modernizing: broken
    express-validator v7 subpath imports, passport 0.7 req.logout() missing
    callback, undefined id refs in log messages, an always-true array
    comparison in the firmware update check, a dead last_update branch,
    and a fire-before-await ordering bug in firmware update deletion
  • Pin package.json dependencies (was entirely "latest") and drop unused
    packages (async, bluebird, body-parser, debug, dotenv, morgan)

Frontend:

  • Remove express-device and the server-side mobile/desktop template
    split; delete views/mobile and unify each page into a single
    responsive template
  • Rewrite style.css as a small design-token based system (colors,
    cards, nav, forms) applied via layout.pug so it cascades across
    every page
  • Redesign the home page as a responsive station card grid instead of
    a fixed desktop table duplicated for mobile

Verified end-to-end against a real MySQL instance: schema init, admin
seed, login/logout, station CRUD, sensor ingestion, history/map/config
pages.

Backend:
- Eliminate implicit globals (db, logger, moment, passport, etc.) across
  the whole src tree in favor of explicit require()s per module
- Break the database.js/query-module circular dependency by introducing
  database/connection.js as the single source for the raw mysql connection
- Replace var with const/let, == with ===, string concatenation with
  template literals, and callback-style code with async/await where used
- Fix bugs surfaced by removing globals and modernizing: broken
  express-validator v7 subpath imports, passport 0.7 req.logout() missing
  callback, undefined `id` refs in log messages, an always-true array
  comparison in the firmware update check, a dead `last_update` branch,
  and a fire-before-await ordering bug in firmware update deletion
- Pin package.json dependencies (was entirely "latest") and drop unused
  packages (async, bluebird, body-parser, debug, dotenv, morgan)

Frontend:
- Remove express-device and the server-side mobile/desktop template
  split; delete views/mobile and unify each page into a single
  responsive template
- Rewrite style.css as a small design-token based system (colors,
  cards, nav, forms) applied via layout.pug so it cascades across
  every page
- Redesign the home page as a responsive station card grid instead of
  a fixed desktop table duplicated for mobile

Verified end-to-end against a real MySQL instance: schema init, admin
seed, login/logout, station CRUD, sensor ingestion, history/map/config
pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants