Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- name: Create .env file
run: |
echo "DOCKER_HUB_USERNAME=${{ secrets.DOCKER_HUB_USERNAME }}" > .env
echo "NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}" >> .env
echo "NEXT_PUBLIC_GOOGLE_REDIRECT_CLIENT_ID=${{secrets.NEXT_PUBLIC_GOOGLE_REDIRECT_CLIENT_ID}}" >> .env
echo "NEXT_PUBLIC_GOOGLE_REDIRECT_URI=${{secrets.NEXT_PUBLIC_GOOGLE_REDIRECT_URI}}" >> .env

Expand Down Expand Up @@ -46,7 +47,7 @@ jobs:

- name: Upload Deployment Package to S3
run: |
aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_BUCKET }}/deploy.zip
aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_BUCKET }}/main-deploy.zip

- name: Trigger CodeDeploy (CLI)
env:
Expand All @@ -57,5 +58,5 @@ jobs:
aws deploy create-deployment \
--application-name ${{ secrets.AWS_CODEDEPLOY_APP }} \
--deployment-group-name ${{ secrets.AWS_CODEDEPLOY_GROUP }} \
--s3-location bucket=${{ secrets.S3_BUCKET }},bundleType=zip,key=deploy.zip \
--s3-location bucket=${{ secrets.S3_BUCKET }},bundleType=zip,key=main-deploy.zip \
--file-exists-behavior OVERWRITE
2 changes: 1 addition & 1 deletion src/app/api/auth/refresh/route.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextResponse } from 'next/server';
import axios from 'axios';

const API_BASE_URL = 'https://gdgocinha.site/auth'; // 프록시 대상 주소
const API_BASE_URL = process.env.NEXT_PUBLIC_BASE_API_URL;

export async function POST(req) {
const targetUrl = `${API_BASE_URL}/refresh`;
Expand Down
3 changes: 2 additions & 1 deletion src/app/api/signin/route.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import axios from 'axios';
import { NextResponse } from 'next/server';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

const ORIGINAL_AUTH_URL = 'https://gdgocinha.site/auth';
const ORIGINAL_AUTH_URL = process.env.NEXT_PUBLIC_BASE_API_URL;

export async function POST(request) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/app/auth/signin/custom/CustomAuthApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import axios from 'axios';

// 기존 직접 요청 URL
// const CUSTOM_AUTH_URL = 'https://gdgocinha.site/auth';
// const CUSTOM_AUTH_URL = process.env.NEXT_PUBLIC_BASE_API_URL;

// 새로운 프록시 URL (상대 경로 사용)
const PROXY_AUTH_URL = '/api/signin';
Expand Down
3 changes: 2 additions & 1 deletion src/app/auth/signin/google/GoogleAuthApi.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'
import axios from 'axios';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

const GOOGLE_AUTH_URL = 'https://gdgocinha.site/auth/oauth2/google';
const GOOGLE_AUTH_URL = process.env.NEXT_PUBLIC_BASE_API_URL + '/auth/oauth2/google';

// Google 로그인 코드 교환 함수
export const exchangeGoogleToken = async (code) => {
Expand Down
3 changes: 2 additions & 1 deletion src/app/auth/signin/screen/AuthFindId.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Button } from '@nextui-org/react';
import { Autocomplete, AutocompleteItem, AutocompleteSection } from '@nextui-org/react';
import { majors } from '@/app/recruit/majors';
import axios from 'axios';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

export default function AuthFindId({ handleBackToLogin }) {
const [name, setName] = useState('');
Expand All @@ -15,7 +16,7 @@ export default function AuthFindId({ handleBackToLogin }) {
const handleSubmitFindId = async () => {
try {
const response = await axios.post(
'https://www.gdgocinha.site/auth/findId', {
process.env.NEXT_PUBLIC_BASE_API_URL + '/auth/findId', {
name,
major,
phoneNumber,
Expand Down
3 changes: 2 additions & 1 deletion src/app/auth/signin/screen/AuthResetPassword.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { useState } from 'react';
import TransparentInput from '@/components/ui/TransparentInput';
import { Button } from '@nextui-org/react';
import axios from 'axios';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

export default function AuthResetPassword({ handleBackToLogin, handleBackToResetRequest, setLoading }) {
const [email, setEmail] = useState('');
const [newPassword, setNewPassword] = useState('');
const [verifyNewPassword, setVerifyNewPassword] = useState('');
const API_AUTH_URL = 'https://gdgocinha.site/auth';
const API_AUTH_URL = process.env.NEXT_PUBLIC_BASE_API_URL + '/auth';

const handleNewPassword = async () => {
if (newPassword !== verifyNewPassword) {
Expand Down
3 changes: 2 additions & 1 deletion src/app/auth/signin/screen/AuthResetRequest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { Button } from '@nextui-org/react';
import TransparentInput from '@/components/ui/TransparentInput';
import OtpInput from '@/components/ui/OtpInput';
import axios from 'axios';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

export default function AuthResetRequest({ handleNextStep, handleBackToLogin, setLoading }) {
const [name, setName] = useState('');
const [email, setEmail] = useState('');
const [otp, setOtp] = useState('');
const [isOtpDisabled, setIsOtpDisabled] = useState(true);
const [isNextDisabled, setIsNextDisabled] = useState(true);
const API_AUTH_URL = 'https://gdgocinha.site/auth';
const API_AUTH_URL = process.env.NEXT_PUBLIC_BASE_API_URL + '/auth';

const handleSendOtp = async () => {
try {
Expand Down
75 changes: 53 additions & 22 deletions src/app/main/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,85 @@
import React from 'react';
import React, { useState } from 'react';
import gdgocIcon from '@public/src/images/GDGoC_icon.png';
import Image from 'next/image';
import { Navbar, NavbarBrand, NavbarContent, NavbarItem, Link } from "@nextui-org/react";
import { Heart, User } from "lucide-react";
import { Navbar, NavbarBrand, NavbarContent, NavbarItem, NavbarMenuToggle, NavbarMenu, NavbarMenuItem, Link } from "@nextui-org/react";
import { Heart, User, LogOut } from "lucide-react";
import { useAuthenticatedApi } from '@/hooks/useAuthenticatedApi.js';

export default function Header() {

const [isMenuOpen, setIsMenuOpen] = useState(false);
const { apiClient, handleLogout }= useAuthenticatedApi();

const menuItems = [
{ name: "스터디", href: "/study" },
{ name: "공지사항", href: "#", onClick: () => alert('준비중입니다.') },
{ name: "프로젝트", href: "#", onClick: () => alert('준비중입니다.') },
{ name: "멤버", href: "#", onClick: () => alert('준비중입니다.') },
{ name: "로그아웃", href: "#", onClick: handleLogout }
];

return (
<Navbar className=" pl-[32px] min-h-[105px]" maxWidth="full">
<NavbarBrand className="flex flex-row gap-x-[16px] cursor-pointer flex-grow-0 basis-auto">
<Image className='w-[62px] h-[28px]' src={gdgocIcon} alt='gdgocIcon' />
<div className='text-white text-[16px] pt-[3px]'>
<strong>GDGoC</strong> Inha univ.
</div>
</NavbarBrand>
<Navbar
//className=" min-h-[105px]"
height="6rem"
maxWidth="full"
onMenuOpenChange={setIsMenuOpen}
>
<NavbarContent>
<NavbarMenuToggle
aria-label={isMenuOpen ? "Close menu" : "Open menu"}
className="hidden mobile:inline text-white "
/>
<NavbarBrand className="flex flex-row gap-x-[16px] cursor-pointer flex-grow-0 basis-auto">
<Image className='w-[62px] h-[28px]' src={gdgocIcon} alt='gdgocIcon' />
<div className='text-white text-[16px] pt-[3px]'>
<strong>GDGoC</strong> Inha univ.
</div>
</NavbarBrand>
</NavbarContent>

<NavbarContent className="hidden sm:flex gap-16 ml-[70px]" justify="start">
<NavbarContent className="mobile:hidden flex gap-16 ml-[70px]" justify="start">
<NavbarItem>
<Link color="foreground" className="text-white" href="#">
공지사항
<Link color="foreground" className="text-white" href="/study">
스터디
</Link>
</NavbarItem>
<NavbarItem>
<Link color="foreground" className="text-white" href="/study">
스터디
<Link color="foreground" className="text-white" href="#" onClick={() => alert('준비중입니다.')}>
공지사항
</Link>
</NavbarItem>
<NavbarItem>
<Link color="foreground" className="text-white" href="#">
<Link color="foreground" className="text-white" href="#" onClick={() => alert('준비중입니다.')}>
프로젝트
</Link>
</NavbarItem>
<NavbarItem>
<Link color="foreground" className="text-white" href="#">
<Link color="foreground" className="text-white" href="#" onClick={() => alert('준비중입니다.')}>
멤버
</Link>
</NavbarItem>
</NavbarContent>

<NavbarContent justify="end" className='mr-5 gap-x-11'>
<NavbarItem>
<Heart className="w-9 h-9 text-white cursor-pointer" />
</NavbarItem>
<NavbarItem>
<User className="w-9 h-9 text-white cursor-pointer" onClick={() => handleLogout()} />
<LogOut className="w-9 h-9 text-white cursor-pointer mobile:hidden" onClick={() => handleLogout()} />
</NavbarItem>
</NavbarContent>

<NavbarMenu>
{menuItems.map((item, index) => (
<NavbarMenuItem key={`${item.name}-${index}`}>
<Link
className={`w-full text-white ${index === 4 ? "text-red-500 font-bold" : ""}`}
href={item.href}
size="lg"
onClick={item.onClick}
>
{item.name}
</Link>
</NavbarMenuItem>
))}
</NavbarMenu>
</Navbar>
);
}
14 changes: 14 additions & 0 deletions src/app/main/components/CardCarousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ export default function CardCarousel({ id, title, children }) {
pagination: false,
drag: true,
snap: true,
breakpoints: {
1024: {
perPage: 3,
gap: '1.5rem',
},
768: {
perPage: 2,
gap: '1rem',
},
480: {
perPage: 1,
gap: '0.5rem',
},
},
});

cardSplide.mount();
Expand Down
14 changes: 7 additions & 7 deletions src/app/main/components/EventCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import {Button} from "@nextui-org/react";

export default function EventCard({ logo, title, statusLabel, statusColor, eventType, eventTypeColor, description, details, isHidden }) {
return (
<div id="card" className='flex flex-col rounded-3xl bg-[#303030] w-[400px] h-[550px] px-6 pt-14 relative'>
<div id="card" className='flex flex-col rounded-3xl bg-[#303030] w-full h-full max-h-[70vh] aspect-[0.7] px-6 pt-14 relative'>
<div className='flex flex-row gap-x-2 mb-5'>
<Image src={logo} hidden={isHidden} width={38} height={38} alt='logoimg' />
<p className='text-white text-3xl font-bold'>{title}</p>
<p className='text-white text-[2vw] font-bold'>{title}</p>
</div>
<div className='flex flex-row gap-x-5 mb-5'>
<div className={`flex rounded-3xl w-[115px] h-[35px] bg-[${statusColor}] text-black font-bold text-xl text-center justify-center items-center`}>
<div className='border-3 border-[#E94335] bg-[#E94335] rounded-3xl text-black font-bold text-xl flex items-center justify-center mobile:text-sm px-2 mobile:border-2'>
{statusLabel}
</div>
<div className={`flex rounded-3xl w-[115px] h-[35px] bg-[${eventTypeColor}] text-black font-bold text-xl text-center justify-center items-center`}>
{eventType}
<div className='border-3 border-[#34A853] bg-[#34A853] rounded-3xl text-black font-bold text-xl flex items-center justify-center mobile:text-sm px-2 mobile:border-2'>
{eventType}
</div>
</div>
<p className='text-white text-xl font-bold mb-6'>{description}</p>
<div className='flex flex-col w-full px-4 py-7 bg-[#151515] rounded-3xl text-white text-base'>
<p className='text-white text-[1.5vw] font-bold mb-6'>{description}</p>
<div className='flex flex-col w-full px-4 py-7 bg-[#151515] rounded-3xl text-white text-[1.2vw]'>
<div className='flex flex-row gap-x-5 mb-2'>
<p className='flex-none'><strong>목적</strong></p>
<p>{details.purpose}</p>
Expand Down
10 changes: 5 additions & 5 deletions src/app/main/components/MainCarousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ export default function MainCarousel({ slides }) {
<Image className='w-full h-full object-cover blur-lg opacity-50' src={slide.background} alt='event background' />
</div>
<div className="z-10 flex flex-row w-full h-full">
<div className='flex justify-center items-center w-1/2'>
<Image src={slide.poster} width={375} height={500} alt='event poster' />
<div className='flex justify-center items-center w-1/2 mobile:hidden'>
<Image src={slide.poster} width={20} height={27} alt='event poster' className='w-[20vw] h-[46vh] object-contain' />
</div>
<div className='flex justify-center items-start w-1/2 flex-col'>
<div className='flex justify-center items-start w-1/2 flex-col pr-10 mobile:pl-10 mobile:w-full'>
<div className="justify-start items-start flex flex-col gap-y-5">
<div className='flex flex-row gap-x-5'>
<div className='border-3 border-[#E94335] rounded-3xl px-9 py-1 text-[#E94335] font-bold text-xl'>
<div className='border-3 border-[#E94335] rounded-3xl text-[#E94335] font-bold text-xl flex items-center justify-center mobile:text-sm px-9 mobile:px-5 mobile:border-2'>
{slide.tag1}
</div>
<div className='border-3 border-[#34A853] rounded-3xl px-9 py-1 text-[#34A853] font-bold text-xl'>
<div className='border-3 border-[#34A853] rounded-3xl text-[#34A853] font-bold text-xl flex items-center justify-center mobile:text-sm px-9 mobile:px-5 mobile:border-2'>
{slide.tag2}
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/app/main/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function Page() {
<div className="w-full flex flex-col justify-center">
<MainCarousel slides={slidesWithImages} />

<div className='flex flex-col max-w-[1300px] w-full mx-auto justify-start pt-[130px]'>
<div className='flex flex-col max-w-[1300px] w-full mx-auto justify-start pt-[130px] px-5'>
<CardCarousel id="card-carousel-1" title="진행중인 행사">
{renderEventCards(ongoingEvents)}
</CardCarousel>
Expand All @@ -52,7 +52,6 @@ export default function Page() {
{renderEventCards(ongoingStudies)}
</CardCarousel>

{/* FAQ 섹션 */}
<FAQ />
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/recruit/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Recruit11 from '@/app/recruit/screen/Recruit11';
import Loader from '@/components/ui/Loader.jsx';
import VerticalProgressBar from './VerticalProgressBar.jsx';
import HorizontalProgressBar from './HorizontalProgressBar.jsx';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

export default function Recruit() {
const [mainRecruitData, setMainRecruitData] = useState(new Map());
Expand All @@ -41,7 +42,7 @@ export default function Recruit() {
const formattedData = formatRecruitData(mainRecruitData);
try {
setLoading(true)
const response = await axios.post("https://www.gdgocinha.site/apply", formattedData);
const response = await axios.post(process.env.NEXT_PUBLIC_BASE_API_URL + "/apply", formattedData);
router.push("/recruit/submit");
} catch (error) {
if (error.response && error.response.status === 500) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/recruit/screen/Recruit11.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default function Recruit11({ step, setChecked, updateRecruitData }) {
<ul>
<li className='text-base font-semibold'>• 👛 입금 계좌</li>
<li className='ml-[8px] mb-[15px]'>
: <strong className='text-[#34A853]'>카카오뱅크 3333252211505</strong> | 예금주명
<strong> 엄수빈</strong>
: <strong className='text-[#34A853]'>토스뱅크 1001-9049-2082</strong> | 예금주명
<strong> GDGoC INHA</strong>
</li>

<li className='text-base font-semibold'>• 💵 25-1 회비</li>
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useAuthApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import axios from 'axios';
import { useAuth } from '@/hooks/useAuth';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

const API_AUTH_URL = 'https://gdgocinha.site/auth';
const API_AUTH_URL = process.env.NEXT_PUBLIC_BASE_API_URL + '/auth';
const ROUTE_API_URL = '/api/auth';

export const useAuthApi = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useAuthenticatedApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useAuthApi } from './useAuthApi';
import { useMemo, useEffect, useRef, useCallback } from 'react';
import { useRouter } from 'next/navigation';
import axios from 'axios';
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";

export const useAuthenticatedApi = () => {
const { accessToken, setAccessToken, clearAuth } = useAuth();
Expand Down Expand Up @@ -39,7 +40,7 @@ export const useAuthenticatedApi = () => {
//로그인 이후 api 요청
const apiClient = useMemo(() => {
const client = axios.create({
baseURL: 'https://gdgocinha.site/',
baseURL: process.env.NEXT_PUBLIC_BASE_API_URL,
withCredentials: true,
});

Expand Down