From 9d047e168f4ea2fc6cc2e90608cb442560209ef4 Mon Sep 17 00:00:00 2001 From: weeihan Date: Thu, 23 Jul 2026 22:27:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20phase=207=20=E2=80=94=20drop=20?= =?UTF-8?q?/ims=20basePath,=20update=20all=20hardcoded=20paths,=20refresh?= =?UTF-8?q?=20env=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .env.local.example | 25 +++++++++++++------ app/(protected)/hse/dashboard/page.tsx | 6 ++--- app/(protected)/hse/incidents/[id]/page.tsx | 4 +-- app/(protected)/management/page.tsx | 2 +- app/layout.tsx | 4 +-- components/admin/site-zone-manager.tsx | 2 +- components/admin/truck-manager.tsx | 2 +- components/admin/user-manager.tsx | 2 +- components/capa/capa-owner-actions.tsx | 2 +- components/capa/capa-owner-notes-form.tsx | 2 +- components/capa/close-capa-button.tsx | 2 +- components/capa/verify-form.tsx | 2 +- components/incidents/closure-panel.tsx | 8 +++--- components/incidents/investigation-form.tsx | 6 ++--- .../incidents/similar-incidents-panel.tsx | 2 +- components/incidents/triage-form.tsx | 4 +-- next.config.js | 1 - public/manifest.json | 6 ++--- 18 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.env.local.example b/.env.local.example index 30c43bb..cb7f7c8 100644 --- a/.env.local.example +++ b/.env.local.example @@ -1,14 +1,23 @@ -# .env.local.example -NEXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co -NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here -NEXT_PUBLIC_APP_URL=http://localhost:3000 +# Database (plain PostgreSQL — no Supabase) +DATABASE_URL=postgres://app_user:@127.0.0.1:5432/ims +DATABASE_URL_ADMIN=postgres://app_admin:@127.0.0.1:5432/ims + +# Auth (custom JWT) +JWT_SECRET= + +# App +APP_URL=http://localhost:3000 NEXT_PUBLIC_SITE_URL=http://localhost:3000 CRON_SECRET= -# Server-side only — never expose to the client -SUPABASE_SERVICE_ROLE_KEY= -RESEND_API_KEY=re_... -RESEND_FROM_EMAIL=alerts@yourdomain.com +# Evidence storage (local filesystem) +EVIDENCE_DIR=/tmp/ims-evidence +EVIDENCE_URL_SECRET= + +# Email (Brevo) +BREVO_API_KEY= +BREVO_FROM_EMAIL=noreply@setia.com.my +BREVO_FROM_NAME=Setia IMS # AI keys — optional here; preferred location is the app_settings table (/hse/settings) ANTHROPIC_API_KEY=sk-ant-... diff --git a/app/(protected)/hse/dashboard/page.tsx b/app/(protected)/hse/dashboard/page.tsx index 5615ea2..ebfa4cb 100644 --- a/app/(protected)/hse/dashboard/page.tsx +++ b/app/(protected)/hse/dashboard/page.tsx @@ -164,13 +164,13 @@ export default async function HseDashboardPage({

Dashboard

Export CSV JKKP 8 @@ -191,7 +191,7 @@ export default async function HseDashboardPage({

JKKP 8 annual register due: the {now.getFullYear() - 1} register must be submitted to DOSH before 31 January {now.getFullYear()}.{' '} - + Download {now.getFullYear() - 1} register

diff --git a/app/(protected)/hse/incidents/[id]/page.tsx b/app/(protected)/hse/incidents/[id]/page.tsx index a12502f..0e89e84 100644 --- a/app/(protected)/hse/incidents/[id]/page.tsx +++ b/app/(protected)/hse/incidents/[id]/page.tsx @@ -173,14 +173,14 @@ export default async function HseIncidentDetailPage({ params }: Props) { {needsJkkp && (
Download JKKP 6 (PDF) diff --git a/app/(protected)/management/page.tsx b/app/(protected)/management/page.tsx index 2ca7303..e47015a 100644 --- a/app/(protected)/management/page.tsx +++ b/app/(protected)/management/page.tsx @@ -92,7 +92,7 @@ export default async function ManagementPage() {

Management Dashboard

Export CSV diff --git a/app/layout.tsx b/app/layout.tsx index d347dfb..a70b5f9 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -33,7 +33,7 @@ export default async function RootLayout({ className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`} > - + @@ -41,7 +41,7 @@ export default async function RootLayout({