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
220 changes: 196 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,212 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
![header](https://capsule-render.vercel.app/api?type=waving&color=047857&height=250&section=header&text=COWERKERS&fontSize=80&fontAlignY=40&fontColor=ffffff)

## Getting Started
## **📑 목차**

First, run the development server:
> ***[프로젝트 소개](#프로젝트-소개)***
>
> ***[개발 기간](#개발-기간)***
>
> ***[개발자 소개](#개발자-소개)***
>
> ***[상세 계획](#상세-계획)***
>
> ***[User Flow](#User-Flow)***
>
> ***[프로젝트 구조](#프로젝트-구조)***
>
> ***[개발 환경](#개발-환경)***
>
> ***[기술 스택](#기술-스택)***
>
> ***[주요 기능](#주요-기능)***
>
> ***[배포 및 실행 방법](#배포-및-실행-방법)***
>
</br>

## 🧑‍💻 <a name="프로젝트-소개"/>프로젝트 소개

이 프로젝트는 [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) 으로 시작된 [Next.js](https://nextjs.org/) 프로젝트입니다.

Coworkers는 팀을 구성해서 할 일을 만들고, 공유하고 소통하면서 업무를 효율적으로 할 수 있게 돕는 서비스입니다.

</br>

## 🔗 링크

[GitHub](https://github.com/team-collabor/coworkers)

[🎬 시연 영상](https://www.youtube.com/watch?v=sF21zWhRcss)

[🌐 배포 사이트](https://coworkers-colla.netlify.app)

</br>

## 👨‍🏫 <a name="주요-기능"/>주요 기능

|![image](https://github.com/user-attachments/assets/31c20b48-9c9e-4894-b560-de0630da47d2)|![image](https://github.com/user-attachments/assets/553dcfc9-d308-4e3d-a0a3-60dd602900c4)|![image](https://github.com/user-attachments/assets/0e1908e3-88e1-4f30-baf9-bb6ec3abb8ec)|
|:---:|:---:|:---:|
|**랜딩 페이지**|**팀 페이지**|**할 일 페이지**|

|![image](https://github.com/user-attachments/assets/6b3ed4c5-ed2a-4c8c-ae32-8f7d9622b67a)|![image](https://github.com/user-attachments/assets/50679453-8afa-4185-8aa1-03f14e3eb6e2)|![image](https://github.com/user-attachments/assets/1432afe2-988e-404f-81a2-c23e313f4049)|
|:---:|:---:|:---:|
|**자유 게시판**|**계정 설정 페이지**|**마이 히스토리 페이지**|

</br>

## 🗓️ <a name="개발-기간"/>개발 기간

***10 / 7 (목) ~ 11 / 14 (목)***

</br>

## **👨‍👨‍👦‍👦 개발자 소개**

- **김우성** [@me92years](https://github.com/me92years) : 마이 히스토리 페이지
- **이승현** [@leesh7048](https://github.com/leesh7048) : 자유게시판 페이지
- **옥승현** [@SeungHyunOK](https://github.com/SeungHyunOK) : 렌딩페이지 및 계정 설정 페이지
- **정원식** [@wonsik3686](https://github.com/wonsik3686) : 할 일 페이지
- **정인재** [@Injaeeee](https://github.com/Injaeeee?pvs=4,) : 팀 페이지

</br>

## 📃 <a name="상세-계획"/>상세 계획과 일정

[**📌 상세 계획**](https://www.notion.so/wonsik/11309277475d81549fe7ebf0e04dae7d,)

[**📝 상세 일정**](https://www.notion.so/wonsik/11309277475d810db53ec53c248f89d7,)

</br>

## 💡 <a name="User-Flow"/>User Flow

![코워커스 유저플로우](https://github.com/user-attachments/assets/8a985e36-821c-495c-93bf-64154343e896)

</br>

## 📁 <a name="프로젝트-구조"/>프로젝트 구조

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
📁wine/
├── 📁public/
│ ├── 📁images/ # 이미지 파일 폴더
│ └── 📁ic_wine.svg ...
├── 📁constants/
│ └── 📁auth/
│ └── mediaQueryBreakPoint.ts
├── 📁src/
│ └── 📁components/ # 재사용 가능한 컴포넌트
│ └── 📁common/ # 공통 컴포넌트
│ ├── 📁Button/
│ │ └── Button.tsx
│ └── 📁Toast/
│ └── Toast.tsx
├── 📁pages/ # Next.js page 라우팅
│ │ └── 📁signin/
│ │ └── index.tsx
│ │ └── 📁signup/
│ │ └── index.tsx
│ │ └── 📁[id]/ # 팀 페이지에 들어갈 컴포넌트 모음
│ │ │ ├── 📁editteam/
│ │ │ │ └── index.tsx
│ │ └── index.tsx
│ │ └── index.tsx
│ │ └── _app.tsx
│ │ └── _404.tsx
│ │
│ ├── 📁libs/ # 라이브러리 관련된 세팅 및 함수들 정리하는 폴더
│ │ └── 📁axios/ # axios 관련 세팅 및 api 요청 함수
│ │ └── axiosInstance.ts
│ │ └── 📁auth/
│ │ └── 📁image/
│ │ └── 📁review/
│ │ └── 📁user/
│ │ └── 📁wine/
│ │
│ ├── 📁contexts/ # 전역 상태 관리
│ │
│ ├── 📁hooks/ # 커스텀 React 훅
│ │
│ ├── 📁types/ # 타입 폴더 (DTO 혹은 전역적으로 사용되는 type 미리 정의)
│ │ # 컴포넌트 props의 경우에는 해당 컴포넌트 위치에 정의
│ │
│ ├── 📁styles/ # 스타일 관련 파일 모음
│ │ └── global.css
│ │
│ │
│ └── 📁utils/ # 유틸리티 폴더
├─ .gitignore
├─ .env.local # 각자 환경에서 별도 생성 필요
├─ .eslintrc.json
├─ .prettierrc.json
├─ next.confing.mjs
├─ tailwind.config.ts
├─ tsconfig.json
...생략
```

</br>

## 💻 <a name="개발-환경"/>개발 환경

|OS|IDE|Version Control|Package Manager|deploy|Community|
|:---:|:---:|:---:|:---:|:---:|:---:|
|![macOS](https://img.shields.io/badge/macOS-000000?style=for-the-badge&logo=apple&logoColor=white) ![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)|![Visual Studio Code](https://img.shields.io/badge/Visual_Studio_Code-0078d7?style=for-the-badge&logo=visual-studio-code&logoColor=white) ![IntelliJ IDEA](https://img.shields.io/badge/IntelliJ_IDEA-000000?style=for-the-badge&logo=intellij-idea&logoColor=white)|![Git](https://img.shields.io/badge/Git-F05032?style=for-the-badge&logo=git&logoColor=white) ![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github&logoColor=white)|![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)|![Vercel](https://img.shields.io/badge/Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white)|![Discord](https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white)![Notion](https://img.shields.io/badge/Notion-000000?style=for-the-badge&logo=notion&logoColor=white)|

</br>

## ⚒ <a name="기술-스택"/>기술 스택

![React](https://img.shields.io/badge/React-61DAFB?style=for-the-badge&logo=react&logoColor=white)
![Next.js](https://img.shields.io/badge/Next.js-000000?style=for-the-badge&logo=next.js&logoColor=white)
![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)
![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=for-the-badge&logo=tailwind-css&logoColor=white)
![Axios](https://img.shields.io/badge/Axios-5A29E4?style=for-the-badge&logo=axios&logoColor=white)

</br>

## 🚀 <a name="배포-및-실행-방법"/>배포 및 실행 방법

**1. 프로젝트 클론**

`git clone https://github.com/Codeit-FE08-Part3-Team6/wine.git cd wine](https://github.com/team-collabor/coworkers.git`

**2. 의존성 설치**

프로젝트에서 사용하는 패키지들을 설치합니다.

`npm install`

**3. 개발 서버 실행**

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
다음 명령어를 실행하여 로컬 개발 환경에서 프로젝트를 실행할 수 있습니다.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
`npm run dev`

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
이후 브라우저에서 [http://localhost:3000](http://localhost:3000/) 으로 접속하여 개발 중인 웹 애플리케이션을 확인할 수 있습니다.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
**4. 빌드 및 배포**

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
프로덕션 환경에서 사용하기 위해 빌드할 때는 아래 명령어를 사용합니다.

## Learn More
`npm run build`

To learn more about Next.js, take a look at the following resources:
그 후, 아래 명령어로 빌드된 파일을 실제로 실행합니다.

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
`npm start`

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
**5. 배포**

## Deploy on Vercel
이 프로젝트는 netlify을 사용하여 배포할 수 있습니다.

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
GitHub와 연동된 netlify 계정을 통해 자동으로 배포되며, 코드를 push하면 자동으로 배포 프로세스가 진행됩니다.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
[**배포 사이트**](https://wine-nine-xi.vercel.app/?pvs=4%5D(https://coworkers-colla.netlify.app/,)

Choose a reason for hiding this comment

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

이 코드 패치는 Next.js를 사용한 프로젝트의 README 파일을 업데이트한 것입니다. 코드 리뷰 및 개선 사항은 다음과 같습니다:

  1. 잘못된 이미지 링크

    • README에서 사용된 이미지 링크가 잘못되었습니다. 올바른 이미지 링크를 제공해야 합니다.
  2. 코드 일관성

    • 코드 구조가 파트별로 잘 구분되어 있지만, 일부 들여쓰기와 형식이 일관성이 더 필요합니다. 모든 코드 블록이 일관된 스타일을 따르도록 하세요.
  3. 번역 확인

    • 한국어 번역 문장에 오타가 있거나 더 자연스러운 표현이 필요한 부분이 있습니다. 문장을 다듬어 더 자연스러운 한국어로 수정하세요.
  4. 배포 방법 설명

    • 프로젝트를 배포하는 방법에 대한 자세한 설명이 필요합니다. 배포 단계를 더 자세히 설명하고, 필요한 설치 인스트럭션을 제공하세요.

이러한 부분들을 개선하여 README 파일을 더 명확하고 사용자 친화적으로 만들어보세요.

14 changes: 14 additions & 0 deletions src/constants/formSchemas/teamSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { PostGroupRequest } from '@/types/dto/requests/group.request.types';
import { z } from 'zod';

export const teamSchema: z.ZodSchema<PostGroupRequest> = z.object({
name: z
.string()
.min(1, { message: '팀 이름은 필수 입력입니다.' })
.max(30, { message: '팀 이름은 30글자 이하로 입력해주세요.' }),
image: z.string().min(1),
});

export const attendTeamSchema = z.object({
link: z.string().min(1, { message: '팀 링크를 입력해주세요.' }),
});

Choose a reason for hiding this comment

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

코드는 TypesScript와 Zod 라이브러리를 사용하여 그룹 요청을 검증하는 스키마를 정의하고 있습니다.

이 코드 조각은 주로 입력 유효성을 확인하고 있습니다. 그러나 몇 가지 개선 사항이 있습니다:

  1. 코드의 가독성을 높이기 위해 주석을 추가할 수 있습니다.
  2. min(1)과 같이 임의의 값 대신 required()를 사용하여 필드가 필수임을 명시적으로 나타낼 수 있습니다.
  3. 팀 이름(name) 필드의 경우 30자로 제한되어 있지만 이 값이 길이를 초과하면 실패하는 처리가 없습니다. 이에 대한 추가 처리가 필요할 수 있습니다.
  4. attendTeamSchema의 link 필드가 min(1)로 지정되었는데, 링크의 형식에 대한 추가 유효성 검사가 필요할 수 있습니다.

이러한 개선 사항을 고려하여 코드를 더욱 견고하게 만들 수 있습니다.

10 changes: 1 addition & 9 deletions src/pages/[id]/editteam/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Button, {
} from '@/components/common/Button/Button';
import Input from '@/components/common/Input';
import ProfileInput from '@/components/Team/ProfileInput';
import { teamSchema } from '@/constants/formSchemas/teamSchema';
import { useToast } from '@/hooks/useToast';
import { usePatchTeamMutation, useTeamQuery } from '@/queries/groups.queries';
import { groupsQueryKeys } from '@/queries/keys/groups.key';
Expand All @@ -24,15 +25,6 @@ import Head from 'next/head';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import { z } from 'zod';

const teamSchema: z.ZodSchema<PostGroupRequest> = z.object({
name: z
.string()
.min(1, { message: '팀 이름은 필수 입력입니다.' })
.max(30, { message: '팀 이름은 30글자 이하로 입력해주세요.' }),
image: z.string().min(1),
});

export default function EditTeam() {
const router = useRouter();

Choose a reason for hiding this comment

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

이 코드 패치에서는 기존의 teamSchema 정의를 상수로 불러오는 방식에서 외부 모듈에서 teamSchema를 가져오도록 변경했습니다. 코드의 구조적인 변경이 없으며 코드베이스의 관리성이 높아지는 장점이 있습니다.

개선 제안:

  1. 코드 중복 제거: teamSchema를 한 번만 정의해야하기 때문에 이전에 정의된 teamSchema는 제거하여 중복을 방지할 수 있습니다.

잠재적 버그 리스크:

  1. 변수 중복: 코드 중에 이미 teamSchema를 다시 선언하는 부분이 있어 변수 중복이 발생할 수 있습니다. 변수 중복은 코드의 가독성과 유지보수를 어렵게 할 수 있으므로 주의가 필요합니다.

Expand Down
10 changes: 1 addition & 9 deletions src/pages/addteam/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Button, {
} from '@/components/common/Button/Button';
import Input from '@/components/common/Input';
import ProfileInput from '@/components/Team/ProfileInput';
import { teamSchema } from '@/constants/formSchemas/teamSchema';
import { useRedirect } from '@/hooks/useRedirect';
import { useTeamMutation } from '@/queries/groups.queries';
import { useUploadImageMutation } from '@/queries/uploadImage.query';
Expand All @@ -18,15 +19,6 @@ import Head from 'next/head';
import { useRouter } from 'next/router';
import { useState } from 'react';
import { useForm } from 'react-hook-form';
import { z } from 'zod';

const teamSchema: z.ZodSchema<PostGroupRequest> = z.object({
name: z.string().min(1, { message: '팀 이름은 필수 입력입니다.' }),
image: z
.string()
.min(1)
.refine((val) => val !== '/icons/BaseTeam_Icon.svg'),
});

export default function AddTeam() {
const [selectImage, setSelectImage] = useState<File | null>(null);

Choose a reason for hiding this comment

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

이 코드 패치는 팀 정보를 추가하는 기능을 하는 컴포넌트인데, 기능적으로 문제가 없어 보입니다. 그러나 몇 가지 개선 제안이 있습니다:

  1. zod 라이브러리에서 이미 teamSchema가 정의되어 있기 때문에, 중복 정의가 있으므로 코드 중복을 방지하기 위해 기존에 정의된 teamSchema를 재사용하면 됩니다.

  2. 새롭게 추가된 teamSchema를 import 했으므로, 기존에 있던 teamSchema 정의는 필요가 없어 보입니다. 중복된 코드를 제거하면 코드를 깔끔하게 유지할 수 있습니다.

  3. 코드의 가독성을 높이기 위해, 변수나 함수의 의미를 더 명확하게 표현할 수 있도록 이름을 변경하는 것도 고려해 볼만 합니다.

전반적으로 코드는 안정적으로 보이지만, 중복 정의된 teamSchema를 개선하여 코드를 더 간결하고 가독성 높게 유지할 수 있습니다.

Expand Down
9 changes: 3 additions & 6 deletions src/pages/attendteam/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Button, {
TextSize,
} from '@/components/common/Button/Button';
import Input from '@/components/common/Input';
import { attendTeamSchema } from '@/constants/formSchemas/teamSchema';
import { useRedirect } from '@/hooks/useRedirect';
import { useToast } from '@/hooks/useToast';
import { useInviteGroupMutation } from '@/queries/groups.queries';
Expand All @@ -18,11 +19,7 @@ import { useRouter } from 'next/router';
import { useForm } from 'react-hook-form';
import { z } from 'zod';

const teamSchema = z.object({
link: z.string().min(1, { message: '팀 링크를 입력해주세요.' }),
});

type TeamLinkValues = z.infer<typeof teamSchema>;
type TeamLinkValues = z.infer<typeof attendTeamSchema>;

export default function AttendTeam() {
const router = useRouter();
Expand All @@ -36,7 +33,7 @@ export default function AttendTeam() {
handleSubmit,
formState: { errors },
} = useForm<TeamLinkValues>({
resolver: zodResolver(teamSchema),
resolver: zodResolver(attendTeamSchema),
defaultValues: {
link: '',
},

Choose a reason for hiding this comment

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

수정 사항:

  1. attendTeamSchema 대신 teamSchema를 사용하는 것이 올바른지 확인하십시오.
  2. teamSchema 객체를 주석 처리하고 사용되지 않는 코드를 제거하십시오.
  3. 코드 중복을 최소화하고 잠재적인 오류를 방지하기 위해 상수를 사용하는 것이 좋습니다.

잠재적인 버그 리스크:

  1. attendTeamSchema가 올바르게 작성되었는지 확인하십시오.
  2. zodResolver 함수가 올바르게 구현되었는지 확인하십시오.

개선 제안:

  1. 전체 프로젝트에서 일관된 네이밍 및 코드 스타일을 유지하십시오.
  2. 추가로 사용하지 않는 코드를 제거하여 코드의 가독성을 높이십시오.
  3. 다른 팀원이 코드를 이해하기 쉽도록 필요한 주석을 추가하십시오.
  4. 코드의 복잡성을 줄이고 유지 및 보수를 쉽게하기 위해 함수 및 변수의 적절한 분리를 고려하십시오.

Expand Down
Loading