fix: db init
This commit is contained in:
parent
09411cdd7a
commit
0406695f3a
@ -11,6 +11,8 @@ services:
|
|||||||
- "5444:5432"
|
- "5444:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
# Ensure the pgvector extension is created on first database init
|
||||||
|
- ./prisma/init-pgvector.sql:/docker-entrypoint-initdb.d/init-pgvector.sql:ro
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
|
|||||||
3
prisma/init-pgvector.sql
Normal file
3
prisma/init-pgvector.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
-- Create the pgvector extension used by Prisma's KnowledgeChunk.embedding column
|
||||||
|
CREATE EXTENSION IF NOT EXISTS vector;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ export default async function AdminLayout({
|
|||||||
<h2 className="text-xs md:text-sm font-semibold text-slate-300 uppercase tracking-wider">
|
<h2 className="text-xs md:text-sm font-semibold text-slate-300 uppercase tracking-wider">
|
||||||
Admin Portal
|
Admin Portal
|
||||||
</h2>
|
</h2>
|
||||||
<span className="text-[10px] text-slate-500">
|
<span className="text-[10px] text-slate-500 hidden sm:block">
|
||||||
Read-only observability for Shopify, vendors & suppliers
|
Read-only observability for Shopify, vendors & suppliers
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -372,7 +372,7 @@ export default function InventoryPage() {
|
|||||||
<Filter className="w-4 h-4" /> Filters
|
<Filter className="w-4 h-4" /> Filters
|
||||||
</button>
|
</button>
|
||||||
{showFilters && (
|
{showFilters && (
|
||||||
<div className="absolute right-0 top-full mt-2 bg-slate-900 border border-white/10 rounded-xl shadow-xl p-4 z-50 min-w-[200px]">
|
<div className="absolute right-0 top-full mt-2 bg-slate-900 border border-white/10 rounded-xl shadow-xl p-4 z-50 min-w-[200px] max-w-[calc(100vw-2rem)]">
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs font-bold text-slate-400 mb-2">Status</label>
|
<label className="block text-xs font-bold text-slate-400 mb-2">Status</label>
|
||||||
|
|||||||
@ -347,7 +347,7 @@ export default function EmailTemplatesPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-3">
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs font-semibold text-slate-700 dark:text-slate-300 mb-1">
|
<label className="block text-xs font-semibold text-slate-700 dark:text-slate-300 mb-1">
|
||||||
Intent
|
Intent
|
||||||
|
|||||||
@ -139,12 +139,12 @@ export default function OrderDetailsPage() {
|
|||||||
>
|
>
|
||||||
<ArrowLeft className="w-5 h-5" />
|
<ArrowLeft className="w-5 h-5" />
|
||||||
</button>
|
</button>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3 min-w-0 flex-wrap">
|
||||||
<div className="w-10 h-10 rounded-xl bg-indigo-500/20 border border-indigo-400/20 flex items-center justify-center">
|
<div className="w-10 h-10 rounded-xl bg-indigo-500/20 border border-indigo-400/20 flex items-center justify-center">
|
||||||
<ShoppingBag className="w-5 h-5 text-indigo-400" />
|
<ShoppingBag className="w-5 h-5 text-indigo-400" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className="min-w-0">
|
||||||
<h1 className="text-2xl font-bold text-white">Order Details</h1>
|
<h1 className="text-xl md:text-2xl font-bold text-white">Order Details</h1>
|
||||||
<p className="text-sm text-slate-400">{order.name}</p>
|
<p className="text-sm text-slate-400">{order.name}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -42,12 +42,12 @@ export default function InventoryPage() {
|
|||||||
<table className="w-full text-left">
|
<table className="w-full text-left">
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="border-b border-white/5 bg-white/[0.02]">
|
<tr className="border-b border-white/5 bg-white/[0.02]">
|
||||||
<th className="px-6 py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest">Product Details</th>
|
<th className="px-3 py-3 md:px-6 md:py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest min-w-[180px]">Product Details</th>
|
||||||
<th className="px-6 py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest">Supplier</th>
|
<th className="px-3 py-3 md:px-6 md:py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest hidden sm:table-cell">Supplier</th>
|
||||||
<th className="px-6 py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest">Price</th>
|
<th className="px-3 py-3 md:px-6 md:py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest whitespace-nowrap">Price</th>
|
||||||
<th className="px-6 py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest">Stock</th>
|
<th className="px-3 py-3 md:px-6 md:py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest hidden md:table-cell">Stock</th>
|
||||||
<th className="px-6 py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest">Status</th>
|
<th className="px-3 py-3 md:px-6 md:py-4 text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest hidden lg:table-cell">Status</th>
|
||||||
<th className="px-6 py-4 text-right"></th>
|
<th className="px-3 py-3 md:px-6 md:py-4 text-right text-[10px] font-mono font-bold text-zinc-500 uppercase tracking-widest">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-white/5">
|
<tbody className="divide-y divide-white/5">
|
||||||
@ -59,7 +59,7 @@ export default function InventoryPage() {
|
|||||||
transition={{ delay: index * 0.05 }}
|
transition={{ delay: index * 0.05 }}
|
||||||
className="hover:bg-white/[0.02] transition-colors group"
|
className="hover:bg-white/[0.02] transition-colors group"
|
||||||
>
|
>
|
||||||
<td className="px-6 py-5">
|
<td className="px-3 py-4 md:px-6 md:py-5">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="w-10 h-10 rounded-lg bg-zinc-900 border border-white/5 flex items-center justify-center text-zinc-600 group-hover:text-emerald-accent transition-colors">
|
<div className="w-10 h-10 rounded-lg bg-zinc-900 border border-white/5 flex items-center justify-center text-zinc-600 group-hover:text-emerald-accent transition-colors">
|
||||||
<Package className="w-5 h-5" />
|
<Package className="w-5 h-5" />
|
||||||
@ -67,21 +67,21 @@ export default function InventoryPage() {
|
|||||||
<span className="text-sm font-bold text-zinc-200">{item.title}</span>
|
<span className="text-sm font-bold text-zinc-200">{item.title}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-5">
|
<td className="px-3 py-4 md:px-6 md:py-5 hidden sm:table-cell">
|
||||||
<span className="text-xs text-zinc-500 font-medium">{item.supplier}</span>
|
<span className="text-xs text-zinc-500 font-medium">{item.supplier}</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-5">
|
<td className="px-3 py-4 md:px-6 md:py-5">
|
||||||
<div className="flex items-center gap-1 text-emerald-accent/90 font-mono text-sm font-bold">
|
<div className="flex items-center gap-1 text-emerald-accent/90 font-mono text-sm font-bold">
|
||||||
{item.price}
|
{item.price}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-5">
|
<td className="px-3 py-4 md:px-6 md:py-5 hidden md:table-cell">
|
||||||
<div className="flex items-center gap-1.5 font-mono text-xs text-zinc-400">
|
<div className="flex items-center gap-1.5 font-mono text-xs text-zinc-400">
|
||||||
<Layers className="w-3.5 h-3.5" />
|
<Layers className="w-3.5 h-3.5" />
|
||||||
{item.stock}
|
{item.stock}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-5">
|
<td className="px-3 py-4 md:px-6 md:py-5 hidden lg:table-cell">
|
||||||
<span className={`text-[10px] font-bold px-2 py-0.5 rounded ${item.status === 'LOW STOCK'
|
<span className={`text-[10px] font-bold px-2 py-0.5 rounded ${item.status === 'LOW STOCK'
|
||||||
? 'bg-amber-500/10 text-amber-500'
|
? 'bg-amber-500/10 text-amber-500'
|
||||||
: 'bg-emerald-500/10 text-emerald-500'
|
: 'bg-emerald-500/10 text-emerald-500'
|
||||||
@ -89,7 +89,7 @@ export default function InventoryPage() {
|
|||||||
{item.status}
|
{item.status}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-5 text-right">
|
<td className="px-3 py-4 md:px-6 md:py-5 text-right">
|
||||||
<button className="p-2 text-zinc-600 hover:text-white transition-colors">
|
<button className="p-2 text-zinc-600 hover:text-white transition-colors">
|
||||||
<MoreVertical className="w-4 h-4" />
|
<MoreVertical className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -21,6 +21,11 @@ export const metadata: Metadata = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const viewport = {
|
||||||
|
width: "device-width",
|
||||||
|
initialScale: 1,
|
||||||
|
};
|
||||||
|
|
||||||
import { Providers } from "@/components/providers";
|
import { Providers } from "@/components/providers";
|
||||||
import { ErrorBoundary } from "@/components/ErrorBoundary";
|
import { ErrorBoundary } from "@/components/ErrorBoundary";
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ export default function LoginPage() {
|
|||||||
</div>
|
</div>
|
||||||
<h1 className="text-2xl font-bold tracking-tight text-white">JUNOHUB</h1>
|
<h1 className="text-2xl font-bold tracking-tight text-white">JUNOHUB</h1>
|
||||||
</div>
|
</div>
|
||||||
<h2 className="text-3xl font-extrabold tracking-tight text-white mb-2">
|
<h2 className="text-2xl sm:text-3xl font-extrabold tracking-tight text-white mb-2">
|
||||||
Welcome <span className="text-indigo-400">Back</span>
|
Welcome <span className="text-indigo-400">Back</span>
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-slate-400 text-sm">
|
<p className="text-slate-400 text-sm">
|
||||||
|
|||||||
@ -251,7 +251,7 @@ export default function OnboardingClient() {
|
|||||||
className="space-y-8"
|
className="space-y-8"
|
||||||
>
|
>
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center justify-between p-6 bg-white/5 rounded-2xl border border-white/10 group hover:border-indigo-500/30 transition-all">
|
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between p-4 sm:p-6 bg-white/5 rounded-2xl border border-white/10 group hover:border-indigo-500/30 transition-all">
|
||||||
<div className="flex gap-4 items-center">
|
<div className="flex gap-4 items-center">
|
||||||
<div className="w-12 h-12 rounded-xl bg-indigo-500/20 flex items-center justify-center text-indigo-400 border border-indigo-400/20 transition-all">
|
<div className="w-12 h-12 rounded-xl bg-indigo-500/20 flex items-center justify-center text-indigo-400 border border-indigo-400/20 transition-all">
|
||||||
<Clock3 className="w-6 h-6" />
|
<Clock3 className="w-6 h-6" />
|
||||||
@ -272,7 +272,7 @@ export default function OnboardingClient() {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between p-6 bg-white/5 rounded-2xl border border-white/10 group hover:border-emerald-500/30 transition-all">
|
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between p-4 sm:p-6 bg-white/5 rounded-2xl border border-white/10 group hover:border-emerald-500/30 transition-all">
|
||||||
<div className="flex gap-4 items-center">
|
<div className="flex gap-4 items-center">
|
||||||
<div className="w-12 h-12 rounded-xl bg-emerald-500/20 flex items-center justify-center text-emerald-400 border border-emerald-400/20 transition-all">
|
<div className="w-12 h-12 rounded-xl bg-emerald-500/20 flex items-center justify-center text-emerald-400 border border-emerald-400/20 transition-all">
|
||||||
<Zap className="w-6 h-6" />
|
<Zap className="w-6 h-6" />
|
||||||
|
|||||||
@ -63,7 +63,7 @@ export default function SignupPage() {
|
|||||||
</div>
|
</div>
|
||||||
<h1 className="text-2xl font-bold tracking-tight text-white">JUNOHUB</h1>
|
<h1 className="text-2xl font-bold tracking-tight text-white">JUNOHUB</h1>
|
||||||
</div>
|
</div>
|
||||||
<h2 className="text-3xl font-extrabold tracking-tight text-white mb-2">
|
<h2 className="text-2xl sm:text-3xl font-extrabold tracking-tight text-white mb-2">
|
||||||
Create your <span className="text-indigo-400">Account</span>
|
Create your <span className="text-indigo-400">Account</span>
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-slate-400 text-sm">
|
<p className="text-slate-400 text-sm">
|
||||||
@ -207,7 +207,7 @@ export default function SignupPage() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
<div className="absolute inset-x-0 bottom-4 flex flex-col items-center gap-1 text-[9px] text-slate-500 font-semibold uppercase tracking-widest">
|
<div className="mt-6 flex flex-col items-center gap-1 text-[9px] text-slate-500 font-semibold uppercase tracking-widest">
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<Link
|
<Link
|
||||||
href="/privacy-policy"
|
href="/privacy-policy"
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export default async function SupplierLayout({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-screen relative font-sans dashboard-glass-dark overflow-hidden">
|
<div className="h-screen relative font-sans dashboard-glass-dark overflow-x-hidden">
|
||||||
{/* Desktop Sidebar */}
|
{/* Desktop Sidebar */}
|
||||||
<div className="hidden h-full md:flex md:w-72 md:flex-col md:fixed md:inset-y-0 z-[80] bg-slate-900/70 border-r border-white/10 backdrop-blur-xl">
|
<div className="hidden h-full md:flex md:w-72 md:flex-col md:fixed md:inset-y-0 z-[80] bg-slate-900/70 border-r border-white/10 backdrop-blur-xl">
|
||||||
<SupplierSidebar />
|
<SupplierSidebar />
|
||||||
|
|||||||
@ -143,7 +143,7 @@ export default function NotificationBell() {
|
|||||||
|
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
<div
|
<div
|
||||||
className={`absolute right-0 top-full z-50 mt-2 flex max-h-[600px] w-80 flex-col rounded-xl border shadow-xl sm:w-96 ${
|
className={`absolute right-0 top-full z-50 mt-2 flex max-h-[600px] w-80 sm:w-96 max-w-[calc(100vw-2rem)] flex-col rounded-xl border shadow-xl ${
|
||||||
isLight
|
isLight
|
||||||
? "bg-white border-slate-200"
|
? "bg-white border-slate-200"
|
||||||
: "bg-slate-800 border-white/10"
|
: "bg-slate-800 border-white/10"
|
||||||
|
|||||||
@ -134,7 +134,7 @@ export default function OrderDetailsModal({ isOpen, onClose, orderId, orderName
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex items-center justify-between p-6 border-b border-white/10 flex-shrink-0 bg-slate-900/95 backdrop-blur-sm">
|
<div className="flex items-center justify-between p-4 md:p-6 border-b border-white/10 flex-shrink-0 bg-slate-900/95 backdrop-blur-sm">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="w-10 h-10 rounded-xl bg-indigo-500/20 border border-indigo-400/20 flex items-center justify-center">
|
<div className="w-10 h-10 rounded-xl bg-indigo-500/20 border border-indigo-400/20 flex items-center justify-center">
|
||||||
<ShoppingBag className="w-5 h-5 text-indigo-400" />
|
<ShoppingBag className="w-5 h-5 text-indigo-400" />
|
||||||
@ -153,7 +153,7 @@ export default function OrderDetailsModal({ isOpen, onClose, orderId, orderName
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
<div className="flex-1 overflow-y-auto overflow-x-hidden p-6 min-h-0 bg-slate-900 max-w-full" style={{ maxHeight: 'calc(90vh - 140px)' }}>
|
<div className="flex-1 overflow-y-auto overflow-x-hidden p-4 md:p-6 min-h-0 bg-slate-900 max-w-full" style={{ maxHeight: 'calc(90vh - 140px)' }}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="flex items-center justify-center h-64">
|
<div className="flex items-center justify-center h-64">
|
||||||
<div className="text-slate-400">Loading order details...</div>
|
<div className="text-slate-400">Loading order details...</div>
|
||||||
@ -352,7 +352,7 @@ export default function OrderDetailsModal({ isOpen, onClose, orderId, orderName
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Footer */}
|
{/* Footer */}
|
||||||
<div className="p-6 border-t border-white/10 flex justify-end flex-shrink-0 bg-slate-900/95 backdrop-blur-sm">
|
<div className="p-4 md:p-6 border-t border-white/10 flex justify-end flex-shrink-0 bg-slate-900/95 backdrop-blur-sm">
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
className="px-6 py-2.5 bg-indigo-500 text-white rounded-xl font-bold hover:bg-indigo-600 transition-colors"
|
className="px-6 py-2.5 bg-indigo-500 text-white rounded-xl font-bold hover:bg-indigo-600 transition-colors"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user