Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulambastha committed Jan 24, 2024
2 parents ae08884 + a440f0b commit f880698
Show file tree
Hide file tree
Showing 44 changed files with 1,189 additions and 931 deletions.
63 changes: 15 additions & 48 deletions .github/workflows/master_prody-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,29 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Node.js app to Azure Web App - prody-frontend
name: CI/CD Pipeline

on:
push:
branches:
- master
workflow_dispatch:

jobs:
build:
test_and_deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js version
uses: actions/setup-node@v3
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.1
with:
node-version: '21.x'
ssh-private-key: ${{ secrets.SSH_KEY_ACCESS }}

- name: npm install, build, and test
- name: Deploying to Server
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: Zip artifact for deployment
run: zip release.zip ./* -r

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: node-app
path: release.zip

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: node-app

- name: Unzip artifact for deployment
run: unzip release.zip

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'prody-frontend'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_DDB9B781EEC74B5A904F2F66B0C3E1D3 }}
package: .
ssh -o StrictHostKeyChecking=no lucifer@prody.istenith.com << EOF
cd prody-frontend
git config pull.rebase false
git pull origin master
npm run build
sudo systemctl restart prody-frontend.service
EOF
2 changes: 1 addition & 1 deletion ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
apps: [
{
name: "dev-prody",
name: "prody",
script: "./node_modules/next/dist/bin/next",
args: "start -p " + 3000,
watch: false,
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
"dependencies": {
"@react-spring/three": "^9.7.3",
"@react-three/drei": "^9.90.0",
"@react-three/fiber": "^8.15.12",
"@react-three/fiber": "^8.15.14",
"@uidotdev/usehooks": "github:uidotdev/usehooks",
"axios": "^1.6.3",
"daisyui": "^4.4.19",
"framer-motion": "^10.16.15",
"next": "^14.0.4",
"react": "^18",
"react": "^18.2.0",
"react-chrono": "^2.3.1",
"react-dom": "^18",
"react-parallax-tilt": "^1.7.186",
"react-responsive": "^9.0.2",
"react-router-dom": "^6.21.1",
"react-type-animation": "^3.2.0",
"sharp": "^0.33.2",
"styled-components": "^6.1.1",
"three": "^0.159.0"
},
Expand Down
Binary file added public/images/1-01.png
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/images/4-01.png
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/images/testTexture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/app/(dashboard)/me/components/EventsListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const EventsListing: React.FC<EventsListingProps> = ({ upComingEvents, user, eve
const eventId = event.id;
router.push(`/event-register/${eventId}`);

console.log(`Registering for event: ${event.name}`);
console.log(`Registering.. for event:${event.name}`);
};


Expand All @@ -50,8 +50,8 @@ const EventsListing: React.FC<EventsListingProps> = ({ upComingEvents, user, eve
<div className="carousel carousel-center space-x-4 gap-6 rounded-box" style={{ width: "90vw" }}>
{isLoaded ?
events.map((event) => (
<div key={event.id} className="carousel-item relative">
<div className={["card w-72 max-h-96 md:w-80 lg:w-80 shadow-xl", styles.upComingEventCard].join(" ")}>
<div key={event.id} className="carousel-item">
<div className={["cardEventL w-72 max-h-96 md:w-80 lg:w-80 shadow-xl", styles.upComingEventCard].join(" ")}>
{event.is_live && (
<div className="cardT">
<div className="live-triangle" ></div>
Expand All @@ -64,9 +64,11 @@ const EventsListing: React.FC<EventsListingProps> = ({ upComingEvents, user, eve
<div className="card-body items-center">
<h2 className="card-title">{event.name}</h2>
{upComingEvents && (

<button className="register-button btn btn-primary" onClick={() => handleRegisterNow(event)}>
Register Now
</button>

)}
{event.is_live && (
<span className='text-red-500'>Event is Live!!</span>
Expand Down
12 changes: 6 additions & 6 deletions src/app/(dashboard)/me/components/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Image from 'next/image'
import Astronaut from '../../../../../public/images/Astronaut.webp'
import { TypeAnimation } from 'react-type-animation'
import { motion, useAnimate} from 'framer-motion'
import { useWindowSize } from '@uidotdev/usehooks'
// import { useWindowSize } from '@uidotdev/usehooks'
import axios from 'axios';
import { useRouter } from 'next/navigation';
import "./dashboard.css"
Expand All @@ -17,19 +17,19 @@ interface LandingPageProps {

const LandingPage: React.FC<LandingPageProps> = ({ user, totalEvents, registeredEvents }) => {
const router = useRouter();
const window = useWindowSize()
const windowWidth = window.width!
// const window = useWindowSize()
// const windowWidth = window.width!
const username = user.username
const prody_id = user.user_id
const [scope, animate] = useAnimate()

console.log(windowWidth)
// console.log(windowWidth)
console.log("user",user)
// console.log("user registered teams", user.registered_teams)

const handleLogout = async () => {
try {
await axios.post('https://api-dev.prody.istenith.com/api/auth/logout/');
await axios.post('https://api.prody.istenith.com/api/auth/logout/');

localStorage.removeItem('myJwtToken');
alert("Logout Successful")
Expand Down Expand Up @@ -110,7 +110,7 @@ const LandingPage: React.FC<LandingPageProps> = ({ user, totalEvents, registered
<motion.div
initial={{y: 10, opacity: 0}}
animate={{y: 0, opacity: 1}}
transition={(windowWidth > 500) ? {delay: 10} : {delay: 4}}
// transition={(windowWidth > 500) ? {delay: 10} : {delay: 4}}
className='mx-auto'
>
<div
Expand Down
22 changes: 19 additions & 3 deletions src/app/(dashboard)/me/components/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,31 @@

.cardT {
position: relative;
/* width: 300px; */
width: 316px;
height: 80px;
/* background-color: #333; */
color: white;
border-radius: 8px;
overflow: hidden;
}

.live-triangle {
.cardEventL{
background: rgba(255, 255, 255, 0.1);
/* backdrop-filter: blur(10px); */
border-radius: 15px;
/* padding: 20px; */
/* text-align: center; */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
/* margin: 10px; */
display: flex;
flex-direction: column;
align-items: center;
color: #fff;
height: 100%;
}

.live-triangle {
width: 343px;
height: 112px;
/* border-top: 60px solid red; */
Expand All @@ -24,7 +40,7 @@
transform: translate(50%, -50%) rotate(45deg);
transform-origin: 0 0;
background-color: #e679c0;
}
}

.live-text {
position: absolute;
Expand Down
5 changes: 1 addition & 4 deletions src/app/(dashboard)/me/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Navbar from '../../components/Navbar/Navbar';
import Footer from '../../components/Footer/Footer';
import LandingPage from './components/LandingPage';
import EventsListing from './components/EventsListing';
import axios from 'axios';
import "./page.module.css"
import { useRouter } from 'next/navigation';
import fetchUserData from '../../components/fetchUserData';
Expand Down Expand Up @@ -53,7 +52,7 @@ const Dashboard: React.FC = () => {
useEffect(() => {
const fetchData = async () => {
try {
const res = await fetch('https://api-dev.prody.istenith.com/api/events/', { next: { revalidate: 60 } });
const res = await fetch('https://api.prody.istenith.com/api/events/', { next: { revalidate: 60 } });
const resJson = await res.json();
const formattedData = resJson.map((event: Event) => {
const eventDate = new Date(event.date_time);
Expand Down Expand Up @@ -123,7 +122,6 @@ const Dashboard: React.FC = () => {
<div className='spaceThemeBackground'>
<EventsListing upComingEvents={false} user={user} events = {registeredEvents}/>
<EventsListing upComingEvents={true} user={user} events = {nonRegisteredEvents} />
<Footer />
</div>
</>
) : (
Expand All @@ -134,7 +132,6 @@ const Dashboard: React.FC = () => {
Loading User Data ...
</h1>
</div>
<Footer />
</div>
)}
</div>
Expand Down
37 changes: 37 additions & 0 deletions src/app/Loader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { useProgress } from "@react-three/drei";
import { useEffect, useState } from "react";
export const LoadingScreen=(props)=>{

const [started,setStarted]=useState(false)
const {progress,total,loaded,item}=useProgress();

useEffect(()=>{
if(progress===100){
setTimeout (()=>{
setStarted(true);
},2000);

}
},[progress,total,loaded,item])
return(

<div className={`bg-blue-800 fixed top-0 left-0 w-full h-full z-50 transition-opacity duration-1000 pointer-events-none
flex items-center justify-center bg-indigo-50
${started?"opacity-0":"opacity-100"}`}
>

<div className="text-4xl md:text-9xl font-bold text-black relative">
<div
className="absolute left-0 top-0 overflow-hidden truncate text-clip transition-all duration-500"
style={{
width:`${progress}%`,
}}>
PRODYOGIKI
</div>
<div className="opacity-10">PRODYOGIKI</div>
</div>
</div>
)
};

export default LoadingScreen
2 changes: 1 addition & 1 deletion src/app/LoaderEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
const Loader = () => {
return (
<div style={{fontFamily:"nasa", display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', height: '100vh', fontSize:"15px" }}>
<div className="rocket " style={{ fontSize: '40px' }}>🚀</div>
<div className="rocket mb-2 " style={{ fontSize: '40px' }}>🚀</div>
Loading<span style={{ fontSize: '50px' }} className="dots">
<span>.</span><span>.</span><span>.</span>
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/ContactCard/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

import './contact.css';
interface CardProps {
contact: {
id: number;
Expand All @@ -13,7 +13,7 @@ interface CardProps {

const Card = ({ contact }: CardProps) => {
return (
<div key={contact.id} className="card">
<div key={contact.id} style={{overflow:"hidden"}} className="contactCard">
<div className="card-image">
<img src={contact.image} alt={contact.name} />
</div>
Expand Down
15 changes: 15 additions & 0 deletions src/app/components/ContactCard/contact.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.contactCard {
background: rgba(255, 255, 255, 0.1);
border-radius: 15px;
padding: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
display: flex;
flex-direction: column;
align-items: center;
color: #fff;
height: 270px;
width: 220px;
/* max-height: 400px; */
overflow: auto; /* Adds scrollbar if content overflows */
}
25 changes: 12 additions & 13 deletions src/app/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import React from 'react'
import Image from 'next/image'
import "./footer.css"

const Footer = () => {
return (
<div className='relative w-screen text-white'>
<footer className="footer footer-center h-max" style={{minHeight: '5rem', paddingBottom:'1rem', position:'sticky', bottom:'0'}}>
<aside>
<div className="w-full flex-wrap items-center justify-center gap-2 pt-12 flex flex-row border-white">
<a href='https://www.istenith.com/' target='_blank'><Image src={"/logos/isteWhite.webp"} loader={()=>"/logos/isteWhite.webp"} width={50} height={10} alt="ISTE"/></a>
<Image src={"/logos/prodyLogoFooter.webp"} loader={()=>"/logos/ProdyLogo.webp"} width={37} height={50} alt="ISTE"/>
</div>
<p className="font-bold">
Prodyogiki 2024 | NIT Hamirpur
</p>
<span>
<div className="grid grid-flow-col gap-4">
<div className='relative w-screen text-white footerContainer bg-current' style={{ paddingBottom: "25px", marginTop: '20px' ,zIndex:-100}}>
<footer className="footer-center h-auto md:flex md:justify-around md:gap-2 sm:block relative" style={{ zIndex: -1 }}>

<div className="flex spaceFont justify-center text-xl">
<Image src={"/logos/prodyLogoFooter.webp"} loader={() => "/logos/ProdyLogo.webp"} width={30} height={45} alt="ISTE" />rodyogiki
</div>
<p className="font-bold text-center p-4">
Prodyogiki 2024 | NIT Hamirpur
</p>
<span>
<div className="flex justify-center gap-3">
<a href='https://x.com/IsteNith' target='_blank'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" className="fill-current"><path d="M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"></path></svg></a>
<a href='https://www.youtube.com/@teamistenit-h830' target='_blank'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" className="fill-current"><path d="M19.615 3.184c-3.604-.246-11.631-.245-15.23 0-3.897.266-4.356 2.62-4.385 8.816.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0 3.897-.266 4.356-2.62 4.385-8.816-.029-6.185-.484-8.549-4.385-8.816zm-10.615 12.816v-8l8 3.993-8 4.007z"></path></svg></a>
<a href='https://www.facebook.com/teamiste' target='_blank'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" className="fill-current"><path d="M9 8h-3v4h3v12h5v-12h3.642l.358-4h-4v-1.667c0-.955.192-1.333 1.115-1.333h2.885v-5h-3.808c-3.596 0-5.192 1.583-5.192 4.615v3.385z"></path></svg></a>
<a href='https://github.com/istenith' target='_blank'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" className="fill-current"><path d="M12 0.297c-6.627 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385 0.6 0.113 0.82-0.258 0.82-0.575 0-0.285-0.011-1.039-0.016-2.039-3.338 0.725-4.042-1.605-4.042-1.605-0.546-1.387-1.334-1.757-1.334-1.757-1.089-0.745 0.084-0.73 0.084-0.73 1.205 0.084 1.838 1.236 1.838 1.236 1.07 1.835 2.807 1.305 3.492 0.998 0.108-0.775 0.418-1.305 0.762-1.605-2.665-0.3-5.466-1.332-5.466-5.93 0-1.31 0.469-2.382 1.236-3.222-0.124-0.303-0.536-1.524 0.117-3.176 0 0 1.008-0.323 3.3 1.23 0.957-0.266 1.983-0.399 3.005-0.404 1.021 0.005 2.048 0.138 3.005 0.404 2.291-1.553 3.297-1.23 3.297-1.23 0.653 1.652 0.241 2.873 0.118 3.176 0.769 0.84 1.235 1.912 1.235 3.222 0 4.61-2.803 5.625-5.475 5.922 0.431 0.371 0.815 1.103 0.815 2.222 0 1.606-0.015 2.898-0.015 3.293 0 0.32 0.217 0.694 0.825 0.576 4.765-1.587 8.2-6.081 8.2-11.386 0-6.627-5.373-12-12-12z"></path></svg></a>
</div>
</span>
</aside>
</footer>
</div>
)
Expand Down
18 changes: 18 additions & 0 deletions src/app/components/Footer/footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

.footerContainer {
animation: fadeInUp 1s ease-in-out;
background-color: transparent;
}


@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

Loading

0 comments on commit f880698

Please sign in to comment.