Skip to content

Commit 63a30a0

Browse files
committed
first commit from first user
0 parents  commit 63a30a0

File tree

140 files changed

+20234
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+20234
-0
lines changed

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
42+
43+
/app/generated/prisma

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
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.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.

actions/admin-actions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"use server"
2+
3+
export const createCustomerAccount = async () => {
4+
5+
}

actions/user.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
'use server'
2+
3+
import { UserProps } from "@/types/types";
4+
import { db } from "@/prisma/db";
5+
import bcrypt from "bcrypt"
6+
7+
export async function createUser (data: UserProps) {
8+
const {email, password, name} = data;
9+
try {
10+
const hashedPassword = await bcrypt.hash(password, 10);
11+
const existingUser = await db.user.findUnique({
12+
where: {
13+
email,
14+
},
15+
});
16+
17+
if (existingUser) {
18+
return {
19+
error: `Email already exists`,
20+
status: 409,
21+
data: null,
22+
};
23+
};
24+
25+
const newUser = await db.user.create({
26+
data: {
27+
email,
28+
password: hashedPassword,
29+
name
30+
},
31+
});
32+
33+
return {
34+
error: null,
35+
status: 200,
36+
data: newUser
37+
};
38+
}catch (error) {
39+
console.log(error);
40+
return {
41+
error: `Something Went Wrong, Please try again`,
42+
status: 500,
43+
data: null,
44+
};
45+
}
46+
47+
}

app/(auth)/login/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import LoginForm from "@/components/forms/login-form";
2+
3+
export default async function page() {
4+
5+
return (
6+
<section>
7+
<LoginForm />
8+
</section>
9+
);
10+
}

app/(auth)/register/page.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
import RegisterForm from "@/components/forms/register-form";
3+
import React from "react";
4+
5+
export default function page() {
6+
return (
7+
<section>
8+
<div className="md:container px-4 md:px-0">
9+
<div className="border-gray-200 dark:border-gray-700 max-w-xl mx-auto border my-3 mt-6 shadow rounded-md ">
10+
<RegisterForm />
11+
</div>
12+
</div>
13+
</section>
14+
);
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { AdminDashboarPage } from '@/components/clients/admin-client-components'
2+
3+
const DashboardPage = () => {
4+
return (
5+
<div>
6+
<AdminDashboarPage/>
7+
</div>
8+
)
9+
}
10+
11+
export default DashboardPage
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { DeviceManagement } from "@/components/clients/admin-client-components"
2+
3+
export default function DeviceManagementPage() {
4+
return <DeviceManagement />
5+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type React from "react"
2+
import { SidebarProvider, SidebarInset, SidebarTrigger } from "@/components/ui/sidebar"
3+
import { AdminSidebar } from "@/components/clients/admin-client-components/admin-sidebar"
4+
import { Separator } from "@/components/ui/separator"
5+
import { Search, Filter } from "lucide-react"
6+
import { Input } from "@/components/ui/input"
7+
import { Button } from "@/components/ui/button"
8+
import { Suspense } from "react"
9+
10+
export default function AdminLayout({ children }: { children: React.ReactNode }) {
11+
return (
12+
<SidebarProvider>
13+
<AdminSidebar />
14+
<SidebarInset>
15+
<Suspense fallback={<div>Loading...</div>}>
16+
<header className="flex h-16 shrink-0 items-center gap-2 border-b px-4">
17+
<SidebarTrigger className="-ml-1" />
18+
<Separator orientation="vertical" className="mr-2 h-4" />
19+
<div className="flex flex-1 items-center gap-2">
20+
<div className="relative flex-1 max-w-md">
21+
<Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
22+
<Input placeholder="Search..." className="pl-8" />
23+
</div>
24+
<Button variant="outline" size="icon">
25+
<Filter className="h-4 w-4" />
26+
</Button>
27+
</div>
28+
</header>
29+
<main className="flex flex-1 flex-col gap-4 p-4">{children}</main>
30+
</Suspense>
31+
</SidebarInset>
32+
</SidebarProvider>
33+
)
34+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This page is a placeholder for the Reports section in the Admin Dashboard.
2+
// You can integrate the existing ReportsPage component here or create a new one
3+
// tailored for admin-specific reporting needs.
4+
5+
import { ReportsPageClient } from "@/components/clients/reports-page"
6+
7+
export default function AdminReportsPage() {
8+
return (
9+
<div className="flex flex-col gap-4">
10+
<h1 className="text-2xl font-bold">Admin Reports</h1>
11+
<p className="text-muted-foreground">Access and generate comprehensive reports for fleet and user activity.</p>
12+
<ReportsPageClient /> {/* Reusing the existing ReportsPage component */}
13+
</div>
14+
)
15+
}

0 commit comments

Comments
 (0)