From 885cb00e2941145c31aa0a8b87605ba05c59f3f7 Mon Sep 17 00:00:00 2001 From: Ichsan Kurniawan Date: Wed, 28 Jan 2026 20:01:35 +0700 Subject: [PATCH] fixing bug or error when build --- README.md | 19 +++++++++ app/(dashboard)/presence-v2/page.tsx | 4 -- app/(dashboard)/profile/page.tsx | 2 +- app/admin/day-off/page.tsx | 4 +- app/api/revalidate/route.ts | 3 +- app/layout.tsx | 2 +- app/providers/AntdConfigProvider.tsx | 41 ------------------- app/providers/ClientProvider.tsx | 20 --------- app/providers/ProgressBarProvider.tsx | 20 --------- app/providers/SessionProvider.tsx | 59 --------------------------- app/providers/ThemeProvider.tsx | 8 ---- package.json | 4 +- 12 files changed, 27 insertions(+), 159 deletions(-) delete mode 100644 app/providers/AntdConfigProvider.tsx delete mode 100644 app/providers/ClientProvider.tsx delete mode 100644 app/providers/ProgressBarProvider.tsx delete mode 100644 app/providers/SessionProvider.tsx delete mode 100644 app/providers/ThemeProvider.tsx diff --git a/README.md b/README.md index e215bc4..2009be1 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,22 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. + +## Deploy on VPS + +```bash +git clone hats-app.git +# then +cd hats-app +# then +npm install +# then +npm run build +# then +pm2 start npm --name "new-hats-app" -- start +``` + +```bash +# command +git clone https://ichsankurnia:@github.com/ichsankurnia/hats-app.git +``` diff --git a/app/(dashboard)/presence-v2/page.tsx b/app/(dashboard)/presence-v2/page.tsx index 77b9df6..28b1cba 100644 --- a/app/(dashboard)/presence-v2/page.tsx +++ b/app/(dashboard)/presence-v2/page.tsx @@ -7,10 +7,6 @@ import fetchData from '@/lib/fetchData'; const FormComponent = lazy(() => import('./components/FormComponent')) -export const metadata: Metadata = { - title: "Presence - HIS Attendance Task System (H.A.T.s)", -} - export async function generateMetadata({ searchParams }: any): Promise { const checkout = (await searchParams)?.checkout const title = checkout === 'true' ? 'Check-out Presence' : 'Check-in Presence' diff --git a/app/(dashboard)/profile/page.tsx b/app/(dashboard)/profile/page.tsx index 584b7a4..4338ae1 100644 --- a/app/(dashboard)/profile/page.tsx +++ b/app/(dashboard)/profile/page.tsx @@ -22,7 +22,7 @@ export async function generateMetadata(): Promise { const session = await getServerSession(authOptions) return { - title: `${session?.user?.detail.fullname || 'User'}'s Profile`, + title: `${session?.user?.detail.fullname || 'User'}'s Profile - H.A.T.s`, } } diff --git a/app/admin/day-off/page.tsx b/app/admin/day-off/page.tsx index c12b3a1..5d95213 100644 --- a/app/admin/day-off/page.tsx +++ b/app/admin/day-off/page.tsx @@ -2,7 +2,7 @@ import { type Metadata } from 'next'; import { Suspense, lazy } from 'react'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import LazyLoading from '@/components/loader/LazyLoading'; -import fetchData from '@/lib/'; +import fetchData from '@/lib/fetchData'; const ComponentPage = lazy(() => import('./component')); @@ -12,7 +12,7 @@ export const metadata: Metadata = { export default async function DeviceTypePage() { - const data = await ('/dayoff') + const data = await fetchData('/dayoff') return ( <> diff --git a/app/api/revalidate/route.ts b/app/api/revalidate/route.ts index b7f31c2..c22ff21 100644 --- a/app/api/revalidate/route.ts +++ b/app/api/revalidate/route.ts @@ -3,6 +3,7 @@ import { revalidateTag } from 'next/cache' export async function GET(request: NextRequest) { const tag = request.nextUrl.searchParams.get('tag') - revalidateTag(tag!) + revalidateTag(tag!, { expire: 24 * 60 * 60 }) + return NextResponse.json({ revalidated: true, now: Date.now() }) } \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index a865423..0e2ab09 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -11,7 +11,7 @@ import { ThemeProvider } from '@/providers/ThemeProvider' import SessionProvider from '@/providers/SessionProvider' import { Toaster } from '@/components/ui/sonner'; import AntdConfigProvider from '@/providers/AntdConfigProvider'; -import ProgressBarProviders from './providers/ProgressBarProvider'; +import ProgressBarProviders from '@/providers/ProgressBarProvider'; const jakarta = Plus_Jakarta_Sans({ subsets: ['latin'] }) diff --git a/app/providers/AntdConfigProvider.tsx b/app/providers/AntdConfigProvider.tsx deleted file mode 100644 index 35ecc4e..0000000 --- a/app/providers/AntdConfigProvider.tsx +++ /dev/null @@ -1,41 +0,0 @@ -'use client' - -import { FC, ReactNode } from 'react'; -import { ConfigProvider, theme as antdTheme } from "antd"; -import { useTheme } from 'next-themes'; -import { Inter } from 'next/font/google' -// import { StyleProvider } from '@ant-design/cssinjs'; - -const inter = Inter({ subsets: ['latin'] }) - -type Props = { - children: ReactNode -}; - -const AntdConfigProvider: FC = ({ children }) => { - const { systemTheme, theme } = useTheme() - const { defaultAlgorithm, darkAlgorithm } = antdTheme; - - return ( - - {/* */} - {children} - {/* */} - - ); -} - -export default AntdConfigProvider; \ No newline at end of file diff --git a/app/providers/ClientProvider.tsx b/app/providers/ClientProvider.tsx deleted file mode 100644 index eef75bc..0000000 --- a/app/providers/ClientProvider.tsx +++ /dev/null @@ -1,20 +0,0 @@ -'use client' - -import React from 'react'; -import { Toaster } from "@/components/ui/toaster" - -type Props = {}; - -const ClientProvider: React.FC = () => { - return ( - <> - - - {/* OTHER CLIENT LIBRARY */} - {/* OTHER CLIENT LIBRARY */} - {/* OTHER CLIENT LIBRARY */} - - ); -} - -export default ClientProvider; \ No newline at end of file diff --git a/app/providers/ProgressBarProvider.tsx b/app/providers/ProgressBarProvider.tsx deleted file mode 100644 index da8d152..0000000 --- a/app/providers/ProgressBarProvider.tsx +++ /dev/null @@ -1,20 +0,0 @@ -'use client'; - -import { ProgressProvider } from '@bprogress/next/app'; - -const ProgressBarProviders = ({ children }: { children: React.ReactNode }) => { - return ( - <> - - {children} - - - ); -}; - -export default ProgressBarProviders; \ No newline at end of file diff --git a/app/providers/SessionProvider.tsx b/app/providers/SessionProvider.tsx deleted file mode 100644 index a76af1b..0000000 --- a/app/providers/SessionProvider.tsx +++ /dev/null @@ -1,59 +0,0 @@ -'use client' - -import { ReactNode } from 'react'; -import { type Session } from 'next-auth'; -import { SessionProvider as Provider } from 'next-auth/react' - -type Props = { - children: ReactNode, - session: Session | null - basePath?: string -}; - -// function AppProvider({ children, basePath }: { children: ReactNode, basePath: string }) { -// const data = useSession({ -// required: true, -// onUnauthenticated: () => { -// window.location.replace(`${basePath}/auth?error=SessionRequired&callbackUrl=${window.location.href}`) -// } -// }) - -// // ... custom code - -// return ( -// <>{children} -// ) -// } - - -// const SessionProvider: React.FC = ({ children, session, basePath }) => { -// return ( -// <> -// default (0) */ -// // refetchInterval={5 * 60} -// /* Re-fetches session when window is focused => default (true), Use this value if not using refresh token */ -// // refetchOnWindowFocus={false} -// > -// {/* */} -// {children} -// {/* */} -// -// -// ); -// } - -const SessionProvider: React.FC = ({ children, session }) => { - return ( - <> - - {children} - - - ); -} - -export default SessionProvider; \ No newline at end of file diff --git a/app/providers/ThemeProvider.tsx b/app/providers/ThemeProvider.tsx deleted file mode 100644 index 9f52f99..0000000 --- a/app/providers/ThemeProvider.tsx +++ /dev/null @@ -1,8 +0,0 @@ -"use client" - -import { ThemeProvider as NextThemesProvider } from "next-themes" -import { type ThemeProviderProps } from "next-themes/dist/types" - -export function ThemeProvider({ children, ...props }: ThemeProviderProps) { - return {children} -} \ No newline at end of file diff --git a/package.json b/package.json index 322bea5..e300042 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "author": "ichsankurnia", "repository": { "type": "git", - "url": "git+https://github.com/ichsankurnia/his-super-apps.git" + "url": "git+https://github.com/ichsankurnia/hats-app.git" }, "bugs": { - "url": "https://github.com/ichsankurnia/his-super-apps/issues" + "url": "https://github.com/ichsankurnia/hats-app/issues" }, "scripts": { "dev": "next dev -p 1209",