A comprehensive web application and REST API for generating Device Identifier URNs according to RFC 9039. Built with Next.js, TypeScript, and shadcn/ui.
- π Web Interface - Clean, responsive web UI with light/dark mode
- π§ REST API - Full-featured API for programmatic access
- π± Auto-detection - Smart detection of device identifier types
- β Validation - Comprehensive input validation for all subtypes
- π Multiple Formats - Supports various input formats (colons, hyphens, no separators)
- π Documentation - Built-in API documentation and examples
- π RFC Compliant - Full compliance with RFC 9039 specifications
| Subtype | Name | Description | Example |
|---|---|---|---|
mac |
MAC/EUI Address | MAC-48, EUI-48, or EUI-64 address | 00:1B:44:11:3A:B7 |
ow |
1-Wire Device | 1-Wire device identifier (64-bit) | 1000008F12AA |
org |
Organization Defined | Organization-specific identifier using PEN | 32473:foo |
os |
Organization Serial | Organization serial number using PEN | 32473:12345 |
ops |
Organization Product+Serial | Organization product class and serial using PEN | 32473:switch:12345 |
- Node.js 18+
- npm or yarn
-
Clone the repository:
git clone https://github.com/your-username/devurn-generator-web.git cd devurn-generator-web -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser: Navigate to http://localhost:3001
npm run build
npm startThis app is optimized for Vercel deployment with zero configuration needed.
-
Push to GitHub:
git add . git commit -m "Ready for deployment" git push origin main
-
Deploy on Vercel:
- Go to vercel.com and sign up/login
- Click "New Project"
- Import your GitHub repository
- Vercel will auto-detect Next.js and configure everything
- Click "Deploy"
-
Your app will be live!
- Vercel provides a URL like
https://your-app-name.vercel.app - API endpoints work automatically at
https://your-app-name.vercel.app/api/*
- Vercel provides a URL like
-
Install Vercel CLI:
npm i -g vercel
-
Deploy from terminal:
vercel
-
Follow the prompts:
- Link to existing project or create new
- Configure project settings (or use defaults)
- Deploy!
No environment variables are required for basic functionality. All configuration is built-in.
After deployment, you can add a custom domain in your Vercel dashboard:
- Go to your project settings
- Click "Domains"
- Add your custom domain
- Update your DNS records as instructed
- Select the device identifier subtype from the dropdown
- Enter your device identifier (auto-detection available)
- Click "Generate DEV URN"
- View the generated URN and detailed breakdown
- Copy the result with one click
- Complete REST API documentation
- Interactive examples with copy-to-clipboard
- Code examples in multiple languages
- Live endpoint testing
The API provides four main endpoints for DEV URN operations:
http://localhost:3001/api
# Get all supported subtypes
curl -s http://localhost:3001/api/subtypes# Detect subtype from device identifier
curl -s -X POST -H "Content-Type: application/json" \
-d '{"input":"00:1B:44:11:3A:B7"}' \
http://localhost:3001/api/detect# Validate device identifier for specific subtype
curl -s -X POST -H "Content-Type: application/json" \
-d '{"subtype":"mac","input":"00:1B:44:11:3A:B7"}' \
http://localhost:3001/api/validate# Generate DEV URN from device identifier
curl -s -X POST -H "Content-Type: application/json" \
-d '{"subtype":"mac","input":"00:1B:44:11:3A:B7"}' \
http://localhost:3001/api/generate{
"urn": "urn:dev:mac:021b44fffe113ab7",
"subtype": "mac",
"input": "00:1B:44:11:3A:B7",
"valid": true
}{
"valid": true,
"error": null,
"subtype": "mac",
"input": "00:1B:44:11:3A:B7",
"format": "XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX or XXXXXXXXXXXX",
"example": "00:1B:44:11:3A:B7"
}// Generate DEV URN
const response = await fetch('http://localhost:3001/api/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
subtype: 'mac',
input: '00:1B:44:11:3A:B7'
})
});
const result = await response.json();
console.log(result.urn); // urn:dev:mac:021b44fffe113ab7import requests
# Generate DEV URN
response = requests.post('http://localhost:3001/api/generate',
json={
'subtype': 'mac',
'input': '00:1B:44:11:3A:B7'
}
)
result = response.json()
print(result['urn']) # urn:dev:mac:021b44fffe113ab7package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
payload := map[string]string{
"subtype": "mac",
"input": "00:1B:44:11:3A:B7",
}
jsonData, _ := json.Marshal(payload)
resp, _ := http.Post("http://localhost:3001/api/generate",
"application/json", bytes.NewBuffer(jsonData))
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["urn"])
}# Different device identifier types
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"ow","input":"1000008F12AA"}' \
http://localhost:3001/api/generate
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"org","input":"32473:foo"}' \
http://localhost:3001/api/generate
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"ops","input":"32473:switch:12345"}' \
http://localhost:3001/api/generate# Colon-separated
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"mac","input":"00:1B:44:11:3A:B7"}' \
http://localhost:3001/api/generate
# Hyphen-separated
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"mac","input":"00-1B-44-11-3A-B7"}' \
http://localhost:3001/api/generate
# No separators
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"mac","input":"001B44113AB7"}' \
http://localhost:3001/api/generatecurl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"ow","input":"1000008F12AA"}' \
http://localhost:3001/api/generate# Organization defined
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"org","input":"32473:mydevice"}' \
http://localhost:3001/api/generate
# Organization serial
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"os","input":"32473:12345"}' \
http://localhost:3001/api/generate
# Organization product+serial
curl -X POST -H "Content-Type: application/json" \
-d '{"subtype":"ops","input":"32473:router:67890"}' \
http://localhost:3001/api/generate- Frontend: Next.js 15 with TypeScript
- UI Framework: shadcn/ui + Tailwind CSS
- Theme: Light/Dark mode with system preference detection
- API: Next.js API routes with full REST compliance
- Validation: Comprehensive input validation and error handling
- MAC Address Conversion: Automatic MAC-48/EUI-48 to EUI-64 conversion with universal/local bit flipping
- PEN Validation: Private Enterprise Number validation for organization subtypes
- Format Detection: Smart auto-detection of device identifier formats
- Error Handling: Detailed validation errors and HTTP status codes
- Type Safety: Full TypeScript implementation
src/
βββ app/
β βββ api/ # REST API endpoints
β βββ layout.tsx # Root layout with theme provider
β βββ page.tsx # Main page with tabs
βββ components/
β βββ ui/ # shadcn/ui components
β βββ DevUrnGenerator.tsx # Main generator interface
β βββ ApiDocumentation.tsx # API documentation
β βββ theme-provider.tsx # Theme context
β βββ theme-toggle.tsx # Theme toggle button
βββ lib/
βββ dev-urn.ts # Core URN generation logic
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or need support:
- Check existing GitHub Issues
- Create a new issue with detailed description
- Include steps to reproduce and expected behavior
# Development
npm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLint