From 5c5333d2397702e25fa979ef748819037f3f59a7 Mon Sep 17 00:00:00 2001
From: YuanHui <31339626+alsesa@users.noreply.github.com>
Date: Fri, 11 Jul 2025 15:52:31 +0800
Subject: [PATCH] Initial commit
---
.env.example | 13 +
.eslintrc.json | 6 +
.gitattributes | 2 +
.gitignore | 36 +
README.md | 5 +
app/dashboard/(overview)/loading.tsx | 5 +
app/dashboard/(overview)/page.tsx | 48 +
app/dashboard/customers/page.tsx | 3 +
.../invoices/[id]/edit/not-found.tsx | 18 +
app/dashboard/invoices/[id]/edit/page.tsx | 33 +
app/dashboard/invoices/create/page.tsx | 23 +
app/dashboard/invoices/error.tsx | 31 +
app/dashboard/invoices/page.tsx | 45 +
app/dashboard/layout.tsx | 14 +
app/favicon.ico | Bin 0 -> 15086 bytes
app/layout.tsx | 23 +
app/lib/actions.ts | 132 +
app/lib/data.ts | 218 +
app/lib/definitions.ts | 88 +
app/lib/placeholder-data.ts | 147 +
app/lib/utils.ts | 69 +
app/login/page.tsx | 20 +
app/opengraph-image.png | Bin 0 -> 243189 bytes
app/page.tsx | 60 +
app/query/route.ts | 26 +
app/seed/route.ts | 117 +
app/ui/acme-logo.tsx | 13 +
app/ui/button.tsx | 19 +
app/ui/customers/table.tsx | 123 +
app/ui/dashboard/cards.tsx | 60 +
app/ui/dashboard/latest-invoices.tsx | 62 +
app/ui/dashboard/nav-links.tsx | 48 +
app/ui/dashboard/revenue-chart.tsx | 64 +
app/ui/dashboard/sidenav.tsx | 35 +
app/ui/fonts.ts | 5 +
app/ui/global.css | 18 +
app/ui/home.module.css | 7 +
app/ui/invoices/breadcrumbs.tsx | 36 +
app/ui/invoices/buttons.tsx | 39 +
app/ui/invoices/create-form.tsx | 152 +
app/ui/invoices/edit-form.tsx | 128 +
app/ui/invoices/pagination.tsx | 129 +
app/ui/invoices/status.tsx | 29 +
app/ui/invoices/table.tsx | 124 +
app/ui/login-form.tsx | 84 +
app/ui/search.tsx | 37 +
app/ui/skeletons.tsx | 218 +
auth.config.ts | 21 +
auth.ts | 43 +
middleware.ts | 9 +
next.config.ts | 10 +
package.json | 40 +
pnpm-lock.yaml | 4462 +++++++++++++++++
postcss.config.js | 6 +
public/customers/amy-burns.png | Bin 0 -> 7954 bytes
public/customers/balazs-orban.png | Bin 0 -> 7951 bytes
public/customers/delba-de-oliveira.png | Bin 0 -> 5824 bytes
public/customers/evil-rabbit.png | Bin 0 -> 1019 bytes
public/customers/lee-robinson.png | Bin 0 -> 5653 bytes
public/customers/michael-novotny.png | Bin 0 -> 9902 bytes
public/hero-desktop.png | Bin 0 -> 498319 bytes
public/hero-mobile.png | Bin 0 -> 116387 bytes
tailwind.config.ts | 32 +
tsconfig.json | 35 +
64 files changed, 7270 insertions(+)
create mode 100644 .env.example
create mode 100644 .eslintrc.json
create mode 100644 .gitattributes
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 app/dashboard/(overview)/loading.tsx
create mode 100644 app/dashboard/(overview)/page.tsx
create mode 100644 app/dashboard/customers/page.tsx
create mode 100644 app/dashboard/invoices/[id]/edit/not-found.tsx
create mode 100644 app/dashboard/invoices/[id]/edit/page.tsx
create mode 100644 app/dashboard/invoices/create/page.tsx
create mode 100644 app/dashboard/invoices/error.tsx
create mode 100644 app/dashboard/invoices/page.tsx
create mode 100644 app/dashboard/layout.tsx
create mode 100644 app/favicon.ico
create mode 100644 app/layout.tsx
create mode 100644 app/lib/actions.ts
create mode 100644 app/lib/data.ts
create mode 100644 app/lib/definitions.ts
create mode 100644 app/lib/placeholder-data.ts
create mode 100644 app/lib/utils.ts
create mode 100644 app/login/page.tsx
create mode 100644 app/opengraph-image.png
create mode 100644 app/page.tsx
create mode 100644 app/query/route.ts
create mode 100644 app/seed/route.ts
create mode 100644 app/ui/acme-logo.tsx
create mode 100644 app/ui/button.tsx
create mode 100644 app/ui/customers/table.tsx
create mode 100644 app/ui/dashboard/cards.tsx
create mode 100644 app/ui/dashboard/latest-invoices.tsx
create mode 100644 app/ui/dashboard/nav-links.tsx
create mode 100644 app/ui/dashboard/revenue-chart.tsx
create mode 100644 app/ui/dashboard/sidenav.tsx
create mode 100644 app/ui/fonts.ts
create mode 100644 app/ui/global.css
create mode 100644 app/ui/home.module.css
create mode 100644 app/ui/invoices/breadcrumbs.tsx
create mode 100644 app/ui/invoices/buttons.tsx
create mode 100644 app/ui/invoices/create-form.tsx
create mode 100644 app/ui/invoices/edit-form.tsx
create mode 100644 app/ui/invoices/pagination.tsx
create mode 100644 app/ui/invoices/status.tsx
create mode 100644 app/ui/invoices/table.tsx
create mode 100644 app/ui/login-form.tsx
create mode 100644 app/ui/search.tsx
create mode 100644 app/ui/skeletons.tsx
create mode 100644 auth.config.ts
create mode 100644 auth.ts
create mode 100644 middleware.ts
create mode 100644 next.config.ts
create mode 100644 package.json
create mode 100644 pnpm-lock.yaml
create mode 100644 postcss.config.js
create mode 100644 public/customers/amy-burns.png
create mode 100644 public/customers/balazs-orban.png
create mode 100644 public/customers/delba-de-oliveira.png
create mode 100644 public/customers/evil-rabbit.png
create mode 100644 public/customers/lee-robinson.png
create mode 100644 public/customers/michael-novotny.png
create mode 100644 public/hero-desktop.png
create mode 100644 public/hero-mobile.png
create mode 100644 tailwind.config.ts
create mode 100644 tsconfig.json
diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..8a85ba7
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,13 @@
+# Copy from .env.local on the Vercel dashboard
+# https://nextjs.org/learn/dashboard-app/setting-up-your-database#create-a-postgres-database
+POSTGRES_URL=
+POSTGRES_PRISMA_URL=
+POSTGRES_URL_NON_POOLING=
+POSTGRES_USER=
+POSTGRES_HOST=
+POSTGRES_PASSWORD=
+POSTGRES_DATABASE=
+
+# `openssl rand -base64 32`
+AUTH_SECRET=
+AUTH_URL=http://localhost:3000/api/auth
\ No newline at end of file
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..6b10a5b
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,6 @@
+{
+ "extends": [
+ "next/core-web-vitals",
+ "next/typescript"
+ ]
+}
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..dfe0770
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..45c1abc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,36 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env*.local
+.env
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6a520de
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+## Next.js App Router Course - Starter
+
+This is the starter template for the Next.js App Router Course. It contains the starting code for the dashboard application.
+
+For more information, see the [course curriculum](https://nextjs.org/learn) on the Next.js Website.
diff --git a/app/dashboard/(overview)/loading.tsx b/app/dashboard/(overview)/loading.tsx
new file mode 100644
index 0000000..bec9b2a
--- /dev/null
+++ b/app/dashboard/(overview)/loading.tsx
@@ -0,0 +1,5 @@
+import DashboardSkeleton from "../../ui/skeletons";
+
+export default function Loading() {
+ return
+ Dashboard
+
+
Customers Page
; +} \ No newline at end of file diff --git a/app/dashboard/invoices/[id]/edit/not-found.tsx b/app/dashboard/invoices/[id]/edit/not-found.tsx new file mode 100644 index 0000000..1373306 --- /dev/null +++ b/app/dashboard/invoices/[id]/edit/not-found.tsx @@ -0,0 +1,18 @@ +import Link from 'next/link'; +import { FaceFrownIcon } from '@heroicons/react/24/outline'; + +export default function NotFound() { + return ( +Could not find the requested invoice.
+ + Go Back + +