An automated system for authorizing new ONU (Optical Network Unit) fiber routers. The system validates device information, assigns IP addresses based on mainboard types, and integrates with billing systems.
├── backend/
│ ├── database/
│ │ ├── migrations.ts # Database schema
│ │ └── queries.ts # Database operations
│ ├── routes/
│ │ ├── devices.ts # Device management API
│ │ └── static.ts # Static file serving
│ └── index.ts # Main Hono server
├── frontend/
│ ├── components/
│ │ ├── App.tsx # Main application
│ │ ├── DeviceForm.tsx # Device registration form
│ │ └── DeviceList.tsx # Device management dashboard
│ ├── index.html # Main HTML template
│ └── index.tsx # Frontend entry point
└── shared/
└── types.ts # Shared TypeScript types
Set these in your Val Town environment:
BILLING_API_URL: URL of the external billing systemBILLING_API_KEY: API key for billing system authenticationPOST /api/devices - Register new deviceGET /api/devices - List all devicesPUT /api/devices/:id - Update deviceDELETE /api/devices/:id - Delete device