Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f8a7268
Refactors and responsive in login module
DanilsGit Apr 17, 2025
c62035f
Merge pull request #1 from Parchat/refactors-and-responsive
DanilsGit Apr 17, 2025
26b6b91
Update and rename main.yml to master-CD.yml
DanilsGit Apr 17, 2025
39fdffa
Merge pull request #2 from Parchat/DanilsGit-patch-1
DanilsGit Apr 17, 2025
4907161
Create develop-CD.yml
DanilsGit Apr 17, 2025
6eb146c
Merge pull request #3 from Parchat/DanilsGit-patch-2
DanilsGit Apr 17, 2025
950bf0d
Update develop-CD.yml
DanilsGit Apr 17, 2025
3665585
Merge pull request #4 from Parchat/DanilsGit-patch-3
DanilsGit Apr 17, 2025
8c5d987
Update develop-CD.yml
DanilsGit Apr 17, 2025
724a6c1
Merge pull request #5 from Parchat/DanilsGit-patch-4
DanilsGit Apr 17, 2025
d60556c
Update master-CD.yml
DanilsGit Apr 17, 2025
848af72
Merge pull request #6 from Parchat/DanilsGit-patch-5
DanilsGit Apr 17, 2025
3431125
Create dashboard route and minimal view
DanilsGit Apr 17, 2025
c041d3d
Merge pull request #7 from Parchat/user-profile
DanilsGit Apr 17, 2025
649faae
Remove timeout
DanilsGit Apr 17, 2025
91a45d3
Merge pull request #8 from Parchat/user-profile
DanilsGit Apr 17, 2025
1ad6efd
Update master-CD
DanilsGit Apr 17, 2025
1d762ff
Merge pull request #9 from Parchat/user-profile
DanilsGit Apr 17, 2025
dc9953b
add Link hrefs
DanilsGit Apr 17, 2025
d8d2b73
Merge pull request #10 from Parchat/user-profile
DanilsGit Apr 17, 2025
d664c80
Update develop-CD
DanilsGit Apr 17, 2025
c8eb0f2
Merge pull request #11 from Parchat/user-profile
DanilsGit Apr 17, 2025
12a98dc
Fix reload in VM
DanilsGit Apr 18, 2025
c7b0486
Merge pull request #12 from Parchat/user-profile
DanilsGit Apr 18, 2025
21fa1e9
Create rooms view
DanilsGit Apr 18, 2025
33d0fb2
Merge pull request #13 from Parchat/user-profile
DanilsGit Apr 18, 2025
956934c
testing ssh
DanilsGit Apr 18, 2025
d7ea83b
Merge pull request #14 from Parchat/user-profile
DanilsGit Apr 18, 2025
28c71a5
Update CD
DanilsGit Apr 18, 2025
5f3c267
Merge pull request #15 from Parchat/user-profile
DanilsGit Apr 18, 2025
d7a4933
Create rooms view with a basic suspense integration
DanilsGit Apr 19, 2025
688d1b4
Analyzing behavior of multiple messages
DanilsGit Apr 19, 2025
17869f7
Merge pull request #16 from Parchat/user-profile
DanilsGit Apr 19, 2025
f419acf
Fix overflow and mobile styles ni room view
DanilsGit Apr 20, 2025
9fa8ebb
Merge pull request #17 from Parchat/user-profile
DanilsGit Apr 20, 2025
b030fbc
Migrate to docker
DanilsGit Apr 21, 2025
c2e6e65
Improve cache in docker build
DanilsGit Apr 21, 2025
377ff5d
Merge pull request #18 from Parchat/user-profile
DanilsGit Apr 21, 2025
b7bec28
improving input in chat
DanilsGit Apr 21, 2025
07ada6c
Improve deployment with docker images
DanilsGit Apr 22, 2025
3a332ff
Merge pull request #19 from Parchat/user-profile
DanilsGit Apr 22, 2025
c5fcee7
Improve deployment with docker images
DanilsGit Apr 22, 2025
4922c6c
Merge pull request #20 from Parchat/user-profile
DanilsGit Apr 22, 2025
83bca27
Rename Dockerfile.dev to dockerfile.dev
DanilsGit Apr 22, 2025
e395774
Merge pull request #22 from Parchat/DanilsGit-patch-1
DanilsGit Apr 22, 2025
7c3d869
fix timeout
DanilsGit Apr 22, 2025
ac98e89
Merge pull request #23 from Parchat/user-profile
DanilsGit Apr 22, 2025
0c5f841
fix build
DanilsGit Apr 22, 2025
e64ca90
Merge pull request #24 from Parchat/user-profile
DanilsGit Apr 22, 2025
bc2cae7
Implementing version control in dockerhub
DanilsGit Apr 22, 2025
8f9ed5e
Merge pull request #25 from Parchat/user-profile
DanilsGit Apr 22, 2025
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
21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Ignorar dependencias locales
# node_modules se utilizará para mandarse desde github actions

# Ignorar config de Git
.git
.gitignore

# Archivos temporales o de sistema
.DS_Store
*.log

# Archivos de desarrollo
.vscode
.idea

# Otros archivos que no deben ir al contenedor
.env
*.env.local
tests
coverage
README.md
50 changes: 50 additions & 0 deletions .github/workflows/develop-CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy Frontend-Develop to GCP VM

on:
pull_request:
types: [closed]
branches: [develop]

jobs:
deploy:
if: github.event.pull_request.merged == true
name: 🚀🛠 Deploy DEVELOP Next.js to GCP
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: develop

# 👉 Build la imagen Docker
- name: Build Docker image
run: docker build -f Dockerfile.prod -t ${{ secrets.DOCKER_USERNAME }}/frontend-dev:stage-${{ github.sha }} .

# 👉 Log in to DockerHub
- name: DockerHub Login
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

# 👉 Push la imagen
- name: Push Docker image to DockerHub
run: docker push ${{ secrets.DOCKER_USERNAME }}/frontend-dev:stage-${{ github.sha }}

# 👉 Add VM to known_hosts
- name: Add VM to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan ${{ secrets.GCP_VM_IP }} >> ~/.ssh/known_hosts

# 👉 Desplegar en la VM
- name: Deploy on GCP VM
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{ secrets.GCP_VM_IP }}
username: ${{ secrets.GCP_VM_USER }}
key: ${{ secrets.GCP_SSH_KEY }}
script: |
cd /home/proyectosdanils/
docker compose down frontend-dev
docker pull ${{ secrets.DOCKER_USERNAME }}/frontend-dev:stage-${{ github.sha }}
export DOCKER_IMAGE_FRONTEND_DEV=${{ secrets.DOCKER_USERNAME }}/frontend-dev:stage-${{ github.sha }}
docker compose up -d frontend-dev
53 changes: 0 additions & 53 deletions .github/workflows/main.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/master-CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy Frontend to GCP VM

on:
push:
branches:
- master
pull_request:
types: [closed] # (mergeado)
branches: [master]

jobs:
deploy:
if: github.event.pull_request.merged == true # Solo si se hizo merge
name: 🚀 PRODUCTION Deploy Next.js to GCP
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

# 👉 Build la imagen Docker
- name: Build Docker image
run: docker build -f Dockerfile.prod -t ${{ secrets.DOCKER_USERNAME }}/frontend-prod:${{ github.sha }} .

# 👉 Log in to DockerHub
- name: DockerHub Login
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

# 👉 Push la imagen
- name: Push Docker image to DockerHub
run: docker push ${{ secrets.DOCKER_USERNAME }}/frontend-prod:${{ github.sha }}

# 👉 Add VM to known_hosts
- name: Add VM to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan ${{ secrets.GCP_VM_IP }} >> ~/.ssh/known_hosts

# 👉 Desplegar en la VM
- name: Deploy on GCP VM
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{ secrets.GCP_VM_IP }}
username: ${{ secrets.GCP_VM_USER }}
key: ${{ secrets.GCP_SSH_KEY }}
script: |
cd /home/proyectosdanils/
docker compose down frontend-prod
docker pull ${{ secrets.DOCKER_USERNAME }}/frontend-prod:${{ github.sha }}
export DOCKER_IMAGE_FRONTEND_PROD=${{ secrets.DOCKER_USERNAME }}/frontend-prod:${{ github.sha }}
docker compose up -d frontend-prod
16 changes: 16 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:22-alpine

RUN mkdir -p /home/frontend-prod

WORKDIR /home/frontend-prod

COPY package.json package-lock.json ./
RUN npm install

COPY . .

RUN npm run build

EXPOSE 3000

CMD ["npm", "run", "start"]
16 changes: 16 additions & 0 deletions app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Header from '../_components/Header';
import Footer from '../_components/Footer';

export default function NoLoggedLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<div className="bg-darkblue text-white">
<Header />
<main className="px-5 lg:px-16">{children}</main>
<Footer />
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Link from 'next/link';

export default function LoginGest() {
return (
<main className="flex items-center justify-center min-h-screen w-full">
<section className="flex flex-col w-full mx-auto max-w-[600px] gap-20">
<section className="flex items-center justify-center min-h-screen w-full">
<div className="flex flex-col w-full mx-auto max-w-[600px] gap-20">
<div className="flex flex-col items-center gap-5">
<h1 className="font-extrabold text-purple text-4xl text-center">
Entra como Invitado y Únete a la Conversación
Expand Down Expand Up @@ -36,7 +36,7 @@ export default function LoginGest() {
</Link>
</div>
</div>
</section>
</main>
</div>
</section>
);
}
98 changes: 98 additions & 0 deletions app/(auth)/login/_components/DesktopForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
export default function DesktopForm({ setMode }: { setMode: (mode: string) => void }) {
return (
<div className="hidden lg:flex gap-10 justify-between w-full">
<section className="w-[100%] flex flex-col items-center gap-5 max-w-[600px] mx-auto">
<header className="flex flex-col items-center gap-1">
<h1 className="text-2xl font-extrabold text-center">
Mantente Comunicado en Cualquier Lugar
</h1>
<h2>Inicia sesión para acceder a tus salas</h2>
</header>
<form className="flex flex-col gap-5 w-[80%]">
<div className="flex flex-col gap-1">
<label htmlFor="email-login-desktop" className="font-bold">
Tu correo
</label>
<input
id="email-login-desktop"
type="text"
placeholder="Correo electrónico"
autoComplete="email"
className="w-full border-1 border-purple-300 p-2 rounded"
/>
</div>
<div>
<label htmlFor="password-login-desktop" className="font-bold">
Tu contraseña
</label>
<input
id="password-login-desktop"
type="password"
placeholder="Contraseña"
className="w-full border-1 border-purple-300 p-2 rounded"
autoComplete="current-password"
/>
</div>
<button className="bg-purple rounded p-2">Ingresar a la plataforma</button>
</form>
<div className="flex gap-1">
<p>¿Aún no tienes una cuenta?</p>
<button className="text-purple cursor-pointer" onClick={() => setMode('register')}>
Regístrate
</button>
</div>
</section>

<section className="w-[100%] flex flex-col items-center gap-5 max-w-[600px] mx-auto">
<header className="flex flex-col items-center gap-1">
<h1 className="text-2xl font-extrabold text-center">Regístrate y Conecta</h1>
<h2>Podrás guardar tus conversaciones y salas</h2>
</header>
<form className="flex flex-col gap-5 w-[80%]">
<div className="flex flex-col gap-1">
<label htmlFor="user-register-desktop" className="font-bold">
Tu ususuario
Copy link

Copilot AI Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in label text: 'ususuario' should be corrected to 'usuario'.

Suggested change
Tu ususuario
Tu usuario

Copilot uses AI. Check for mistakes.
</label>
<input
id="user-register-desktop"
type="text"
placeholder="Correo electrónico"
className="w-full border-1 border-purple-300 p-2 rounded"
/>
</div>
<div className="flex flex-col gap-1">
<label htmlFor="email-register-desktop" className="font-bold">
Tu correo
</label>
<input
id="email-register-desktop"
type="text"
placeholder="Correo electrónico"
autoComplete="email"
className="w-full border-1 border-purple-300 p-2 rounded"
/>
</div>
<div>
<label htmlFor="password-register-desktop" className="font-bold">
Tu contraseña
</label>
<input
id="password-register-desktop"
type="password"
placeholder="Contraseña"
className="w-full border-1 border-purple-300 p-2 rounded"
autoComplete="current-password"
/>
</div>
<button className="bg-purple rounded p-2">Crear cuenta</button>
</form>
<div className="flex gap-1">
<p>¿Ya tienes una cuenta?</p>
<button className="text-purple cursor-pointer" onClick={() => setMode('login')}>
Inicia sesión
</button>
</div>
</section>
</div>
);
}
Loading