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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_MODE=DEVELOPMENT
VITE_BASEURL=http://localhost:3000
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ dist-ssr
*.njsproj
*.sln
*.sw?


# Environment files
.env
.env.development
.env.production
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/img/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Material Tailwind Dashboard React | By Creative Tim</title>
<title>Mentor Academy</title>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap"
rel="stylesheet"
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@
"@heroicons/react": "2.0.18",
"@material-tailwind/react": "2.1.4",
"apexcharts": "3.44.0",
"axios": "^1.7.8",
"framer-motion": "^11.12.0",
"lucide-react": "^0.462.0",
"prop-types": "15.8.1",
"react": "18.2.0",
"react-apexcharts": "1.4.1",
"react-dom": "18.2.0",
"react-router-dom": "6.17.0"
"react-icons": "^5.3.0",
"react-player": "^2.16.0",
"react-query": "^3.39.3",
"react-router-dom": "6.17.0",
"recharts": "^2.15.0",
"shadcn-ui": "^0.9.4",
"socket.io-client": "^4.8.1"
},
"devDependencies": {
"@types/react": "18.2.31",
Expand All @@ -29,4 +38,4 @@
"tailwindcss": "3.3.4",
"vite": "4.5.0"
}
}
}
31 changes: 31 additions & 0 deletions public/css/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
@tailwind base;
@tailwind components;
@tailwind utilities;


.animated-gradient {
background: linear-gradient(90deg, #3498db, #8e44ad, #e74c3c);
background-size: 200% 200%;
animation: gradientAnimation 2s ease-out infinite;
}

@keyframes gradientAnimation {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}

.line-through::before {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 100%;
height: 100%;
border-top: 1px solid red;
transform: rotate(25deg);
transform-origin: top left;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/default-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { Routes, Route, Navigate } from "react-router-dom";
import { Dashboard, Auth } from "@/layouts";
import { Dashboard, Auth,Terms} from "@/layouts";
import { useAuth } from "./hooks/Auth";
import NotFound from "./pages/NotFound";

function App() {
const {account} = useAuth()
return (
<Routes>
<Route path="/dashboard/*" element={<Dashboard />} />
<Route path="/auth/*" element={<Auth />} />
<Route path="*" element={<Navigate to="/dashboard/home" replace />} />
{account ? <Route path="/dashboard/*" element={<Dashboard />} /> :
<Route path="/auth/*" element={<Auth />} />}
<Route path="/terms/*" element={<Terms />} />
<Route path="*" element={<NotFound />} />
</Routes>
);
}
Expand Down
30 changes: 30 additions & 0 deletions src/api/Admin.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import axiosClient from "@/api/axiosClient";

export const AdminApi = {
getAllUsers: (token) => {
const url = "/users/";
return axiosClient.get(url, { headers: { token: token } });
},

getAllPromoCodes: (token) => {
const url = "/getProms";
return axiosClient.get(url, { headers: { token: token } });
},

generatePromoCode: (token, data = {}) => {
const url = "/createPromocode";
return axiosClient.post(url, data, { headers: { token: token } });
},

blockUser: (token, id, data = {}) => {
const url = `/blockUser/${id}`;
return axiosClient.patch(url, data, { headers: { token: token } });
},
getRecentSupportSessions: (token) => {
const url = "/activeSupportSessions";
return axiosClient.get(url, { headers: { token: token } });
},

};

export default AdminApi;
58 changes: 58 additions & 0 deletions src/api/Auth.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import axiosClient from "@/api/axiosClient";


export const AuthApi = {

SignIn: (data) => {
const url = "/auth/user/signIn";
return axiosClient.post(url, data);
},

SignUp: (data) => {
const url = "/auth/user/signup";
return axiosClient.post(url, data);
},

forGotPassword: (data) => {
const url = "/user/forgotPassword";
return axiosClient.post(url, data);
},

reset: (data) => {
const url = "/user/reset/";
return axiosClient.post(url, data)
},

verifyPromocode: (data) => {
const url = "/auth/verifyPromocode";
return axiosClient.post(url, data, { headers: { 'Content-Type': "application/json" } });
},

getTree: (token, id) => {
const url = "/auth/getAllChildren";
return axiosClient.get(url, { headers: { token: token }, params: { educator: id } });
},

contactUs: (data, token) => {
const url = "/contactus";
return axiosClient.post(url, data, { headers: { token: token } });
},

getContactUs: (token, limit, page) => {
const url = "/contactus";
return axiosClient.get(url, { headers: { token: token }, params: { limit: limit, page: page } });
},

getUserData: (token) => {
const url = "/user/user/profile";
return axiosClient.get(url, { headers: { token: token } });
},

EditUserData: (data, token) => {
const url = "/user/updateProfile";
return axiosClient.patch(url, data, { headers: { token: token } });
},

}

export default AuthApi;
54 changes: 54 additions & 0 deletions src/api/Courses.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import axiosClient from "@/api/axiosClient";
import MyCourses from "@/pages/dashboard/MyCourses";

export const CoursesApi = {
getAllCourses: (limit, page) => {
const url = "/course/";
return axiosClient.get(url, { params: { limit: limit, page: page } });
},

addCourse: (data, token) => {
const url = "/course/addCourse/";
return axiosClient.post(url, data, { headers: { token: token } });
},

getCourseLesson: (id, token) => {
const url = `/course/${id}/lessons`;
return axiosClient.get(url, { headers: { token: token } });
},

getLessonById: (id, token) => {
const url = `/lessons/${id}`;
return axiosClient.get(url, { headers: { token: token } });
},

deleteCourse: (id, token) => {
const url = `/course/${id}`;
return axiosClient.delete(url, { headers: { token: token } });
},

editCourse: (id, data, token) => {
const url = `/course/edit/${id}`;
return axiosClient.post(url, data, { headers: { token: token } });
},

addLessonToCourse: (id, data, token) => {
const url = `/course/${id}/lessons`;
return axiosClient.post(url, data, { headers: { token: token } });
},

deleteLesson: (id, token) => {
const url = `/course/lessons/${id}`;
return axiosClient.delete(url, { headers: { token: token, "Content-Type": 'multipart/form-data' } });
},
MyCourses: (token) => {
const url = `/course/myCourses/if-you-find-this-you-are-a-hacker`;
return axiosClient.get(url, { headers: { token: token } });
},
AddtoMyCourses: (id, token) => {
const url = `/user/addToMyCourses/${id}`;
return axiosClient.post(url, {}, { headers: { token: token } });
}
};

export default CoursesApi;
13 changes: 13 additions & 0 deletions src/api/Notification.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import axiosClient from "@/api/axiosClient";

const NotificationsApi = {
getNotifications: (toekn, pageParam, limit) => axiosClient.get("/notification/getNotifications", {
headers: { token: toekn }, params: {
offset: pageParam * limit,
limit,
},
}),
markAsRead: (toekn, notificationId) => axiosClient.post(`/notification/markAsRead`, { notificationId: notificationId }, { headers: { token: toekn } }),
}

export default NotificationsApi;
28 changes: 28 additions & 0 deletions src/api/Packages.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import axiosClient from "@/api/axiosClient";


const PackagesApi = {
getAll: () => {
return axiosClient.get('/package');
},
add: (data, token) => {
return axiosClient.post('/package/create', data, { headers: { token: token }, "Content-Type": 'multipart/form-data' });
},
getPackage: (id) => {
return axiosClient.get(`/package/${id}`);
},
deletePackage: (id, token) => {
return axiosClient.delete(`/package/${id}`, { headers: { token: token } });
},
updatePackage: (id, data, token) => {
return axiosClient.put(`/package/${id}`, data, { headers: { token: token }, "Content-Type": 'multipart/form-data' });
},
subscribeToPackage: (id, token) => {
return axiosClient.post(`/package/subscribe/${id}`, {}, { headers: { token: token } });
},
myPackages: (token) => {
return axiosClient.get('/package/my-packages/myPackages', { headers: { token: token } });
},
}

export default PackagesApi;
9 changes: 9 additions & 0 deletions src/api/Signal.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import axiosClient from "@/api/axiosClient";

const SignalApi = {
getAll: (token) => {
return axiosClient.get('/signal', { headers: { token: token } });
},
}

export default SignalApi;
14 changes: 14 additions & 0 deletions src/api/User.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import axiosClient from "@/api/axiosClient";

const UserApi = {
getTeam: (token) => {
const url = "/user/team/2";
return axiosClient.get(url, { headers: { token: token }});
},
getAdminTeam: (token) => {
const url = "/user/team/admin";
return axiosClient.get(url, { headers: { token: token }});
},
}

export default UserApi;
62 changes: 62 additions & 0 deletions src/api/Wallet.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import axiosClient from "@/api/axiosClient";
import { data } from "autoprefixer";

const WalletApi = {
getWithdrawalRequests: (token,rest) => {
const url = "/wallet/withdraw";
console.log(token,rest)
return axiosClient.post(url,rest, { headers: { token: token } });
},
getTransactionHistory: (token) => {
const url = "/wallet/transactionHistory";
return axiosClient.get(url, { headers: { token: token } });
}
,
getUserWithdrawalRequests: (token) => {
const url = "/wallet/withdrawalRequests";
return axiosClient.get(url, { headers: { token: token } });
},
getUserDepositRequests: (token) => {
const url = "/wallet/depositRequests";
return axiosClient.get(url, { headers: { token: token } });
}
,
getPendingAmount: (token) => {
const url = "/wallet/pendingAmount";
return axiosClient.get(url, { headers: { token: token } });
}
,
getUserWalletAnalysis: (token) => {
const url = "/wallet/analysis";
return axiosClient.get(url, { headers: { token: token } });
},
getAdminWalletAnalysis: (token) => {
const url = "/wallet/adminAnalysis";
return axiosClient.get(url, { headers: { token: token } });
},
getWallet: (token) => {
const url = "/wallet/";
return axiosClient.get(url, { headers: { token: token } });
},
walletAnalysisCharts: (token) => {
const url = "/wallet/charts";
return axiosClient.get(url, { headers: { token: token } });
},
adminWalletAnalysisCharts: (token) => {
const url = "/wallet/adminCharts";
return axiosClient.get(url, { headers: { token: token } });
},

adminWallets: (token) => {
const url = "/wallet/admin/wallets";
return axiosClient.get(url, { headers: { token: token } });
},


forceReleaseAllPendingBalances: (token) => {
const url = "/wallet/force-release-all";
return axiosClient.post(url, { headers: { token: token } });
}
}

export default WalletApi;
Loading