Repository navigation
feat(app): show store profile and Devkind credit on the home page - #5
Merged
Merged
Conversation
Replace the placeholder "example protected API call + server time" with a meaningful embedded-app landing page. - GET /api/example returns the authenticated shop's profile (name, domain, plan, owner, contact, locale, install date) via a projected query, instead of echoing shopId and server time. The query stays inline in the handler to match the data-access idiom used everywhere else in this starter (shopAuth, install, uninstall); adding a repository layer for one route would be the only such abstraction in the codebase. - Populate the shop `plan` column from Shopify's shop.json (plan_display_name) during the install hook. The column existed but was never written, so the profile always reported the plan as unset. - Home renders a store identity card (avatar, name, myshopify domain, install status badge) with a details list, plus a separate "Built by Devkind" card linking to devkind.com.au and the source repo. - Widen the integration-test DB stand-in to seed a full profile row and assert the new response shape. - Teach eslint that Polaris <Link> carries its href in the `url` prop (jsx-a11y/anchor-is-valid specialLink) - the first Link use in web/.
Collaborator
Author
There was a problem hiding this comment.
The query is inlined in the route handler by design, segregating it out of route file would create inconsistency with the established pattern.
Collaborator
Author
There was a problem hiding this comment.
UI decisions are grounded in Polaris guidelines, not guesswork: card padding via sectioned, and the divider was dropped per Polaris' own "avoid divider lines outside data tables, use weight and spacing for hierarchy".
Uzair-Ahmed-Dahraj
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reviewed.
- Inline query is intentional: matches shopAuth/install/uninstall. No repo layer = no inconsistency.
- Projection hides internal columns.
planwas never written (always "Not set"); now populated from shop.json on install.- Card padding + no divider per Polaris guidelines.
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.
What
Replaces the placeholder home page ("Example protected API call" + server time) with a meaningful embedded-app landing page for the starter, and makes
GET /api/examplereturn the authenticated shop's profile.Why
The starter's first-run screen should demonstrate the protected-route pattern doing something real, not echo an internal
shopIdand a timestamp. This gives new users a proper reference for reading shop data end to end (session token torequireShopto a projected query to a Polaris UI).Changes
GET /api/examplereturns the shop's profile (name, domain, plan, owner, contact, locale, install date) via a deliberately projectedselect, so internal columns never leak into the response.install.tsnow populates theplancolumn from Shopify'sshop.json(plan_display_name). The column existed in the schema but was never written by any code path, so the profile always reported the plan as unset.web/Pages/Home.tsxrenders a store identity card (avatar, name, myshopify domain, install-status badge) with a details list, plus a separate "Built by Devkind" card linking to devkind.com.au and the source. Loading spinner and error Banner preserved.jsx-a11y/anchor-is-validthat Polaris<Link>carries its href in theurlprop (this is the firstLinkusage inweb/).Note on the query living in the route handler
The Drizzle query sits inline in the handler by design, not as a shortcut. Every data-access site in this starter follows the same idiom (
createDb(...)then a projected.select().from().where().get()): theshopAuthmiddleware, and theinstall/uninstalllifecycle hooks. There is no repository or service layer anywhere in the codebase. Introducing one for this single endpoint would make it the only route that reads data differently, trading an established, consistent convention for a speculative abstraction. Keeping it inline keeps the read path uniform and easy to follow; the projection already handles the one real concern (not exposing internal columns).Verification
tsc --noEmitcleanvitest run- 20/20 passeslint webcleanvite buildcleanTesting note
planpopulates on install. Shops installed before this change carryplan = nulluntil their next reinstall (which re-runs the install hook and theshop.jsonfetch).