feat: scaffold Antonym fashion store
Anonymous Bitcoin-only fashion e-commerce with: - Vue 3 + Tailwind 4 frontend with glassmorphism dark/light design system - Express 5 + SQLite backend with BTCPay Server integration - Nostr identity (NIP-07/keypair) for anonymous purchase tracking - ChaCha20-Poly1305 encrypted shipping addresses - Admin panel with order/product/stock management - SVG logo splash animation with clip-path reveal - 5 seeded products across 4 categories Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
36
server/index.ts
Normal file
36
server/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import express from 'express'
|
||||
import helmet from 'helmet'
|
||||
import cors from 'cors'
|
||||
import cookieParser from 'cookie-parser'
|
||||
import { getDb } from './db/connection.js'
|
||||
import { initSchema } from './db/schema.js'
|
||||
import { seedProducts } from './db/seed.js'
|
||||
import { productsRouter } from './routes/products.js'
|
||||
import { ordersRouter } from './routes/orders.js'
|
||||
import { webhooksRouter } from './routes/webhooks.js'
|
||||
import { adminRouter } from './routes/admin.js'
|
||||
import { adminProductsRouter } from './routes/adminProducts.js'
|
||||
import { adminOrdersRouter } from './routes/adminOrders.js'
|
||||
|
||||
const app = express()
|
||||
const port = Number(process.env.PORT) || 3141
|
||||
|
||||
app.use(helmet({ contentSecurityPolicy: false }))
|
||||
app.use(cors({ origin: true, credentials: true }))
|
||||
app.use(cookieParser())
|
||||
app.use(express.json({ limit: '1mb' }))
|
||||
|
||||
const db = getDb()
|
||||
initSchema(db)
|
||||
seedProducts(db)
|
||||
|
||||
app.use('/api/products', productsRouter)
|
||||
app.use('/api/orders', ordersRouter)
|
||||
app.use('/api/webhooks', webhooksRouter)
|
||||
app.use('/api/admin', adminRouter)
|
||||
app.use('/api/admin/products', adminProductsRouter)
|
||||
app.use('/api/admin/orders', adminOrdersRouter)
|
||||
|
||||
app.get('/api/health', (_req, res) => { res.json({ ok: true, timestamp: new Date().toISOString() }) })
|
||||
|
||||
app.listen(port, () => { console.log(`Antonym API running on http://localhost:${port}`) })
|
||||
Reference in New Issue
Block a user