Skip to content

[Dashboard] - Refactor Project Structure - #3392

Merged
KirillKirill merged 29 commits into
developfrom
kb/refactor-structure-dashboard
Jun 24, 2025
Merged

[Dashboard] - Refactor Project Structure#3392
KirillKirill merged 29 commits into
developfrom
kb/refactor-structure-dashboard

Conversation

@KirillKirill

@KirillKirill KirillKirill commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

Issue tracking

Not ticketed

Context behind the change

We wanted to rewrite the project using some established solution for architecture in order to make the app's code better.
The Feature Sliced Design fits in well for the app. You can read about this architecture here.
Now we have a feature oriented structure of the project, where an each meaningful feature absorbs all the necessary assets around itself and make the structure more clear and straightforward.
The components/helpers that are supposed to be reused across the app are now located in the shared directory.
Each page looks like a high level constructor, that only imports a linked feature and UI widgets.

Other changes:

  • added tsc check to lint script and pre-commit hook
  • removed a lot of assets, that are never used anymore (mostly chain icons), and removed svgr package
  • used export default, if it's possible (almost always)
  • used camelCase instead of kebab-case
  • refactored query hooks such, that they don't depend on zustand store
  • created usePagination hook for the tables within the search feature

A comparison of previous structure and current:

Before After
img img

How has this been tested?

Locally; I've made sure the functionality remains intact

Release plan

regular plan

Potential risks; What to monitor; Rollback plan

I only might've missed something that stoped working after restructuring

@vercel

vercel Bot commented Jun 13, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
human-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 9:41am
human-dashboard-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 9:41am
staking-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 9:41am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
faucet-frontend ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2025 9:41am
faucet-server ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2025 9:41am

@vercel
vercel Bot temporarily deployed to Preview – human-app June 18, 2025 10:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – staking-dashboard June 18, 2025 10:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – staking-dashboard June 18, 2025 10:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – human-app June 18, 2025 10:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – staking-dashboard June 20, 2025 12:53 Inactive
@vercel
vercel Bot temporarily deployed to Preview – human-app June 20, 2025 12:53 Inactive
@KirillKirill
KirillKirill marked this pull request as ready for review June 23, 2025 09:49
@KirillKirill
KirillKirill requested a review from dnechay June 23, 2025 09:50

@dnechay dnechay left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Some suggestions:

  1. Maybe we move shared/lib/env to shared/config/env? We don't have some utilities for env, just config parsing and validation, so it feels more natural to look for it in some env or config path, rather than lib
  2. I'm not entirely sure about removing index.ts files in places like shared/lib. The only benefit I see (but might miss something) of having libs as "one-per-file" and importing them directly is tree-shaking, but in this particular case it looks like we use majority of them altogether, so there will be no practical improvement. Anyway, we can keep such approach for shared libs and group them later for better structure (e.g. import formatHmtDecimals from shared/lib/formatters/hmtDecimals), but keep index.ts files for libs in features, because it's supposed to load altogether (features/graph as for example)
  3. Not related to this PR, but in general: maybe in future we get id of extra requests for getting lastPageIndex and change API to return hasMore: boolean, just as an idea

Comment thread packages/apps/dashboard/client/package.json Outdated
Comment thread packages/apps/dashboard/client/package.json Outdated
Comment thread packages/apps/dashboard/client/.lintstagedrc.js Outdated
Comment thread packages/apps/dashboard/client/src/app/index.tsx Outdated
Comment thread packages/apps/dashboard/client/src/shared/ui/FormatNumber/index.tsx Outdated
Comment thread packages/apps/dashboard/client/src/shared/api/useHmtPrice.ts Outdated
Comment thread packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx Outdated
Comment thread packages/apps/dashboard/client/src/features/searchResults/ui/WalletAddress.tsx Outdated
…NumericFormat package; update imports to be relative
@KirillKirill
KirillKirill merged commit 9f869bd into develop Jun 24, 2025
7 checks passed
@KirillKirill
KirillKirill deleted the kb/refactor-structure-dashboard branch June 24, 2025 09:48
@dnechay dnechay mentioned this pull request Jun 24, 2025
17 tasks
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