Skip to content

Commit

Permalink
Merge pull request #184 from Nawabali-project/releaseCopied
Browse files Browse the repository at this point in the history
Develop -> Release Merge
  • Loading branch information
peter-jaesungyu authored May 2, 2024
2 parents d55f290 + cd5f3dd commit 9a6dfe3
Show file tree
Hide file tree
Showing 60 changed files with 1,377 additions and 1,222 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 2 additions & 34 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

205 changes: 204 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,204 @@
# Nawabali-BE
![header](https://capsule-render.vercel.app/api?type=waving&color=6994CDEE&text=&animation=twinkling&height=80)
# 🏡 동네방네 🏡

![readme_mockup2](https://github.com/kyungmin1221/BaekJoon/assets/105621255/41dd9ef3-00ce-46a9-b4d8-52a7298108c3)
<br>
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FNawabali-project%2FNawabali-BE&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)

</div>

## 배포 주소
> **개발 버전** : [https://dongnaebangnae.vercel.app/](https://dongnaebangnae.vercel.app/) <br>
> **서비스 서버** : [https://www.dongnaebangnae.com/](https://www.dongnaebangnae.com/)<br>


## 목차
- [프로젝트 소개](#프로젝트-소개)
- [프로젝트 개요](#프로젝트-개요)
- [팀원 소개](#백엔드-팀원-소개)

## 프로젝트 소개


## 프로젝트 개요
> **프로젝트 이름 : 동네방네** <br/>
**개발기간: 2024.04.26 ~ 2024.05.06** <br/>
**언어 : Spring Boot** <br />


## 백엔드 팀원 소개

| **박경민(팀장)** | **유재성** | **김주원** | **이은미** |
| :------: | :------: | :------: | :------: |
| [<img src="https://github.com/kyungmin1221/BaekJoon/assets/105621255/1d1fd83d-ef01-4144-9d65-9b6056d40a43" height=150 width=150> <br/> @kyungmin](https://github.com/kyungmin1221) | [<img src="" height=150 width=150> <br/> @]() | [<img src="" height=150 width=150> <br/> @]() | [<img src="https://github.com/kyungmin1221/BaekJoon/assets/105621255/2373d997-73e3-47d7-84f9-fdc0c12cfa28" height=150 width=150> <br/> @minnieming](https://github.com/minnieming) |


## 1. 개발 환경

## Stacks 🐈

### Environment
![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)

### BackEnd FrameWork
![SpringBoot](https://img.shields.io/badge/springboot-6DB33F?style=for-the-badge&logo=springboot&logoColor=white)
![Soket](https://img.shields.io/badge/socket.io-010101?style=for-the-badge&logo=socket.io&logoColor=white)
<img src="https://img.shields.io/badge/JPA-212121?style= &logo=jpa&logoColor=white"/>
<img src="https://img.shields.io/badge/Querydsl-0285C9?style= &logo=querydsl&logoColor=white"/>

### Server
<img src="https://img.shields.io/badge/Amazon AWS-232F3E?style=for-the-badge&logo=amazon aws&logoColor=white">
<img src="https://img.shields.io/badge/NGINX-009639?style= &logo=nginx&logoColor=white"/>

### DataBase
![MYSQL](https://img.shields.io/badge/mysql-4479A1?style=for-the-badge&logo=mysql&logoColor=white)

### Development Tools
<img src="https://img.shields.io/badge/IntelliJ IDEA-000000?style=flat-square&logo=intellij-idea&logoColor=white">


### Communication
![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=Slack&logoColor=white)
![Notion](https://img.shields.io/badge/Notion-000000?style=for-the-badge&logo=Notion&logoColor=white)


## 2. 채택한 개발 기술과 브랜치 전략

### Spring

- d

### d

- f

### d

-

### 브랜치 전략

- Git-flow 전략을 기반으로 main, develop 브랜치와 feature 보조 브랜치를 운용했습니다.
- main, develop, Feat 브랜치로 나누어 개발을 하였습니다.
- **main** 브랜치는 배포 단계에서만 사용하는 브랜치입니다.
- **develop** 브랜치는 개발 단계에서 git-flow의 master 역할을 하는 브랜치입니다.
- **Feat** 브랜치는 기능 단위로 독립적인 개발 환경을 위하여 사용하고 merge 후 각 브랜치를 삭제해주었습니다.

<br>



## 4. 역할 분담

### 😎 박경민

- **기능**
- 게시물 관련 기능
- 게시물 조회 / 무한스크롤
- QueryDSL 동적 쿼리를 사용한 조회
- 북마크 관련 기능
- 북마크 생성/취소
- 이미지 최적화 처리
- 이미지 리사이즈 처리하여 성능 최적화
- 이메일 인증 구현
- Redis 사용
- ElasticSearch 를 사용한 검색 기능
- 게시물 내용 검색


<br>

### 🤩 유재성

- **기능**

<br>

### 😃 김주원

- **기능**

<br>

### 🥳 이은미

- **기능**
- 댓글 CRUD
- 좋아요 CRUD
- 채팅, 알림 기능

<br>


## 3. 프로젝트 구조

```
├── README.md
├── .eslintrc.js
├── .gitignore
├── .prettierrc.json
├── package-lock.json
├── package.json
├── public
│ └── index.html
└── src
├── App.jsx
├── index.jsx
├── api
│ └── mandarinAPI.js
├── asset
│ ├── fonts
│ ├── css_sprites.png
│ ├── logo-404.svg
│ └── logo-home.svg
│ .
│ .
│ .
├── atoms
│ ├── LoginData.js
│ └── LoginState.js
├── common
│ ├── alert
│ │ ├── Alert.jsx
│ │ └── Alert.Style.jsx
│ ├── button
│ ├── comment
│ ├── inputBox
│ ├── post
│ ├── postModal
│ ├── product
│ ├── tabMenu
│ ├── topBanner
│ └── userBanner
├── pages
│ ├── addProduct
│ │ ├── AddProduct.jsx
│ │ └── AddProduct.Style.jsx
│ ├── chatList
│ ├── chatRoom
│ ├── emailLogin
│ ├── followerList
│ ├── followingList
│ ├── home
│ ├── join
│ ├── page404
│ ├── postDetail
│ ├── postEdit
│ ├── postUpload
│ ├── productEdit
│ ├── profile
│ ├── profileEdit
│ ├── profileSetting
│ ├── search
│ ├── snsLogin
│ └── splash
├── routes
│ ├── privateRoutes.jsx
│ └── privateRoutesRev.jsx
└── styles
└── Globalstyled.jsx
```
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-cache'

// elastic search
// implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
implementation 'org.springframework.data:spring-data-elasticsearch:4.2.2'
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
// implementation 'org.springframework.data:spring-data-elasticsearch:4.2.2'

// Querydsl 추가
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
Expand Down Expand Up @@ -80,7 +80,8 @@ dependencies {
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'


// thumbnailator
implementation 'net.coobird:thumbnailator:0.4.14'
}

// Querydsl 설정부
Expand Down
2 changes: 2 additions & 0 deletions src/main/generated/com/nawabali/nawabali/domain/QUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class QUser extends EntityPathBase<User> {

public final StringPath nickname = createString("nickname");

public final BooleanPath oauthStatus = createBoolean("oauthStatus");

public final StringPath password = createString("password");

public final com.nawabali.nawabali.domain.image.QProfileImage profileImage;
Expand Down
44 changes: 23 additions & 21 deletions src/main/java/com/nawabali/nawabali/config/WebSecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import com.nawabali.nawabali.global.tool.redis.RedisTool;
import com.nawabali.nawabali.repository.UserRepository;
import com.nawabali.nawabali.security.Jwt.JwtAuthenticationFilter;
import com.nawabali.nawabali.security.Jwt.JwtAuthorizationFilter;
import com.nawabali.nawabali.security.Jwt.JwtLogoutHandler;
import com.nawabali.nawabali.security.Jwt.JwtUtil;
import com.nawabali.nawabali.security.Jwt.*;
import com.nawabali.nawabali.security.UserDetailsServiceImpl;
import jakarta.servlet.Filter;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.security.servlet.PathRequest;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -53,6 +51,10 @@ public JwtAuthenticationFilter jwtAuthenticationFilter() throws Exception {
public JwtAuthorizationFilter jwtAuthorizationFilter() {
return new JwtAuthorizationFilter(jwtUtil, userDetailsService, redisTool,userRepository);
}
@Bean
public JwtExceptionHandlerFilter jwtExceptionHandlerFilter(){
return new JwtExceptionHandlerFilter();
}

@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception{ // CSRF 설정
Expand All @@ -68,7 +70,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
"http://127.0.0.1:3000", "http://127.0.0.1:5500", "http://127.0.0.1:5000",
"http://hhboard.shop", "https://hhboard.shop", "https://vercel-nu-lyart.vercel.app", // 프론트엔드 주소 추가 필요
"https://hh-99-nawabali-fe.vercel.app", "https://nawabali-fe.vercel.app",
"https://www.dongnaebangnae.com", "https://prod.dongnaebangnae.com"
"https://www.dongnaebangnae.com", "https://prod.dongnaebangnae.com", "https://dongnaebangnae.vercel.app"

)
);
Expand All @@ -94,23 +96,22 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
);

http.authorizeHttpRequests((authorizeHttpRequests) ->
authorizeHttpRequests
authorizeHttpRequests
// .anyRequest().permitAll()
.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll() // resources 접근 허용 설정
.requestMatchers("/api/user/kakao/callback").permitAll()
.requestMatchers("/email-verification").permitAll()
.requestMatchers("/ping", "/profile").permitAll() // 항상 200 OK 반환하는 health check 전용 API
.requestMatchers(
"/users/logout","/users/signup","/users/check-nickname", "users/info").permitAll()
.requestMatchers(HttpMethod.POST, "/users/login").permitAll()
.requestMatchers("/posts","/posts/district/*").permitAll()
.requestMatchers(HttpMethod.GET, "/posts/**").permitAll() // 게시글 상세 조회 허가
.requestMatchers("/comments/check/posts/**").permitAll()
// .requestMatchers("/swagger/**","/swagger-ui/**","/v3/api-docs/**").permitAll()
.requestMatchers("/ws-stomp/**").permitAll()
.requestMatchers("/chat/**").permitAll()
.requestMatchers("/notification/**").permitAll()
.anyRequest().authenticated() // 그 외 모든 요청 인증처리
.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll() // resources 접근 허용 설정
.requestMatchers("/api/user/kakao/callback").permitAll()
.requestMatchers("/email-verification").permitAll()
.requestMatchers("/ping", "/profile").permitAll() // 항상 200 OK 반환하는 health check 전용 API
.requestMatchers(
"/users/logout","/users/signup","/users/check-nickname", "users/info").permitAll()
.requestMatchers(HttpMethod.POST, "/users/login").permitAll()
.requestMatchers("/posts","/posts/district/*", "posts/searchAll", "posts/updateAll").permitAll()
.requestMatchers(HttpMethod.GET, "/posts/**").permitAll() // 게시글 상세 조회 허가
.requestMatchers("/comments/check/posts/**").permitAll()
// .requestMatchers("/swagger/**","/swagger-ui/**","/v3/api-docs/**").permitAll()
.requestMatchers("/ws-stomp/**").permitAll()
.requestMatchers("/notification/**").permitAll()
.anyRequest().authenticated() // 그 외 모든 요청 인증처리
);

// http.logout(logoutconfigurer->logoutconfigurer
Expand All @@ -119,6 +120,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
// .addLogoutHandler(jwtLogoutHandler));

// 필터 관리
http.addFilterBefore(jwtExceptionHandlerFilter(), JwtAuthenticationFilter.class);
http.addFilterBefore(jwtAuthorizationFilter(), JwtAuthenticationFilter.class);
http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);

Expand Down
Loading

0 comments on commit 9a6dfe3

Please sign in to comment.