diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..c550055
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,7 @@
+Dockerfile
+.dockerignore
+node_modules
+npm-debug.log
+README.md
+.next
+.git
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..cb73d10
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,49 @@
+name: build
+
+on:
+ push:
+ tags:
+ - "v*.*.*"
+
+jobs:
+ docker:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Docker meta
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ # list of Docker images to use as base name for tags
+ images: |
+ ${{ secrets.DOCKER_REGISTRY }}oyoon
+
+ # generate Docker tags based on the following events/attributes
+ tags: |
+ type=ref,event=branch
+ type=semver,pattern={{major}}
+ type=semver,pattern={{major}}.{{minor}}
+ type=semver,pattern={{version}}
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v3
+ with:
+ registry: ${{ secrets.DOCKER_REGISTRY }}
+ username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
+ password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
+
+ - name: Build and push
+ uses: docker/build-push-action@v5
+ with:
+ push: true
+ context: "{{defaultContext}}"
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..9b6a0e9
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,59 @@
+FROM node:18-alpine AS base
+
+# Install dependencies only when needed
+FROM base AS deps
+# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
+RUN apk add --no-cache libc6-compat
+WORKDIR /app
+
+# Install dependencies based on the preferred package manager
+COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
+RUN \
+ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
+ elif [ -f package-lock.json ]; then npm ci; \
+ elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
+ else echo "Lockfile not found." && exit 1; \
+ fi
+
+
+# Rebuild the source code only when needed
+FROM base AS builder
+WORKDIR /app
+COPY --from=deps /app/node_modules ./node_modules
+COPY . .
+
+# Next.js collects completely anonymous telemetry data about general usage.
+# Learn more here: https://nextjs.org/telemetry
+# Uncomment the following line in case you want to disable telemetry during the build.
+# ENV NEXT_TELEMETRY_DISABLED 1
+
+RUN yarn build
+
+# If using npm comment out above and use below instead
+# RUN npm run build
+
+# Production image, copy all the files and run next
+FROM base AS runner
+WORKDIR /app
+
+ENV NODE_ENV production
+# Uncomment the following line in case you want to disable telemetry during runtime.
+# ENV NEXT_TELEMETRY_DISABLED 1
+
+RUN addgroup --system --gid 1001 nodejs
+RUN adduser --system --uid 1001 nextjs
+
+COPY --from=builder /app/public ./public
+
+# Automatically leverage output traces to reduce image size
+# https://nextjs.org/docs/advanced-features/output-file-tracing
+COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
+COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
+
+USER nextjs
+
+EXPOSE 6679
+
+ENV PORT 6679
+
+CMD ["node", "server.js"]
\ No newline at end of file
diff --git a/app/UserPanel/(Admin)/AdminDashboard/KeysManagement/page.tsx b/app/UserPanel/(Admin)/AdminDashboard/KeysManagement/page.tsx
deleted file mode 100644
index 24aea02..0000000
--- a/app/UserPanel/(Admin)/AdminDashboard/KeysManagement/page.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import AdminKeysManagement from '@/components/AdminKeysManagement'
-import React from 'react'
-
-export default function page() {
- return (
-
- شروع به کار سامانه سوت زنی + شروع به کار سامانه عیون
این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور diff --git a/components/AdminDashboard.tsx b/components/AdminDashboard.tsx deleted file mode 100644 index 066e55e..0000000 --- a/components/AdminDashboard.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from "react"; -import BoxDashboard from "./BoxDashboard"; -import LineChart from "./LineChart"; -import { HorizontalChart } from "./HorizontalChart"; -import { VerticalChart } from "./VerticalChart"; -import { PieChart } from "./PieChart"; - -export default function AdminDashboard() { - return ( -
- کلید عمومی : -
-- {data2?.publicKey} -
- -- کلید خصوصی : -
-- {data2?.privateKey} -
-- عنوان کلید : - {item.title} -
-- آی دی بازرس : - - {item.inspectorId} - -
-- {item.name} -
-- {item.count} -
-دستگاه مربوطه:{" "} - {/* {data.title} */} + {data?.complaintOrganization + ? data?.complaintOrganization.title + : "-"}
diff --git a/components/ControllerDashboard.tsx b/components/ControllerDashboard.tsx deleted file mode 100644 index 103628d..0000000 --- a/components/ControllerDashboard.tsx +++ /dev/null @@ -1,73 +0,0 @@ -"use client"; -import React from "react"; -import BoxDashboard from "./BoxDashboard"; -import LineChart from "./LineChart"; -import { HorizontalChart } from "./HorizontalChart"; -import { getComplaintsList } from "@/utils/inspectorApi"; -import { useQuery } from "@tanstack/react-query"; -import useDecrypt from "@/hooks/useDecrypt"; - -export default function ControllerDashboard() { - const { data, isLoading, refetch } = useQuery({ - queryKey: ["ComplaintsList"], - queryFn: () => getComplaintsList(), - refetchOnWindowFocus: false, - }); - console.log(data); - const [decryptedMessage, errorMessage] = useDecrypt( - "gJoT9AqK7wk1MZFSD04yXXfF36fzsOL+RYtJfySrEnQeJ7VoaL7pmOU6nB3+0+PQcaxIi3hf1AHjzIB0Cn5oHgKROeoI4XslhAezZk23QhtIU4HUF1wpeOJfA+4hWyRfbh4fI9774sa/KL47VaBbrNM/rvBxk6hjlKx5mTb3hqM=" - ); - console.log(decryptedMessage); - if (data) { - } - console.log(errorMessage); - if (data) { - } - return ( -