Modernize code style and unify mobile/desktop frontend#3
Open
MatteoFormentin wants to merge 1 commit into
Open
Modernize code style and unify mobile/desktop frontend#3MatteoFormentin wants to merge 1 commit into
MatteoFormentin wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend:
the whole src tree in favor of explicit require()s per module
database/connection.js as the single source for the raw mysql connection
template literals, and callback-style code with async/await where used
express-validator v7 subpath imports, passport 0.7 req.logout() missing
callback, undefined
idrefs in log messages, an always-true arraycomparison in the firmware update check, a dead
last_updatebranch,and a fire-before-await ordering bug in firmware update deletion
packages (async, bluebird, body-parser, debug, dotenv, morgan)
Frontend:
split; delete views/mobile and unify each page into a single
responsive template
cards, nav, forms) applied via layout.pug so it cascades across
every page
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.