Skip to content

Commit

Permalink
Merge branch 'main' into backend
Browse files Browse the repository at this point in the history
  • Loading branch information
markalbrand56 committed Nov 7, 2023
2 parents cbb8a74 + a6e741e commit bcdbd50
Show file tree
Hide file tree
Showing 62 changed files with 3,088 additions and 422 deletions.
14 changes: 14 additions & 0 deletions uniEmpleos/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Fase de construcción
FROM node:16 AS build
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
COPY . ./
RUN yarn build

# Fase de servicio
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

11 changes: 11 additions & 0 deletions uniEmpleos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
<link rel="icon" type="image/svg+xml" href="/images/Ue_2.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UniEmpleos</title>
<!-- Hotjar Tracking Code for https://sage-palmier-936be2.netlify.app/ -->
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:3666386,hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
</head>
<body>
<div id="root"></div>
Expand Down
64 changes: 64 additions & 0 deletions uniEmpleos/load-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import http from "k6/http"
import { sleep, check } from "k6"

export const options = {
scenarios: {
low_load: {
executor: "constant-vus",
vus: 100,
duration: "1m", // por ejemplo, 1 minuto
gracefulStop: "30s",
},
medium_load: {
executor: "constant-vus",
vus: 200,
duration: "1m", // por ejemplo, 1 minuto
startTime: "2m", // inicia después de que el primer escenario ha terminado
gracefulStop: "30s",
},
high_load: {
executor: "constant-vus",
vus: 400,
duration: "1m", // por ejemplo, 1 minuto
startTime: "3m", // inicia después de que el segundo escenario ha terminado
gracefulStop: "30s",
},
},
}

function login() {
const res = http.get("https://sage-palmier-936be2.netlify.app/login")
check(res, { "status was 200": (r) => r.status === 200 })
}

function signup() {
const res = http.get("https://sage-palmier-936be2.netlify.app/signup")
check(res, { "status was 200": (r) => r.status === 200 })
}

function homepage() {
const res = http.get("https://sage-palmier-936be2.netlify.app/")
check(res, { "status was 200": (r) => r.status === 200 })
}

export default function () {
// Genera un número aleatorio entre 1 y 3
const randomPage = Math.floor(Math.random() * 3) + 1

switch (randomPage) {
case 1:
login()
break
case 2:
signup()
break
case 3:
homepage()
break
default:
homepage()
break
}

sleep(1)
}
2 changes: 1 addition & 1 deletion uniEmpleos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@storybook/addon-interactions": "^7.0.7",
"@storybook/addon-links": "^7.0.7",
"@storybook/blocks": "^7.0.7",
"@storybook/react": "^7.0.7",
"@storybook/react": "6.3.12",
"@storybook/react-vite": "^7.0.7",
"@storybook/testing-library": "^0.0.14-next.2",
"@testing-library/react": "^14.0.0",
Expand Down
33 changes: 1 addition & 32 deletions uniEmpleos/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,6 @@
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

.svg.css-tj5bde-Svg {
display: none;
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
Expand All @@ -48,5 +17,5 @@
height: 100vh;
width: 100vw;
overflow-x: hidden;
background-color: #f1f1f1;
background-color: #fff;
}
2 changes: 1 addition & 1 deletion uniEmpleos/src/Hooks/useApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const useApi = () => {
setLoading(true)
const response = await fetch(`${API_URL}/api${path}`, options)
const datos = await response.json() // Recibidos
// console.log("API RESPONSE:", datos.message)
console.log("API RESPONSE:", datos)
setLoading(false)
setData(datos.data)

Expand Down
8 changes: 7 additions & 1 deletion uniEmpleos/src/components/Button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import React from "react"
import PropTypes from "prop-types"
import style from "./Button.module.css"

const Button = ({ label, backgroundColor, textColor, onClick, noborder }) => (
const Button = ({
label,
backgroundColor,
textColor,
onClick,
noborder,
}) => (
<div className={style.buttonContainer}>
<button
type="button"
Expand Down
21 changes: 17 additions & 4 deletions uniEmpleos/src/components/Chat/Chat.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
width: auto;
border-radius: 10px;
/* Sombras más pronunciadas */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
box-shadow: 0 4px 8px #94bd0f;
animation: chatAnimation 0.5s ease-in-out;
}

Expand All @@ -24,7 +24,7 @@
}

.button {
background-color: #e1dede;
background-color: #fff;
border: none;
border-radius: 5px;
padding: 5px;
Expand All @@ -39,11 +39,11 @@

.button:focus {
outline: none;
background-color: #d1cece;
background-color: #94bd0f75;
}

.button:hover {
background-color: #d1cece;
background-color: #94bd0f75;
}

.pfp {
Expand Down Expand Up @@ -83,4 +83,17 @@
color: #252525;
font-weight: normal;
text-align: start;
}


@media (max-width: 768px) {
.lastChat {
display: none;
}

.pfp {
width: 40%;
height: 60px;
}

}
20 changes: 9 additions & 11 deletions uniEmpleos/src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import React, { useState } from "react"
import { useStoreon } from "storeon/react"
import PropTypes from "prop-types"
import { FaBars, FaTimes } from "react-icons/fa"
import {AiOutlineLogout} from "react-icons/ai"
import { LuLogOut } from "react-icons/lu"
import Logo from "../Logo/Logo"
import Button from "../Button/Button"
import "./header.css"
import { navigate } from "../../store"

Expand Down Expand Up @@ -44,38 +43,37 @@ export const Header = () => {
<div className="actionlinks">
<a href="/editprofileestudiante">Perfil</a>
<a href="/profile">Vacantes</a>
<a href="/chat">Chat</a>
<a href="/postulaciones">Postulaciones</a>
<a href="/chat">Chat</a>
</div>
<div className="buttonLogoutMobile" onClick={handleClick}>
<AiOutlineLogout size={30} style={{ color: "#000" }} />
<LuLogOut size={30} style={{ color: "#000" }} />
</div>
</div>
)
case "enterprise":
return (
<div className="actions">
<div className="actionlinks">
<a href="/newoffer">Añadir Empleo</a>
<a href="/editprofileempresa">Perfil</a>
<a href="/newoffer">Crear Empleo</a>
<a href="/postulacionempresa">Mis Ofertas</a>
<a href="/editprofileempresa">Profile</a>
<a href="/chat">Chat</a>
</div>
<div className="buttonLogoutMobile" onClick={handleClick}>
<AiOutlineLogout size={30} style={{ color: "#000" }} />
<LuLogOut size={30} style={{ color: "#000" }} />
</div>
</div>
)
case "admin":
return (
<div className="actions">
<div className="actionlinks">
<a href="/jobs">Vacantes</a>
<a href="/postulantes">Postulantes</a>
<a href="/profile">Perfil</a>
<a href="/profileadmin">Empresas</a>
<a href="/profileadminstudent">Estudiantes</a>
</div>
<div className="buttonLogoutMobile" onClick={handleClick}>
<AiOutlineLogout size={30} style={{ color: "#000" }} />
<LuLogOut size={30} style={{ color: "#000" }} />
</div>
</div>
)
Expand Down
4 changes: 1 addition & 3 deletions uniEmpleos/src/components/Header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
display: flex;
gap: 20px;
align-items: center;
position: relative;
right: 60%;
}

.actions a {
Expand Down Expand Up @@ -82,7 +80,6 @@ button.buttonlogo:focus{
}

.container {
max-width: 1100px;
margin: 0 auto;
padding: 0 15px;
display: flex;
Expand Down Expand Up @@ -180,6 +177,7 @@ button.buttonlogo:focus{

.nav-elements.active {
width: 100%;
z-index: 999;
}

.nav-elements ul {
Expand Down
54 changes: 54 additions & 0 deletions uniEmpleos/src/components/HeaderHome/HeaderHome.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { useState } from "react"
import { FaBars, FaTimes } from "react-icons/fa"
import { LuLogOut } from "react-icons/lu"
import styles from "./HeaderHome.module.css"
import { navigate } from "../../store"

const HeaderHome = () => {
const [showNavbar, setShowNavbar] = useState(false)

const handleShowNavbar = () => {
setShowNavbar(!showNavbar)
}

const renderActions = () => {
return (
<div className="actions">
<div className={styles.actionlinks}>
<a href="/login" className={styles.buttonlogin}>
Iniciar Sesión
</a>
<a href="/signup">Registrarse</a>
</div>
</div>
)
}

const handleHome = () => {
navigate("/")
}

return (
<nav className={styles.navbar}>
<div className={styles.container}>
<div className={styles.logoheader}>
<button className="buttonlogo" onClick={handleHome} type="button">
<img src="/images/Ue_2.svg" alt="Logo" />
</button>
</div>
<div className={styles.menuicon} onClick={handleShowNavbar}>
{showNavbar ? (
<FaTimes size={30} style={{ color: "#000" }} />
) : (
<FaBars size={30} style={{ color: "#000" }} />
)}
</div>
<div className={styles.navelements + " " + (showNavbar && styles.active)}>
{renderActions()}
</div>
</div>
</nav>
)
}

export default HeaderHome
Loading

0 comments on commit bcdbd50

Please sign in to comment.