-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate to Vite/React 19 and polish protocol table UX #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build-and-check: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Check protocol icon coverage | ||
| run: npm run check:protocol-icons | ||
|
|
||
| - name: Build app | ||
| run: npm run build | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
|
|
||
| # production | ||
| /build | ||
| /dist | ||
|
|
||
| # misc | ||
| .DS_Store | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,89 @@ | ||
| # Getting Started with Create React App | ||
| # Chainstats | ||
|
|
||
| This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
| Chainstats is a React + Vite app that visualizes Chainstack blockchain node storage sizes by protocol, network, node type, and client. | ||
|
|
||
| ## Available Scripts | ||
| Production URL: [https://chainstats.org](https://chainstats.org) | ||
|
|
||
| In the project directory, you can run: | ||
| ## Data Source | ||
|
|
||
| ### `npm start` | ||
| - API endpoint: `https://console.chainstack.com/api/core/v1/calc/` | ||
| - Source path: `Enterprise.protocols` | ||
| - Inclusion rule in UI: | ||
| - Use only `dedicated` entries | ||
| - Include only nodes where `type === "public"` | ||
| - Skip entries without `node_info.storage.size_required` | ||
|
|
||
| Runs the app in the development mode.\ | ||
| Open [http://localhost:3000](http://localhost:3000) to view it in your browser. | ||
| ## Features | ||
|
|
||
| The page will reload when you make changes.\ | ||
| You may also see any lint errors in the console. | ||
| - Protocol/network/client table with sorting and filtering. | ||
| - Search by protocol slug and friendly display aliases. | ||
| - Full and archive node-type rows. | ||
| - Multi-client visibility per network/type. | ||
| - Protocol icons with fallback badges for unmapped protocols. | ||
| - Light/dark theme support. | ||
|
|
||
| ### `npm run build` | ||
| ## Stack | ||
|
|
||
| Builds the app for production to the `build` folder.\ | ||
| It correctly bundles React in production mode and optimizes the build for the best performance. | ||
| - React 19 | ||
| - Vite 7 | ||
| - Ant Design 6 | ||
| - Sass | ||
| - Axios | ||
|
|
||
| The build is minified and the filenames include the hashes.\ | ||
| Your app is ready to be deployed! | ||
| ## Local Development | ||
|
|
||
| See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
| ### Prerequisites | ||
|
|
||
| ### `npm run deploy` | ||
| - Node.js 20+ | ||
| - npm 9+ | ||
|
|
||
| Will deploy app on gh-pages | ||
| ### Install | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ### Start dev server | ||
|
|
||
| ```bash | ||
| npm start | ||
| ``` | ||
|
|
||
| Open [http://localhost:5173](http://localhost:5173). | ||
|
|
||
| ## Scripts | ||
|
|
||
| - `npm start`: run Vite dev server. | ||
| - `npm run build`: create production build in `dist/`. | ||
| - `npm run preview`: preview built app locally. | ||
| - `npm run test`: run Vitest (`--passWithNoTests`). | ||
| - `npm run check:protocol-icons`: compare visible API protocols to icon map coverage. | ||
| - `npm run deploy`: publish `dist/` to GitHub Pages. | ||
|
|
||
| ## CI | ||
|
|
||
| Workflow: `.github/workflows/ci.yml` | ||
|
|
||
| Runs: | ||
| 1. `npm ci` | ||
| 2. `npm run check:protocol-icons` | ||
| 3. `npm run build` | ||
|
|
||
| ## Protocol Metadata | ||
|
|
||
| Shared protocol formatting lives in: | ||
|
|
||
| - `src/helpers/protocolMetadata.json` | ||
| - `src/helpers/protocolDisplay.js` | ||
|
|
||
| Use these helpers for protocol naming and network formatting in UI components. | ||
|
|
||
| ## Deployment | ||
|
|
||
| 1. Run checks: | ||
| - `npm run check:protocol-icons` | ||
| - `npm run build` | ||
| 2. Deploy: | ||
| - `npm run deploy` | ||
| 3. Verify: | ||
| - [https://chainstats.org](https://chainstats.org) |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.