Skip to content

Commit

Permalink
Merge pull request #176 from connect-foundation/develop
Browse files Browse the repository at this point in the history
5주차 릴리스
  • Loading branch information
kyungrae committed Dec 12, 2019
2 parents 26466c6 + 5aa6c20 commit 6bf0c9a
Show file tree
Hide file tree
Showing 233 changed files with 11,912 additions and 3,025 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/**
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## Snug 사용법

### Snug 주소 : 준비중
### Snug 주소 : [바로가기](http://45.119.147.186:3000/)

### 기능설명 WIKI : 준비중

Expand Down Expand Up @@ -76,10 +76,7 @@

#### 주역할
- Snug 팀을 이끄는 정신적 지주
- 프론트엔드에서 재사용 가능한 Component를 고민했습니다.
- 재사용 가능한 Component를 활용해 화면을 구성하는 방법에 대하여 고민했습니다.
- 우리 프로젝트에 알맞는 여러가지 Custom Component를 작성했습니다.
- 프론트엔드에서 효과적인 데이터 흐름 제어를 고민했습니다. (Context Api)
- 프론트엔드에서 재사용 가능한 Component를 고민했습니다.
- 팀원들을 질문으로 괴롭혔습니다.
- **커스터마이징 가능한 컴포넌트 구현**

Expand Down
3,732 changes: 2,651 additions & 1,081 deletions client/package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
"private": true,
"proxy": "http://localhost:3001",
"dependencies": {
"@types/jsonwebtoken": "^8.3.5",
"@types/node": "12.12.7",
"@types/react": "16.9.11",
"@types/react-dom": "16.9.4",
"@types/styled-components": "^4.4.0",
"axios": "^0.19.0",
"jsonwebtoken": "^8.5.1",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0",
"react-scripts": "^3.3.0",
"serialize-javascript": "^2.1.1",
"styled-components": "^4.4.1",
"typescript": "3.7.2"
},
Expand Down
37 changes: 36 additions & 1 deletion client/src/@context/http-providers/http-providers.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
import { ChannelApi } from "data/http/api/channel-api";
import { AxiosWrapper } from "data/http/api/axios-wrapper";
import { ChannelApi } from "data/http/api/channel-api";
import { PostApi } from "data/http/api/post-api";
import { SnugApi } from "data/http/api/snug-api";
import { UserApi } from "data/http/api/user-api";
import { AuthApi } from "data/http/api/auth-api";
import { InviteApi } from "data/http/api/invite-api";
import { ProfileApi } from "data/http/api/profile-api";

export class HttpProviderDependencies {
private readonly channel: ChannelApi;
private readonly post: PostApi;
private readonly snug: SnugApi;
private readonly auth: AuthApi;
private readonly user: UserApi;
private readonly invite: InviteApi;
private readonly profile: ProfileApi;
private readonly axiosWrapper: AxiosWrapper;

constructor() {
this.axiosWrapper = new AxiosWrapper();
this.channel = new ChannelApi(this.axiosWrapper);
this.post = new PostApi(this.axiosWrapper);
this.snug = new SnugApi(this.axiosWrapper);
this.auth = new AuthApi(this.axiosWrapper);
this.user = new UserApi(this.axiosWrapper);
this.invite = new InviteApi(this.axiosWrapper);
this.profile = new ProfileApi(this.axiosWrapper);
}

getChannel(): ChannelApi {
Expand All @@ -20,4 +35,24 @@ export class HttpProviderDependencies {
getPost(): PostApi {
return this.post;
}

getSnug(): SnugApi {
return this.snug;
}

getAuth(): AuthApi {
return this.auth;
}

getUser(): UserApi {
return this.user;
}

getInvite(): InviteApi {
return this.invite;
}

getProfile(): ProfileApi {
return this.profile;
}
}
35 changes: 35 additions & 0 deletions client/src/@context/repositories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@ import { StorageProviderDependencies } from "@context/storage-providers/storage-
import { HttpProviderDependencies } from "@context/http-providers/http-providers";
import { ChatRoomRepositoryDependency } from "./chat-room";
import { PostingRepositoryDependency } from "./posting";
import { SnugRepositoryDependency } from "./snug";
import { AuthRepository } from "data/repository/auth-repository";
import { UserRepositoryDependency } from "./user";
import { InviteRepositoryDependency } from "./invite";
import { ProfileRepositoryDependency } from "./profile";

export class RepositoryDependencies {
private readonly chatRoom: ChatRoomRepositoryDependency;
private readonly posting: PostingRepositoryDependency;
private readonly snug: SnugRepositoryDependency;
private readonly invite: InviteRepositoryDependency;

private readonly auth: AuthRepository;
private readonly user: UserRepositoryDependency;
private readonly profile: ProfileRepositoryDependency;

constructor(
apies: HttpProviderDependencies,
storage: StorageProviderDependencies
) {
this.chatRoom = new ChatRoomRepositoryDependency(apies.getChannel());
this.posting = new PostingRepositoryDependency(apies.getPost());
this.snug = new SnugRepositoryDependency(apies.getSnug());
this.invite = new InviteRepositoryDependency(apies.getInvite());
this.auth = new AuthRepository(apies.getAuth(), storage.getJwtLocal());
this.user = new UserRepositoryDependency(apies.getUser());
this.profile = new ProfileRepositoryDependency(apies.getProfile());
}

getChatRoom() {
Expand All @@ -22,4 +38,23 @@ export class RepositoryDependencies {
getPosting() {
return this.posting;
}

getSnug() {
return this.snug;
}
getAuth() {
return this.auth;
}

getUser() {
return this.user;
}

getInvite() {
return this.invite;
}

getProfile() {
return this.profile;
}
}
15 changes: 15 additions & 0 deletions client/src/@context/repositories/invite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {InviteRepositoryType} from "core/use-case/invite-repository-type";
import {InviteApi} from "data/http/api/invite-api";
import {InviteRepository} from "data/repository/invite-repository";

export class InviteRepositoryDependency {
private readonly inviteRepository: InviteRepositoryType;

constructor(api: InviteApi) {
this.inviteRepository = new InviteRepository(api);
}

getInviteRepository(): InviteRepositoryType {
return this.inviteRepository;
}
}
15 changes: 15 additions & 0 deletions client/src/@context/repositories/profile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ProfileApi } from "data/http/api/profile-api";
import { ProfileRepository } from "data/repository/profile-repository";
import { ProfileRepositoryType } from "core/use-case/profile-repository-type";

export class ProfileRepositoryDependency {
private readonly profileRepository: ProfileRepositoryType;

constructor(api: ProfileApi) {
this.profileRepository = new ProfileRepository(api);
}

getProfileRepository(): ProfileRepositoryType {
return this.profileRepository;
}
}
15 changes: 15 additions & 0 deletions client/src/@context/repositories/snug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { SnugApi } from "data/http/api/snug-api";
import { SnugRepository } from "data/repository/snug-repository";
import { SnugRepositoryType } from "core/use-case/snug-repository-type";

export class SnugRepositoryDependency {
private readonly postRepository: SnugRepositoryType;

constructor(api: SnugApi) {
this.postRepository = new SnugRepository(api);
}

getSnugRepository(): SnugRepositoryType {
return this.postRepository;
}
}
15 changes: 15 additions & 0 deletions client/src/@context/repositories/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { UserApi } from "data/http/api/user-api";
import { UserRepositoryType } from "core/use-case/user-repository-type";
import { UserRepository } from "data/repository/user-repository";

export class UserRepositoryDependency {
private readonly userRepository: UserRepositoryType;

constructor(api: UserApi) {
this.userRepository = new UserRepository(api);
}

getUserRepository(): UserRepositoryType {
return this.userRepository;
}
}
23 changes: 23 additions & 0 deletions client/src/@context/services/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import { RepositoryDependencies } from "@context/repositories/index";
import { ChannelService } from "core/service/channel-service";
import { PostService } from "core/service/post-service";
import { SnugService } from "core/service/snug-service";
import { AuthService } from "core/service/auth-service";
import { UserService } from "core/service/user-service";
import { InviteService } from "core/service/invite-service";
import { ProfileService } from "core/service/profile-service";

export class ServiceDependencies {
readonly channelService: ChannelService;
readonly userService: UserService;
readonly postService: PostService;
readonly snugService: SnugService;
readonly authService: AuthService;
readonly inviteService: InviteService;
readonly profileService: ProfileService;

constructor(repositories: RepositoryDependencies) {
this.channelService = new ChannelService(
Expand All @@ -13,5 +23,18 @@ export class ServiceDependencies {
this.postService = new PostService(
repositories.getPosting().getPostRepository()
);
this.snugService = new SnugService(
repositories.getSnug().getSnugRepository()
);
this.authService = new AuthService(repositories.getAuth());
this.userService = new UserService(
repositories.getUser().getUserRepository()
);
this.inviteService = new InviteService(
repositories.getInvite().getInviteRepository()
);
this.profileService = new ProfileService(
repositories.getProfile().getProfileRepository()
);
}
}
19 changes: 18 additions & 1 deletion client/src/@context/storage-providers/storage-providers.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import { BrowserStorage } from "data/browser-storage/browser-storage";
import { JsonWebToken } from "core/model/json-web-token-model";
import { JsonWebTokenMapper } from "data/browser-storage/custom-mapper/json-web-tocken-mapper";
import { StorageType } from "data/browser-storage/browser-storage-helper";

export class StorageProviderDependencies {
constructor() {}
private readonly jwtLocal: BrowserStorage<JsonWebToken>;

constructor() {
this.jwtLocal = new BrowserStorage(
"jwt",
new JsonWebTokenMapper(),
StorageType.LOCAL
);
}

getJwtLocal(): BrowserStorage<JsonWebToken> {
return this.jwtLocal;
}
}
Loading

0 comments on commit 6bf0c9a

Please sign in to comment.