-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from Recipe-Project/feature/add_readme
readme 파일 추가, swagger 3 업그레이드
- Loading branch information
Showing
15 changed files
with
290 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# 🍅 레시피 저장소 | ||
|
||
<br> | ||
<p align="center"> | ||
<img src = https://github.com/Recipe-Project/RecipeServer/assets/39457533/2dc442f4-83ee-4423-8a4e-21df261f26a1 height="180" width="180" /> | ||
</p> | ||
<br> | ||
<br> | ||
|
||
|
||
- 프로젝트 기간 : 2021.02 ~ | ||
- 댜운로드 URL : https://play.google.com/store/apps/details?id=com.recipe.android.recipeapp&hl=ko-KR | ||
|
||
<br> | ||
|
||
## 프로젝트 소개 | ||
|
||
- 레시피 저장소는 냉장고에 있는 재료를 등록하여 유통기한, 수량 등 재고 관리를 가능하게 해주는 서비스입니다. | ||
- 냉장고에 있는 재료들을 기반으로 재료 일치도에 따라 레시피를 추천해줍니다. | ||
- 검색을 통해 블로그, 유튜브, 공공 레시피를 찾아볼 수 있습니다. | ||
- 나만의 레시피를 등록하여 레시피 관리를 할 수 있습니다. | ||
|
||
<br> | ||
|
||
## 팀 구성 | ||
|
||
### 레시피 저장소 v 1.0 | ||
|
||
안드로이드 | 안드로이드 | 백엔드 | 백엔드 | 디자인 | ||
-|-|-|-|- | ||
[@Jsueeee](https://github.com/Jsueeee) | [@Boin-Kau](https://github.com/Boin-Kau) | [@joona95](https://github.com/joona95) | [@kimmjieun](https://github.com/kimmjieun) | @hailey | ||
|
||
### 레시피 저장소 v 2.0 (진행중) | ||
|
||
안드로이드 | 백엔드 | 디자인 | ||
-|-|- | ||
[@Jsueeee](https://github.com/Jsueeee) | [@joona95](https://github.com/joona95) | @hailey | ||
|
||
- develop branch 에서 진행중 | ||
- 전체 구조 및 코드 리팩토링 진행 | ||
- 새로운 기능 추가 | ||
- 디자인 및 기획 변경 반영 | ||
|
||
<br> | ||
|
||
## 사용 기술 | ||
|
||
- Java | ||
- Spring Boot | ||
- Spring Security | ||
- JPA | ||
- Querydsl | ||
- MySQL | ||
- Redis | ||
- swagger 3 | ||
- AWS (EC2, RDS, Elasticache) | ||
- Github Actions | ||
|
||
|
||
<br> | ||
|
||
## 아키텍처 | ||
|
||
<img width="694" alt="스크린샷 2024-08-12 오후 9 16 10" src="https://github.com/user-attachments/assets/b510f190-5933-4ea3-9cd3-73614e1a7e1f"> | ||
|
||
## ERD | ||
|
||
<img width="1633" alt="스크린샷 2024-08-12 오후 9 33 58" src="https://github.com/user-attachments/assets/0a7a7d42-91b3-4d16-82a0-4742ed6281bb"> | ||
|
||
## API 명세서 | ||
|
||
<img width="1244" alt="스크린샷 2024-08-12 오후 11 58 37" src="https://github.com/user-attachments/assets/465fb51c-6641-48bb-8589-d54c9ad8ba28"> | ||
|
||
- 개발 서버: https://recipestorage.shop:9090/swagger-ui/index.html | ||
- 로컬: http://localhost:9090/swagger-ui/index.html | ||
|
||
## UI | ||
|
||
### 레시피 저장소 v 1.0 | ||
|
||
<img src = https://github.com/user-attachments/assets/7f3d4bad-c4fc-4b20-89d2-e22a4810ef24 height="600" width="300" /> | ||
<img src = https://github.com/user-attachments/assets/44c87870-d62a-4ecd-b223-ca5287903931 height="600" width="300" /> | ||
<img src = https://github.com/user-attachments/assets/bfa7c31b-d7e3-4adb-b632-ff823eb0e0c5 height="600" width="300" /> | ||
<img src = https://github.com/user-attachments/assets/5645b6cf-c6ee-4e80-9b48-a0a49767e158 height="600" width="300" /> | ||
<img src = https://github.com/user-attachments/assets/892b4812-9ec6-4869-9d68-7c2e85160cc2 height="600" width="300" /> | ||
<img src = https://github.com/user-attachments/assets/662c6c43-04fd-4220-a603-d33b4271f4e6 height="600" width="300" /> | ||
|
||
|
||
### 레시피 저장소 V 2.0 | ||
|
||
<img width="300" height="600" src="https://github.com/user-attachments/assets/91c53dfb-d077-4efa-9065-f79076e4845f"> | ||
<img width="300" height="600" src="https://github.com/user-attachments/assets/701c8b5a-2c41-4e0b-a2e5-87143651606c"> | ||
<img width="300" height="600" src="https://github.com/user-attachments/assets/2c8540d2-e5ce-42ff-ac49-62a0a52da8e4"> | ||
<img width="300" height="600" src="https://github.com/user-attachments/assets/824a1e80-893b-4f84-a1fb-a2eda4e1e0f8"> | ||
<img width="300" height="600" src="https://github.com/user-attachments/assets/9be9f784-7da8-403f-a7f0-3eabdc26c18e"> | ||
<img width="300" height="600" src="https://github.com/user-attachments/assets/f4017b2d-c104-4b17-98c7-87e9bef18079"> | ||
<img width="300" height="600" src="https://github.com/user-attachments/assets/6231ef79-dc4d-44b9-a568-3ae25006d50b"> | ||
<img width="300" height="600" src="https://github.com/user-attachments/assets/e160b985-d2b0-401d-9d25-bfde14d30efc"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 21 additions & 62 deletions
83
src/main/java/com/recipe/app/src/config/SwaggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,36 @@ | ||
package com.recipe.app.src.config; | ||
|
||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.annotations.info.Info; | ||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.util.StringUtils; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration; | ||
import springfox.documentation.builders.ApiInfoBuilder; | ||
import springfox.documentation.builders.PathSelectors; | ||
import springfox.documentation.builders.RequestHandlerSelectors; | ||
import springfox.documentation.builders.RequestParameterBuilder; | ||
import springfox.documentation.schema.ScalarType; | ||
import springfox.documentation.service.ApiInfo; | ||
import springfox.documentation.service.ParameterType; | ||
import springfox.documentation.service.RequestParameter; | ||
import springfox.documentation.spi.DocumentationType; | ||
import springfox.documentation.spring.web.plugins.Docket; | ||
import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.Arrays; | ||
|
||
@EnableSwagger2 | ||
@Import(BeanValidatorPluginsConfiguration.class) | ||
@OpenAPIDefinition( | ||
info = @Info(title = "레시피 저장소 API 명세서", | ||
description = "레시피 저장소 API 목록", | ||
version = "1.0") | ||
) | ||
@Configuration | ||
public class SwaggerConfig { | ||
|
||
@Bean | ||
public Docket api() { | ||
RequestParameter parameter = new RequestParameterBuilder() | ||
.name("X-ACCESS-TOKEN") | ||
.in(ParameterType.HEADER) | ||
.query(p -> p.model(m -> m.scalarModel(ScalarType.STRING))) | ||
.description("Authorization Header") | ||
.required(false) | ||
.build(); | ||
public OpenAPI openAPI() { | ||
|
||
List<RequestParameter> parameters = new ArrayList<>(); | ||
parameters.add(parameter); | ||
SecurityScheme securityScheme = new SecurityScheme() | ||
.type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT") | ||
.in(SecurityScheme.In.HEADER).name("Authorization"); | ||
|
||
return new Docket(DocumentationType.SWAGGER_2) | ||
.globalRequestParameters(parameters) | ||
.useDefaultResponseMessages(false) | ||
.consumes(getConsumeContentTypes()) | ||
.produces(getProduceContentTypes()) | ||
.select() | ||
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)) | ||
.paths(PathSelectors.any()) | ||
.build() | ||
.apiInfo(apiInfo()); | ||
} | ||
|
||
private Set<String> getConsumeContentTypes() { | ||
Set<String> consumes = new HashSet<>(); | ||
consumes.add("application/json;charset=UTF-8"); | ||
consumes.add("application/x-www-form-urlencoded"); | ||
return consumes; | ||
} | ||
SecurityRequirement securityRequirement = new SecurityRequirement().addList("bearerAuth"); | ||
|
||
private Set<String> getProduceContentTypes() { | ||
Set<String> produces = new HashSet<>(); | ||
produces.add("application/json;charset=UTF-8"); | ||
return produces; | ||
} | ||
return new OpenAPI() | ||
.components(new Components().addSecuritySchemes("bearerAuth", securityScheme)) | ||
.security(Arrays.asList(securityRequirement)); | ||
|
||
private ApiInfo apiInfo() { | ||
return new ApiInfoBuilder() | ||
.title("레시피 저장소 API 명세서") | ||
.description("레시피 저장소 API 목록") | ||
.version("1.0") | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.