Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added Live-Streaming Functionality #64

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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: 0 additions & 2 deletions .env.sample

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
Expand Down
22,066 changes: 15,223 additions & 6,843 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"@ramonak/react-progress-bar": "^5.0.3",
"@reduxjs/toolkit": "^1.9.5",
"@zegocloud/zego-uikit-prebuilt": "^2.1.0",
"axios": "^1.4.0",
"chart.js": "^4.4.1",
"concurrently": "^8.2.0",
Expand All @@ -30,7 +31,8 @@
"redux": "^4.2.1",
"swiper": "^11.0.5",
"video-react": "^0.16.0",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"zego-express-engine-reactnative": "^3.14.5"
},
"repository": {
"type": "git",
Expand Down
19 changes: 0 additions & 19 deletions server/.env.Sample

This file was deleted.

4 changes: 2 additions & 2 deletions server/config/razorpay.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Razorpay = require("razorpay");

exports.instance = new Razorpay({
key_id: process.env.RAZORPAY_KEY,
key_secret: process.env.RAZORPAY_SECRET,
key_id: process.env.RAZORPAY_KEY,
key_secret: process.env.RAZORPAY_SECRET,
});
45 changes: 44 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,47 @@ details > summary::-webkit-details-marker {
@keyframes scroll {
0% { transform: translateX(100%); }
100% { transform: translateX(-100%); }
}
}

.boton-elegante {
padding: 15px 30px;
border: 2px solid #2c2c2c;
background-color: #1a1a1a;
color: #ffffff;
font-size: 1.2rem;
cursor: pointer;
border-radius: 30px; /* Initial border-radius */
transition: all 0.4s ease;
outline: none;
position: relative;
overflow: hidden;
font-weight: bold;
}

.boton-elegante::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(
circle,
rgba(255, 255, 255, 0.25) 0%,
rgba(255, 255, 255, 0) 70%
);
transform: scale(0);
transition: transform 0.5s ease;
}

.boton-elegante:hover::after {
transform: scale(4);
}

.boton-elegante:hover {
border-color: #666666;
background: #8b0000;
border-radius: 50%;
}


266 changes: 140 additions & 126 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import VideoDetails from "./components/core/ViewCourse/VideoDetails";
import Instructor from "./components/core/Dashboard/InstructorDashboard/Instructor";
import TopHome from "./pages/TopHome";
import { motion } from "framer-motion";
import Room from "./pages/Room";
import Stream from "./pages/Stream";

function App() {
const dispatch = useDispatch();
Expand Down Expand Up @@ -64,140 +66,152 @@ function App() {
}, []);

return (
<div className="w-screen min-h-screen bg-richblack-900 flex flex-col font-inter">
{pathname !== "/" && <Navbar />}
<Routes>
<Route path="/" element={<TopHome />} />
<Route path="/home" element={<Home />} />
<Route path="/catalog/:catalogName" element={<Catalog />} />
<Route path="/courses/:courseId" element={<CourseBuyPage />} />
<Route
path="/signup"
element={
<OpenRoute>
<Signup />
</OpenRoute>
}
/>
<Route
path="/login"
element={
<OpenRoute>
<Login />
</OpenRoute>
}
/>
<Route
path="/verify-email"
element={
<OpenRoute>
<VarifyEmail />
</OpenRoute>
}
/>
<Route
path="/forgot-password"
element={
<OpenRoute>
<ForgotPassword />
</OpenRoute>
}
/>
<Route
path="/update-password/:id"
element={
<OpenRoute>
<UpdatePassword />
</OpenRoute>
}
/>
<Route
path="/about"

<div className="w-screen min-h-screen bg-richblack-900 flex flex-col font-inter">
{pathname !== "/" && <Navbar />}
<Routes>
<Route path="/" element={<TopHome />} />
<Route path="/home" element={<Home />} />
<Route path="/catalog/:catalogName" element={<Catalog />} />
<Route path="/courses/:courseId" element={<CourseBuyPage />} />

<Route
path="/signup"
element={
<OpenRoute>
<Signup />
</OpenRoute>
}
/>
<Route
path="/login"
element={
<OpenRoute>
<Login />
</OpenRoute>
}
/>
<Route
path="/verify-email"
element={
<OpenRoute>
<VarifyEmail />
</OpenRoute>
}
/>
<Route
path="/forgot-password"
element={
<OpenRoute>
<ForgotPassword />
</OpenRoute>
}
/>
<Route
path="/update-password/:id"
element={
<OpenRoute>
<UpdatePassword />
</OpenRoute>
}
/>
<Route
path="/about"
element={
<OpenRoute>
<About />
</OpenRoute>
}
/>
<Route path="/contact" element={<ContactUs />} />
<Route
element={
<PrivatePath>
<Dashboard />
</PrivatePath>
}>
<Route path="/dashboard/my-profile" element={<Myprofile />} />
<Route path="/dashboard/Settings" element={<Settings />} />
{user?.accountType === ACCOUNT_TYPE.STUDENT && (
<>
<Route
path="/dashboard/enrolled-courses"
element={<EnrolledCourses />}
/>
<Route path="dashboard/cart" element={<Cart />} />
</>
)}

{user?.accountType === ACCOUNT_TYPE.INSTRUCTOR && (
<>
<Route path="dashboard/instructor" element={<Instructor />} />
<Route path="dashboard/add-course" element={<AddCourse />} />
<Route path="dashboard/my-courses" element={<MyCourses />} />
<Route
path="dashboard/edit-course/:courseId"
element={<EditCourse />}
/>
<Route path="/room" element={<Room />} />
</>
)}
</Route>
<Route
path="/stream/:streamId"
element={
<OpenRoute>
<About />
</OpenRoute>
<div className="w-screen h-screen bg-white flex justify-center items-center">
<Stream />
</div>
}
/>
<Route path="/contact" element={<ContactUs />} />
<Route
element={
<PrivatePath>
<Dashboard />
</PrivatePath>
}
>
<Route path="/dashboard/my-profile" element={<Myprofile />} />
<Route path="/dashboard/Settings" element={<Settings />} />
{user?.accountType === ACCOUNT_TYPE.STUDENT && (
<>
<Route
path="/dashboard/enrolled-courses"
element={<EnrolledCourses />}
/>
<Route path="dashboard/cart" element={<Cart />} />
</>
)}

{user?.accountType === ACCOUNT_TYPE.INSTRUCTOR && (
<>
<Route path="dashboard/instructor" element={<Instructor />} />
<Route path="dashboard/add-course" element={<AddCourse />} />
<Route path="dashboard/my-courses" element={<MyCourses />} />
<Route
path="dashboard/edit-course/:courseId"
element={<EditCourse />}
/>
</>
)}
</Route>
<Route
element={
<PrivatePath>
<CourseDekho />
</PrivatePath>
}
>
{user?.accountType === ACCOUNT_TYPE.STUDENT && (
<>
<Route
path="view-course/:courseId/section/:sectionId/sub-section/:subSectionId"
element={<VideoDetails />}
/>
</>
)}
</Route>
<Route path="*" element={<Error />} />
</Routes>

{ isVisible && (<motion.button
onClick={() => window.scrollTo({ top: 0, behavior: "smooth" })}
whileHover={{ scale: 1.05, originX: 0, color: "#f8e112" }}
transition={{opacity: {duration: 0.2}}}
className="my-12 fixed bottom-4 right-4 bg-[#766c82] text-white font-medium text-3xl p-4 text-white100 rounded-full drop-shadow-x"
><FaArrowUp /></motion.button>)}
<Route
element={
<PrivatePath>
<CourseDekho />
</PrivatePath>
}>
{user?.accountType === ACCOUNT_TYPE.STUDENT && (
<>
<Route
path="view-course/:courseId/section/:sectionId/sub-section/:subSectionId"
element={<VideoDetails />}
/>
</>
)}
</Route>
<Route path="*" element={<Error />} />
</Routes>

{isVisible && (
<motion.button
onClick={() => window.scrollTo({ top: 0, behavior: "smooth" })}
whileHover={{ scale: 1.05, originX: 0, color: "#f8e112" }}
transition={{ opacity: { duration: 0.2 } }}
className="my-12 fixed bottom-4 right-4 bg-[#766c82] text-white font-medium text-3xl p-4 text-white100 rounded-full drop-shadow-x">
<FaArrowUp />
</motion.button>
)}

{pathname !== "/" && (
<motion.button
whileHover={{ scale: 1.05, originX: 0, color: "#f8e112" }}
transition={{ type: "spring", stiffness: 200 }}
style={{
position: "fixed",
bottom: 16,
right: 20,
zIndex: 10000000,
}}
className="bg-[#766c82]
{pathname !== "/" && (
<motion.button
whileHover={{ scale: 1.05, originX: 0, color: "#f8e112" }}
transition={{ type: "spring", stiffness: 200 }}
style={{
position: "fixed",
bottom: 16,
right: 20,
zIndex: 10000000,
}}
className="bg-[#766c82]
text-white font-medium p-2 text-white100 px-6 rounded-l-full
rounded-t-full drop-shadow-xl flex items-center gap-x-3"
onClick={() => navigate("/contact")}
>
🤔Facing an issue?
</motion.button>

)}
</div>
);
onClick={() => navigate("/contact")}>
🤔Facing an issue?
</motion.button>
)}
</div>
);
}

export default App;
Loading
Loading