Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
334 changes: 245 additions & 89 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
"axios": "^1.7.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dompurify": "^3.1.7",
"framer-motion": "^11.11.9",
"lottie-react": "^2.4.0",
"lucide-react": "^0.400.0",
"next": "^14.2.5",
"radix-ui": "^1.0.1",
"react": "^18.3.1",
"react-chartjs-2": "^5.2.0",
"react-circular-progressbar": "^2.1.0",
"react-dom": "^18.3.1",
"react-hook-form": "^7.52.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.25.0",
"react-spinners": "^0.14.1",
"react-toastify": "^10.0.5",
Expand All @@ -31,6 +37,8 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@types/dompurify": "^3.0.5",
"@types/js-cookie": "^3.0.6",
"@types/node": "^20.14.9",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
Expand All @@ -45,6 +53,6 @@
"postcss": "^8.4.39",
"tailwindcss": "^3.4.4",
"typescript": "^5.2.2",
"vite": "^5.3.1"
"vite": "^5.4.9"
}
}
1 change: 1 addition & 0 deletions public/assets/todo_pending_animation.json

Large diffs are not rendered by default.

32 changes: 19 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import './App.css';
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
import Mentors from './pages/root/mentor';

import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Dashboard from './pages/root/dashboard';
import Mentors from './pages/root/mentor';
import Login from './pages/auth/Login';
import Singup from './pages/auth/Singup';
import ForgotPassword from './pages/auth/ForgotPassword';
import Signup from './pages/auth/Singup';
import ForgotPassword from './pages/auth/ForgotPassword';
import Student from './pages/student';
import MainLayout from './pages/root/layout';
import Mentordashboard from './pages/root/mentordashboard';

function App() {
return (
<BrowserRouter>
<Routes>
<Route path='/' element={<Navigate to="/login" />} />
<Route path='/mentors' element={<Mentors />} />
<Route path='/login' element={<Login />} />
<Route path='/signup' element={<Singup />} />
<Route path='/forgotpassword' element={<ForgotPassword />} />
<Route path='/studentdetails/:id' element={<Student />} />
</Routes>
<MainLayout>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/mentordashboard" element={<Mentordashboard />}/>
<Route path="/mentors" element={<Mentors />} />
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route path="/forgotpassword" element={<ForgotPassword />} />
<Route path="/studentdetails/:id" element={<Student />} />
</Routes>
</MainLayout>
</BrowserRouter>
);
}
Expand Down
122 changes: 122 additions & 0 deletions src/actions/planner_actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
"use server";

import { getCookie } from "./cookie_actions";
import { revalidateTag } from "next/cache";

export const getPlanner = async () => {
const token = await getCookie("token");

try {
const res = await fetch(
`${process.env.NEXT_PUBLIC_STUDENT_API_BASE_URL}/api/planner/get`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
Cookie: `token=${token}`,
},
credentials: "include",
// cache: "force-cache",
next: {
tags: ["plannerData"],
},
}
);

const responseData = await res.json();

return responseData;
} catch (error: unknown) {
if (error instanceof Error) {
throw new Error(`Error fetching planner data: ${error.message}`);
} else {
throw new Error("An unknown error occurred while fetching planner data!");
}
}
};

export const createPlanner = async () => {
const token = await getCookie("token");

try {
const res = await fetch(
`${process.env.NEXT_PUBLIC_STUDENT_API_BASE_URL}/api/planner/create`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
Cookie: `token=${token}`,
},
credentials: "include",
}
);

const responseData = await res.json();

return responseData;
} catch (error: unknown) {
if (error instanceof Error) {
throw new Error(`Error creating planner: ${error.message}`);
} else {
throw new Error("An unknown error occurred while creating planner!");
}
}
};

export const updatePlanner = async () => {
const token = await getCookie("token");

try {
const res = await fetch(
`${process.env.NEXT_PUBLIC_STUDENT_API_BASE_URL}/api/planner/update`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
Cookie: `token=${token}`,
},
credentials: "include",
}
);

const responseData = await res.json();
revalidateTag("plannerData");

return responseData;
} catch (error: unknown) {
if (error instanceof Error) {
throw new Error(`Error creating planner: ${error.message}`);
} else {
throw new Error("An unknown error occurred while creating planner!");
}
}
};

export const allocateBackTopics = async () => {
const token = await getCookie("token");

try {
const res = await fetch(
`${process.env.NEXT_PUBLIC_STUDENT_API_BASE_URL}/api/planner/allocateTopics`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
Cookie: `token=${token}`,
},
credentials: "include",
}
);

const responseData = await res.json();
revalidateTag("plannerData");

return responseData;
} catch (error: unknown) {
if (error instanceof Error) {
throw new Error(`Error creating planner: ${error.message}`);
} else {
throw new Error("An unknown error occurred while creating planner!");
}
}
};
3 changes: 3 additions & 0 deletions src/apiClient/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import axios from 'axios';

const apiClient = axios.create({
baseURL: import.meta.env.VITE_PUBLIC_ADMIN_API_BASE_URL,

withCredentials: true,
headers: {
'Content-Type': 'application/json',
},

});
console.log(import.meta.env.VITE_PUBLIC_ADMIN_API_BASE_URL);

apiClient.interceptors.request.use(
(config) => {
Expand Down
1 change: 1 addition & 0 deletions src/assets/todo_pending_animation.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions src/components/icons/AttachIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { IIconProps } from "../../helpers/types";
import { cn } from "../../lib/utils";

const AttachIcon = ({ className, ...props }: IIconProps) => {
return (
<svg
viewBox="0 0 19 31"
xmlns="http://www.w3.org/2000/svg"
className={cn(
"w-[10px] h-5 stroke-[#6a6a6a] stroke-[3] fill-none",
className
)}
{...props}>
<path
d="M17 11L17 20C17 24.9706 13.6421 29 9.5 29C5.35786 29 2 24.9706 2 20L2 8C2 4.68629 4.23858 2 7 2C9.76142 2 12 4.68629 12 8L12 20C12 21.6569 10.8807 23 9.5 23C8.11929 23 7 21.6569 7 20L7 8"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};

export default AttachIcon;
20 changes: 20 additions & 0 deletions src/components/icons/CallIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { IIconProps } from "../../helpers/types";
import { cn } from "../../lib/utils";

const CallIcon = ({ className, ...props }: IIconProps) => {
return (
<svg
viewBox="0 0 33 33"
xmlns="http://www.w3.org/2000/svg"
className={cn("w-5 h-5 fill-none stroke-black stroke-[2.6]", className)}
{...props}>
<path
d="M23.2865 31.0698C12.8729 28.2243 4.78215 19.8461 2.30183 9.33959C1.36286 5.36218 4.82893 2.05775 8.91506 2.12908L10.7647 2.16136C11.7862 2.17919 12.5901 3.02365 12.6732 4.04196C12.8134 5.7624 13.1898 7.41786 13.7703 8.97518L10.9112 11.7363C13.0186 16.345 16.6593 20.115 21.1917 22.3821L24.0509 19.621C25.587 20.2555 27.2283 20.6895 28.9428 20.8897C29.9576 21.0082 30.7735 21.8411 30.7557 22.8626L30.7234 24.7123C30.6521 28.7984 27.2287 32.147 23.2865 31.0698Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};

export default CallIcon;
25 changes: 25 additions & 0 deletions src/components/icons/ChatIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { IIconProps } from "../../helpers/types";
import { cn } from "../../lib/utils";

const ChatIcon = ({ className, ...props }: IIconProps) => {
return (
<svg
viewBox="0 0 21 19"
xmlns="http://www.w3.org/2000/svg"
className={cn("w-3 h-3 fill-none stroke-black stroke-2", className)}
{...props}>
<path
d="M17.0769 1H3.92308C3.14783 1 2.40433 1.32565 1.85615 1.90531C1.30797 2.48496 1 3.27115 1 4.09091V11.8182C1 12.6379 1.30797 13.4241 1.85615 14.0038C2.40433 14.5834 3.14783 14.9091 3.92308 14.9091H11.9615L16.3462 18V14.9091H17.0769C17.8522 14.9091 18.5957 14.5834 19.1438 14.0038C19.692 13.4241 20 12.6379 20 11.8182V4.09091C20 3.27115 19.692 2.48496 19.1438 1.90531C18.5957 1.32565 17.8522 1 17.0769 1Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M7.42857 7.61579C7.42857 7.77911 7.35332 7.93574 7.21936 8.05122C7.08541 8.1667 6.90373 8.23158 6.71429 8.23158C6.52485 8.23158 6.34316 8.1667 6.20921 8.05122C6.07526 7.93574 6 7.77911 6 7.61579C6 7.45247 6.07526 7.29584 6.20921 7.18036C6.34316 7.06488 6.52485 7 6.71429 7C6.90373 7 7.08541 7.06488 7.21936 7.18036C7.35332 7.29584 7.42857 7.45247 7.42857 7.61579ZM11.7143 7.61579C11.7143 7.77911 11.639 7.93574 11.5051 8.05122C11.3711 8.1667 11.1894 8.23158 11 8.23158C10.8106 8.23158 10.6289 8.1667 10.4949 8.05122C10.361 7.93574 10.2857 7.77911 10.2857 7.61579C10.2857 7.45247 10.361 7.29584 10.4949 7.18036C10.6289 7.06488 10.8106 7 11 7C11.1894 7 11.3711 7.06488 11.5051 7.18036C11.639 7.29584 11.7143 7.45247 11.7143 7.61579ZM16 7.61579C16 7.77911 15.9247 7.93574 15.7908 8.05122C15.6568 8.1667 15.4752 8.23158 15.2857 8.23158C15.0963 8.23158 14.9146 8.1667 14.7806 8.05122C14.6467 7.93574 14.5714 7.77911 14.5714 7.61579C14.5714 7.45247 14.6467 7.29584 14.7806 7.18036C14.9146 7.06488 15.0963 7 15.2857 7C15.4752 7 15.6568 7.06488 15.7908 7.18036C15.9247 7.29584 16 7.45247 16 7.61579Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};

export default ChatIcon;
20 changes: 20 additions & 0 deletions src/components/icons/ChatIcon3.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { IIconProps } from "../../helpers/types";
import { cn } from "../../lib/utils";

const ChatIcon3 = ({ className, ...props }: IIconProps) => {
return (
<svg
viewBox="0 0 19 18"
xmlns="http://www.w3.org/2000/svg"
className={cn("w-5 h-5 fill-none stroke-2", className)}
{...props}>
<path
d="M9.5 17C14.1944 17 18 13.4183 18 9C18 4.58172 14.1944 1 9.5 1C4.80558 1 1 4.58172 1 9C1 10.3223 1.34088 11.5697 1.94444 12.6686L1 17L5.60209 16.1111C6.76965 16.6792 8.09501 17 9.5 17Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};

export default ChatIcon3;
20 changes: 20 additions & 0 deletions src/components/icons/ClockIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { IIconProps } from "../../helpers/types";
import { cn } from "../../lib/utils";

const ClockIcon = ({ className, ...props }: IIconProps) => {
return (
<svg
viewBox="0 0 13 13"
xmlns="http://www.w3.org/2000/svg"
className={cn("w-3 h-3 stroke-primary fill-none stroke-[1.5]", className)}
{...props}>
<path
d="M6.42857 3.4127V6.42857H9.44444M6.42857 11.8571C3.43045 11.8571 1 9.42669 1 6.42857C1 3.43045 3.43045 1 6.42857 1C9.42669 1 11.8571 3.43045 11.8571 6.42857C11.8571 9.42669 9.42669 11.8571 6.42857 11.8571Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};

export default ClockIcon;
20 changes: 20 additions & 0 deletions src/components/icons/ConferenceMeetingIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { IIconProps } from "../../helpers/types";
import { cn } from "../../lib/utils";

const ConferenceMeetingIcon = ({ className, ...props }: IIconProps) => {
return (
<svg
viewBox="0 0 17 14"
xmlns="http://www.w3.org/2000/svg"
className={cn("w-3 h-3 stroke-[#6399D6] fill-none stroke-2", className)}
{...props}>
<path
d="M12.2 13C12.2 11.6745 10.4091 10.6 8.2 10.6C5.99086 10.6 4.2 11.6745 4.2 13M15.4 10.6003C15.4 9.61615 14.4127 8.77035 13 8.4M1 10.6003C1 9.61615 1.98728 8.77035 3.4 8.4M13 5.18889C13.491 4.74943 13.8 4.1108 13.8 3.4C13.8 2.07452 12.7255 1 11.4 1C10.7853 1 10.2246 1.23108 9.8 1.61111M3.4 5.18889C2.909 4.74943 2.6 4.1108 2.6 3.4C2.6 2.07452 3.67452 1 5 1C5.61468 1 6.17539 1.23108 6.6 1.61111M8.2 8.2C6.87452 8.2 5.8 7.12548 5.8 5.8C5.8 4.47452 6.87452 3.4 8.2 3.4C9.52548 3.4 10.6 4.47452 10.6 5.8C10.6 7.12548 9.52548 8.2 8.2 8.2Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};

export default ConferenceMeetingIcon;
19 changes: 19 additions & 0 deletions src/components/icons/DashboardIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { IIconProps } from "../../helpers/types";
import { cn } from "../../lib/utils";

const DashboardIcon = ({ className, ...props }: IIconProps) => {
return (
<svg
viewBox="0 0 20 19"
xmlns="http://www.w3.org/2000/svg"
className={cn("w-5 h-5 fill-none stroke-2", className)}
{...props}>
<rect x="1.23764" y="1" width="7" height="7" rx="2.5" />
<rect x="1.23764" y="11" width="7" height="7" rx="2.5" />
<rect x="11.2376" y="1" width="7" height="7" rx="2.5" />
<rect x="11.2376" y="11" width="7" height="7" rx="2.5" />
</svg>
);
};

export default DashboardIcon;
24 changes: 24 additions & 0 deletions src/components/icons/DateIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { cn } from '../../lib/utils';

const DateIcon = ({ className }: { className?: string }) => {
return (
<svg
width='20'
height='21'
viewBox='0 0 20 21'
fill='none'
xmlns='http://www.w3.org/2000/svg'
className={cn('size-6', className)}
>
<path
d='M6.07373 3.07398H5.25919C4.11843 3.07398 3.54763 3.07398 3.11192 3.29598C2.72866 3.49126 2.41729 3.80264 2.22201 4.1859C2 4.62161 2 5.19241 2 6.33316V7.14771M6.07373 3.07398H14.2212M6.07373 3.07398V1.03711M14.2212 3.07398H15.0361C16.1769 3.07398 16.7465 3.07398 17.1822 3.29598C17.5654 3.49126 17.8779 3.80264 18.0731 4.1859C18.2949 4.62118 18.2949 5.19129 18.2949 6.32981V7.14771M14.2212 3.07398V1.03711M2 7.14771V16.1101C2 17.2509 2 17.8209 2.22201 18.2567C2.41729 18.6399 2.72866 18.9518 3.11192 19.1471C3.54721 19.3689 4.11732 19.3689 5.25584 19.3689H15.0391C16.1776 19.3689 16.7469 19.3689 17.1822 19.1471C17.5654 18.9518 17.8779 18.6399 18.0731 18.2567C18.2949 17.8214 18.2949 17.2521 18.2949 16.1136V7.14771M2 7.14771H18.2949M14.2212 15.2952H14.2232L14.2232 15.2972L14.2212 15.2972V15.2952ZM10.1475 15.2952H10.1495L10.1495 15.2972L10.1475 15.2972V15.2952ZM6.07373 15.2952H6.07577L6.07572 15.2972L6.07373 15.2972V15.2952ZM14.2232 11.2214V11.2235L14.2212 11.2234V11.2214H14.2232ZM10.1475 11.2214H10.1495L10.1495 11.2235L10.1475 11.2234V11.2214ZM6.07373 11.2214H6.07577L6.07572 11.2235L6.07373 11.2234V11.2214Z'
stroke='#6C6C6C'
stroke-width='2.03687'
stroke-linecap='round'
stroke-linejoin='round'
/>
</svg>
);
};

export default DateIcon;
Loading