Skip to content

Add custom stats widgets and update API routing and CI pipeline integration#2

Open
MSalman6 wants to merge 5 commits into
DMDcoin:dmdfrom
MSalman6:dmd
Open

Add custom stats widgets and update API routing and CI pipeline integration#2
MSalman6 wants to merge 5 commits into
DMDcoin:dmdfrom
MSalman6:dmd

Conversation

@MSalman6
Copy link
Copy Markdown

This pull request introduces a new "Custom Stat" widget to the home page stats section, allowing dynamic display of custom statistics based on a configurable JSON file. It adds both backend and frontend support for fetching and rendering these custom stats, and ensures proper integration with analytics and metadata systems. Additionally, a new GitHub Actions workflow is added for Docker image publishing.

Custom Stat Widget Feature:

  • Added a new API route (app/api/custom-stat/route.ts) that reads from a custom-config.json file and fetches upstream data for each configured custom stat, supporting flexible stat configuration.
  • Implemented the CustomStatWidget React component (client/slices/home/pages/index/stats/CustomStatWidget.tsx) to fetch the custom stat configs and display each stat as a widget, with support for nested JSON paths and icons.
  • Integrated CustomStatWidget into the main stats grid on the home page (client/slices/home/pages/index/stats/Stats.tsx). [1] [2]

Analytics and Metadata Integration:

  • Registered the /api/custom-stat route with analytics (client/shared/analytics/mixpanel/get-page-type.ts), Open Graph metadata (client/shared/metadata/get-page-og-type.ts), and page template/title systems (client/shared/metadata/templates/description.ts, client/shared/metadata/templates/title.ts) to ensure consistent tracking and SEO. [1] [2] [3] [4]

DevOps:

  • Added a new GitHub Actions workflow (.github/workflows/docker-publish.yml) to build and publish Docker images for the project on pushes to the dmd branch.

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.

1 participant