Skip to content

Quantus-Network/explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Quantus Block Explorer

A modern, feature-rich blockchain explorer for the Quantus Network built with React.js 19 + Tanstack Router, TypeScript, and GraphQL. Explore transactions, blocks, and accounts with real-time data visualization and an intuitive user interface.

Quantus Explorer

πŸš€ Features

Core Functionality

  • πŸ” Universal Search - Search across transactions, blocks, and accounts with intelligent auto-complete
  • πŸ“Š Real-time Data - Live blockchain statistics and recent activity updates
  • πŸ“± Responsive Design - Optimized for desktop, tablet, and mobile devices
  • πŸŒ™ Dark/Light Theme - Toggle between themes with system preference support
  • ⚑ Fast Performance - Server-side rendering with Next.js 14 App Router

Data Views

  • πŸ’° Transactions - Browse all network transactions with detailed information
  • 🧱 Blocks - Explore block data including height, hash, and timestamp
  • πŸ‘€ Accounts - View account balances and transaction history
  • πŸ“ˆ Chain Statistics - Network metrics and activity summaries

Technical Features

  • Type-Safe GraphQL - Automated code generation for GraphQL queries
  • Modern UI Components - Built with Radix UI primitives and Tailwind CSS
  • Accessibility First - WCAG compliant components and keyboard navigation

πŸ› οΈ Technology Stack

Frontend

  • React.js 19 - The library for web user interfaces
  • Tanstack Router - Modern and scalable router
  • TypeScript - Type-safe JavaScript
  • Tailwind CSS - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Lucide React - Beautiful icons

Data & API

  • Apollo Client - GraphQL client with caching
  • GraphQL Code Generator - Type-safe GraphQL operations
  • Date-fns - Date manipulation utilities

Development Tools

  • Storybook - Component development environment
  • Jest - Testing framework
  • ESLint - Code linting
  • Prettier - Code formatting
  • Husky - Git hooks

πŸ“‹ Prerequisites

  • Node.js 18.x or higher
  • Yarn 1.22.x or higher
  • Git for version control

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/Quantus-Network/explorer.git
cd explorer

2. Install Dependencies

bun install

3. Environment Setup

Create a .env.local file in the root directory:

# Required
VITE_SITE_URL=http://localhost:3100

# Optional
ANALYZE=false

4. Generate GraphQL Types

bun gql:compile

5. Start Development Server

bun dev

Visit http://localhost:3100 to see the application.

πŸ“ Project Structure

quantus-block-explorer/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ __generated__/         # Auto-generated GraphQL types
β”‚   β”œβ”€β”€ api/                   # GraphQL queries and mutations
β”‚   β”œβ”€β”€ app/                   # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ accounts/          # Account pages
β”‚   β”‚   β”œβ”€β”€ blocks/            # Block pages
β”‚   β”‚   β”œβ”€β”€ transactions/      # Transaction pages
β”‚   β”‚   └── layout.tsx         # Root layout
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”‚   β”œβ”€β”€ features/          # Feature-specific components
β”‚   β”‚   β”œβ”€β”€ layout/            # Layout components
β”‚   β”‚   └── ui/                # Reusable UI components
β”‚   β”œβ”€β”€ config/                # Configuration files
β”‚   β”œβ”€β”€ constants/             # Application constants
β”‚   β”œβ”€β”€ hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ lib/                   # Utility libraries
β”‚   β”œβ”€β”€ schemas/               # TypeScript schemas
β”‚   β”œβ”€β”€ types/                 # Type definitions
β”‚   └── utils/                 # Utility functions
β”œβ”€β”€ public/                    # Static assets
β”œβ”€β”€ .storybook/                # Storybook configuration
β”œβ”€β”€ .github/                   # GitHub workflows
└── package.json

πŸ”§ Development Scripts

Command Description
bun dev Start development server
bun run build Build for production
bun start Start production server
bun lint Run ESLint
bun test Run tests
bun format Format code with Prettier
bun storybook Start Storybook
bun gql:compile Generate GraphQL types

πŸ§ͺ Testing

Unit Tests

bun test

Storybook Tests

bun storybook
bun test-storybook:ci

🎨 Component Development

We use Storybook for component development and testing:

bun storybook

Components are organized by feature and include:

  • Stories for different states
  • Accessibility testing
  • Visual regression testing

πŸ“Š GraphQL Integration

The project uses Apollo Client for GraphQL integration with automatic code generation:

Adding New Queries

  1. Create query in src/api/
  2. Run bun gql:compile to generate types
  3. Import and use in components

Example Query Structure

export const exampleQuery = {
  useGetData: (config?: QueryHookOptions) => {
    const GET_DATA = gql`
      query GetData($id: String!) {
        data(id: $id) {
          id
          name
        }
      }
    `;

    return useQuery<DataResponse>(GET_DATA, config);
  }
};

🎯 Performance Optimization

  • CSR - Client-side rendering for smooth and fast interactions
  • Code Splitting - Automatic code splitting with Vite.js
  • Bundle Analysis - Use ANALYZE=true bun run build to analyze bundle size

πŸ” Environment Variables

Variable Description Required
VITE_SITE_URL Site base URL Yes
VITE_GRAPHQL_URL GraphQL API endpoint Yes
ANALYZE Enable bundle analyzer No

πŸš€ Deployment

Manual Deployment

bun run build

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests and linting
    bun test
    bun lint
  5. Commit your changes
    git commit -m 'Add amazing feature'
  6. Push to the branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Code Style

  • Use TypeScript for all new code
  • Follow the existing naming conventions
  • Add tests for new features
  • Update documentation as needed

πŸ“ Code Quality

This project maintains high code quality through:

  • ESLint - Airbnb configuration with TypeScript support
  • Prettier - Consistent code formatting
  • Husky - Pre-commit hooks for quality checks
  • TypeScript - Type safety throughout the codebase

πŸ› Troubleshooting

Common Issues

GraphQL Types Not Generated

bun gql:compile

Development Server Won't Start

bun clean
bun dev

Getting Help

  • Check the Issues page
  • Create a new issue with detailed information

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


Built with ❀️ by the Quantus Team

For more information, visit our website

About

Custom blockchain explorer based on Subsquid

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages