Skip to content

Latest commit

 

History

History
143 lines (102 loc) · 3.69 KB

File metadata and controls

143 lines (102 loc) · 3.69 KB

UniformID Validator

A Next.js web application designed to validate and inspect Web DID (Decentralized Identifier) addresses seamlessly.

Live Demo: A running version is available at https://uniformid.1edtech.org

Features

  • Validate DID documents from various DID methods
  • Inspect DID services and public keys
  • Visual representation of DID structure
  • Support for Web DID and other DID methods
  • Modern, responsive UI built with Next.js and Tailwind CSS

Prerequisites

  • Node.js 18 or later
  • npm, yarn, or pnpm

Quick Start

Local Development

  1. Navigate to the validator directory:
cd validator
  1. Install dependencies:
npm install
# or
yarn install
# or
pnpm install
  1. Start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
  1. Open your browser and navigate to http://localhost:3000

The application will automatically reload when you make changes to the code.

Production Build

  1. Build the application:
npm run build
# or
yarn build
# or
pnpm build
  1. Start the production server:
npm start
# or
yarn start
# or
pnpm start

Usage

  1. Enter a DID: Paste a DID (e.g., did:web:example.com:user:bob) into the input field
  2. Validate: Click the validate button to resolve and inspect the DID document
  3. View Results: The application will display:
    • DID document structure
    • Public keys and verification methods
    • Services and endpoints
    • Validation status

Development Notes

HTTPS Requirements

Since Web DIDs require HTTPS/TLS for proper resolution, the development server includes experimental HTTPS support. For local development with other DID methods, HTTP is sufficient.

Testing with ngrok

If you need to test Web DIDs locally:

  1. Start your DID registrar service (see registrar/README.md)
  2. Use ngrok to create a secure tunnel: ngrok http 3000
  3. Create DIDs using the ngrok domain
  4. Use the validator to inspect those DIDs

Project Structure

validator/
├── src/
│   ├── app/                 # Next.js app directory
│   │   ├── page.tsx         # Main page component
│   │   ├── layout.tsx       # Root layout
│   │   └── serviceCards/    # Service card components
│   ├── types/               # TypeScript type definitions
│   └── utils/               # Utility functions
├── public/                  # Static assets
└── package.json            # Dependencies and scripts

Customization

Adding New DID Methods

The validator supports multiple DID methods through the did-resolver library. To add support for additional DID methods:

  1. Install the appropriate resolver package
  2. Update the resolver configuration in the application
  3. Test with sample DIDs

Styling

The application uses Tailwind CSS for styling. Custom styles can be added to src/app/globals.css.

Troubleshooting

Common Issues

  1. DID resolution fails: Ensure the DID is properly formatted and the resolver supports the DID method
  2. HTTPS errors: For Web DIDs, ensure the domain has a valid SSL certificate
  3. Port conflicts: Change the port by setting the PORT environment variable

Debug Mode

Enable debug logging by setting the NODE_ENV environment variable to development.

API Integration

The validator can be integrated with the UniformID Registrar API for comprehensive DID management workflows. See the Postman collection in the postman/ directory for API examples.

Support

For issues, questions, or contributions, please reach out to 1EdTech or create an issue in the repository.