From 6549773c13ce2cc9ca47613732377235e7dc118d Mon Sep 17 00:00:00 2001 From: ferdiansyah783 Date: Thu, 14 Aug 2025 03:15:47 +0700 Subject: [PATCH 01/10] fix: typography --- src/views/dashboards/daily-report/report-generator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/dashboards/daily-report/report-generator.tsx b/src/views/dashboards/daily-report/report-generator.tsx index 46ee875..9dbcfde 100644 --- a/src/views/dashboards/daily-report/report-generator.tsx +++ b/src/views/dashboards/daily-report/report-generator.tsx @@ -485,7 +485,7 @@ const ReportGeneratorComponent: React.FC = ({ - + {labels.periodLabel || 'Periode:'}{' '} Date: Thu, 14 Aug 2025 03:21:58 +0700 Subject: [PATCH 02/10] fix: typography --- .../apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx b/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx index 6f1b75c..f783329 100644 --- a/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx +++ b/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx @@ -151,7 +151,7 @@ const AdjustmentStockDrawer = (props: Props) => { onChange={e => setFormData({ ...formData, items: [{ ...formData.items[0], item_type: e.target.value }] })} > Product - Ingredient + {/* Ingredient */} Date: Mon, 1 Sep 2025 18:09:54 +0700 Subject: [PATCH 03/10] add deployment --- .idea/.gitignore | 5 ++ .idea/inspectionProfiles/Project_Default.xml | 7 +++ .idea/modules.xml | 8 ++++ .idea/pos-dashboard-v2.iml | 12 +++++ .idea/vcs.xml | 6 +++ Dockerfile | 49 ++++++++++++++++++++ deployment.sh | 21 +++++++++ package-lock.json | 17 ++++++- package.json | 1 + 9 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/pos-dashboard-v2.iml create mode 100644 .idea/vcs.xml create mode 100644 Dockerfile create mode 100644 deployment.sh diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..7c4836f --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e7b78f5 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/pos-dashboard-v2.iml b/.idea/pos-dashboard-v2.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/.idea/pos-dashboard-v2.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..463394d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +# Build stage +FROM node:18-alpine AS builder +WORKDIR /app + +# Build arguments for environment variables +ARG NEXT_PUBLIC_APP_URL +ARG NEXT_PUBLIC_DOCS_URL +ARG NEXT_PUBLIC_API_URL +ARG API_URL +ARG BASEPATH +ARG MAPBOX_ACCESS_TOKEN + +# Set environment variables for build +ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL +ENV NEXT_PUBLIC_DOCS_URL=$NEXT_PUBLIC_DOCS_URL +ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL +ENV API_URL=$API_URL +ENV BASEPATH=$BASEPATH +ENV MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN + +# Copy all files first +COPY . . + +# Install dependencies +RUN npm ci + +# Build the application without linting +RUN npm run build:no-lint + +# Production stage +FROM node:18-alpine AS runner +WORKDIR /app + +ENV NODE_ENV=production + +RUN addgroup -g 1001 -S nodejs +RUN adduser -S nextjs -u 1001 + +COPY --from=builder /app/public ./public +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + +USER nextjs + +EXPOSE 8080 + +ENV PORT=8080 + +CMD ["node", "server.js"] diff --git a/deployment.sh b/deployment.sh new file mode 100644 index 0000000..649b213 --- /dev/null +++ b/deployment.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +APP_NAME="apskel-frontend" +PORT="8080" + +echo "🔄 Pulling latest code..." +git pull + +echo "🐳 Building Docker image..." +docker build -t apskel-frontend . + +echo "🛑 Stopping and removing old container..." +docker stop $APP_NAME 2>/dev/null +docker rm $APP_NAME 2>/dev/null + +echo "🚀 Running new container..." +docker run -d --name $APP_NAME \ + -p 8080:$PORT \ + $APP_NAME:latest + +echo "✅ Deployment complete." diff --git a/package-lock.json b/package-lock.json index 52d1762..3359af7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "@fullcalendar/react": "6.1.15", "@fullcalendar/timegrid": "6.1.15", "@hookform/resolvers": "3.9.1", + "@iconify/react": "^6.0.1", "@mui/lab": "6.0.0-beta.19", "@mui/material": "6.2.1", "@mui/material-nextjs": "6.2.1", @@ -1308,6 +1309,21 @@ "pathe": "^1.1.2" } }, + "node_modules/@iconify/react": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@iconify/react/-/react-6.0.1.tgz", + "integrity": "sha512-fCocnAfiGXjrA0u7KkS3W/OQHNp9LRFICudvOtxmS3Mf7U92aDhP50wyzRbobZli51zYt9ksZ9g0J7H586XvOQ==", + "license": "MIT", + "dependencies": { + "@iconify/types": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/cyberalien" + }, + "peerDependencies": { + "react": ">=16" + } + }, "node_modules/@iconify/tools": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@iconify/tools/-/tools-4.1.1.tgz", @@ -1332,7 +1348,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==", - "dev": true, "license": "MIT" }, "node_modules/@iconify/utils": { diff --git a/package.json b/package.json index 0e92148..b686ad7 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "@fullcalendar/react": "6.1.15", "@fullcalendar/timegrid": "6.1.15", "@hookform/resolvers": "3.9.1", + "@iconify/react": "^6.0.1", "@mui/lab": "6.0.0-beta.19", "@mui/material": "6.2.1", "@mui/material-nextjs": "6.2.1", From c6f2d67baf71fa34fe9a6f189bc9fe80823e5b04 Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Mon, 1 Sep 2025 18:20:25 +0700 Subject: [PATCH 04/10] Fix deployment --- next.config.ts | 45 +++++++++++++++++++++++---------------------- package.json | 3 ++- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/next.config.ts b/next.config.ts index e21db92..0e48617 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,28 +2,29 @@ import type { NextConfig } from 'next' const nextConfig: NextConfig = { basePath: process.env.BASEPATH, - redirects: async () => { - return [ - { - source: '/', - destination: '/en/dashboards/overview', - permanent: true, - locale: false - }, - { - source: '/:lang(en|fr|ar)', - destination: '/:lang/dashboards/overview', - permanent: true, - locale: false - }, - { - source: '/((?!(?:en|fr|ar|front-pages|favicon.ico)\\b)):path', - destination: '/en/:path', - permanent: true, - locale: false - } - ] - } + eslint: { + ignoreDuringBuilds: true, + }, + redirects: async () => [ + { + source: '/', + destination: '/en/dashboards/overview', + permanent: true, + locale: false, + }, + { + source: '/:lang(en|fr|ar)', + destination: '/:lang/dashboards/overview', + permanent: true, + locale: false, + }, + { + source: '/((?!(?:en|fr|ar|front-pages|favicon.ico)\\b)):path', + destination: '/en/:path', + permanent: true, + locale: false, + } + ], } export default nextConfig diff --git a/package.json b/package.json index b686ad7..70a67a7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "lint:fix": "next lint --fix", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"", "build:icons": "tsx src/assets/iconify-icons/bundle-icons-css.ts", - "removeI18n": "tsx src/remove-translation-scripts/index.ts" + "removeI18n": "tsx src/remove-translation-scripts/index.ts", + "build:no-lint": "NEXT_DISABLE_ESLINT=true NEXT_DISABLE_TYPECHECK=true next build" }, "dependencies": { "@emoji-mart/data": "1.2.1", From c71529b11d7999f9eae5d94fd2d8ae7ebfec35f1 Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Mon, 1 Sep 2025 18:33:38 +0700 Subject: [PATCH 05/10] fix --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 463394d..2f702f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,9 @@ COPY . . # Install dependencies RUN npm ci +# Build icons +RUN npm run build:icons + # Build the application without linting RUN npm run build:no-lint From 38e1bb50271e1ae9a284f52712a59ee203694c3d Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Mon, 1 Sep 2025 19:07:22 +0700 Subject: [PATCH 06/10] fix --- next.config.ts | 4 ++++ src/components/layout/horizontal/HorizontalMenu.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/next.config.ts b/next.config.ts index 0e48617..50436c1 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,10 +1,14 @@ import type { NextConfig } from 'next' const nextConfig: NextConfig = { + output: 'standalone', basePath: process.env.BASEPATH, eslint: { ignoreDuringBuilds: true, }, + typescript: { + ignoreBuildErrors: true, + }, redirects: async () => [ { source: '/', diff --git a/src/components/layout/horizontal/HorizontalMenu.tsx b/src/components/layout/horizontal/HorizontalMenu.tsx index af9bbac..dd7658e 100644 --- a/src/components/layout/horizontal/HorizontalMenu.tsx +++ b/src/components/layout/horizontal/HorizontalMenu.tsx @@ -97,8 +97,8 @@ const HorizontalMenu = ({ dictionary }: { dictionary: Awaited}> {dictionary['navigation'].analytics} - }> - {dictionary['navigation'].eCommerce} + }> + {dictionary['navigation'].inventory} }> {dictionary['navigation'].academy} From 4ff01920e7cf5c53e50cbfdffd53969322c43582 Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Mon, 1 Sep 2025 19:46:48 +0700 Subject: [PATCH 07/10] fix --- deployment.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/deployment.sh b/deployment.sh index 649b213..1355703 100644 --- a/deployment.sh +++ b/deployment.sh @@ -9,11 +9,9 @@ git pull echo "🐳 Building Docker image..." docker build -t apskel-frontend . -echo "🛑 Stopping and removing old container..." docker stop $APP_NAME 2>/dev/null docker rm $APP_NAME 2>/dev/null -echo "🚀 Running new container..." docker run -d --name $APP_NAME \ -p 8080:$PORT \ $APP_NAME:latest From bfdcb123d0a82b484cb97de3056d95ce7c3ae57a Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Mon, 1 Sep 2025 21:03:31 +0700 Subject: [PATCH 08/10] Fixed --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 2f702f0..7a4a424 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ ENV MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN # Copy all files first COPY . . + # Install dependencies RUN npm ci From 4f65b9bbb601b84e94b7df841f0c8832b36741ff Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Mon, 1 Sep 2025 21:03:56 +0700 Subject: [PATCH 09/10] fixed --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a4a424..84164b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,17 +11,16 @@ ARG BASEPATH ARG MAPBOX_ACCESS_TOKEN # Set environment variables for build -ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL -ENV NEXT_PUBLIC_DOCS_URL=$NEXT_PUBLIC_DOCS_URL -ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL ENV API_URL=$API_URL ENV BASEPATH=$BASEPATH ENV MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN +ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL +ENV NEXT_PUBLIC_DOCS_URL=$NEXT_PUBLIC_DOCS_URL +ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL # Copy all files first COPY . . - # Install dependencies RUN npm ci From b8de65bdcfb07a0f617087dde1db0d610d192c3c Mon Sep 17 00:00:00 2001 From: Aditya Siregar Date: Tue, 2 Sep 2025 16:25:13 +0700 Subject: [PATCH 10/10] fix api url --- src/services/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/api.ts b/src/services/api.ts index ab43ede..7dc7a13 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -6,7 +6,7 @@ const getToken = () => { } export const api = axios.create({ - baseURL: process.env.NEXT_PUBLIC_API_URL, + baseURL: 'https://api-pos.apskel.id/api/v1', headers: { 'Content-Type': 'application/json' },