feat: placeholder images, Nostr inbox, order lookup, SEO, bigger logo
- 5 SVG placeholder product images (minimal dark style with watermark initials) - Seed data updated to reference .svg placeholders - Nostr DM inbox in admin (Messages tab) with shop npub display - GET /api/admin/nostr-info endpoint for shop pubkey - My Orders page: customers look up orders by NIP-07 Nostr identity - GET /api/orders/by-pubkey/:pubkey endpoint with hex validation - SeoMeta component for OG/Twitter meta tags - SEO meta on HomeView and ProductView - Base OG meta tags in index.html - "My Orders" link in shop header nav - Splash logo doubled in size on desktop (680px max) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
server/routes/adminNostr.ts
Normal file
26
server/routes/adminNostr.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Router } from 'express'
|
||||
import { adminAuth } from '../middleware/adminAuth.js'
|
||||
|
||||
export const adminNostrRouter = Router()
|
||||
adminNostrRouter.use(adminAuth)
|
||||
|
||||
adminNostrRouter.get('/nostr-info', async (_req, res) => {
|
||||
const privkeyHex = process.env.NOSTR_PRIVATE_KEY
|
||||
if (!privkeyHex) {
|
||||
res.status(404).json({ error: { code: 'NOT_CONFIGURED', message: 'NOSTR_PRIVATE_KEY not set' } })
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const { getPublicKey } = await import('nostr-tools/pure')
|
||||
const { npubEncode } = await import('nostr-tools/nip19')
|
||||
const privkey = Uint8Array.from(Buffer.from(privkeyHex, 'hex'))
|
||||
const pubkey = getPublicKey(privkey)
|
||||
const npub = npubEncode(pubkey)
|
||||
privkey.fill(0)
|
||||
|
||||
res.json({ npub, pubkey })
|
||||
} catch {
|
||||
res.status(500).json({ error: { code: 'NOSTR_ERROR', message: 'Failed to derive public key' } })
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user