├── .gitignore ├── README.md ├── in development ├── Data │ ├── back │ │ └── back │ │ │ ├── .eslintrc.js │ │ │ ├── .gitignore │ │ │ ├── .prettierrc │ │ │ ├── README.md │ │ │ ├── database.config.ts │ │ │ ├── nest-cli.json │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── src │ │ │ ├── app.controller.spec.ts │ │ │ ├── app.controller.ts │ │ │ ├── app.module.ts │ │ │ ├── app.service.ts │ │ │ ├── authenticator │ │ │ │ ├── auth.guard.ts │ │ │ │ ├── authenticator.controller.ts │ │ │ │ ├── authenticator.module.ts │ │ │ │ ├── authenticator.service.ts │ │ │ │ ├── dto │ │ │ │ │ └── factor-confirm.dto.ts │ │ │ │ ├── entities │ │ │ │ │ └── Token.entity.ts │ │ │ │ ├── fortytwo.strategy.ts │ │ │ │ ├── jwt.strategy.ts │ │ │ │ ├── jwtauth.guard.ts │ │ │ │ ├── socket.guard.ts │ │ │ │ └── thisisa.guard.ts │ │ │ ├── chat │ │ │ │ ├── chat.controller.ts │ │ │ │ ├── chat.gateway.ts │ │ │ │ ├── chat.module.ts │ │ │ │ ├── chat.service.ts │ │ │ │ ├── dto │ │ │ │ │ ├── CreateMessage.dto.ts │ │ │ │ │ ├── SwapOwner.dto.ts │ │ │ │ │ ├── createAdmin.dto.ts │ │ │ │ │ ├── createChatroom.dto.ts │ │ │ │ │ ├── createMember.dto.ts │ │ │ │ │ └── updateChatroom.dto.ts │ │ │ │ └── entities │ │ │ │ │ ├── Messages.entity.ts │ │ │ │ │ ├── chat.entity.ts │ │ │ │ │ └── membership.entity.ts │ │ │ ├── class-validator.d.ts │ │ │ ├── envirenment.ts │ │ │ ├── filters │ │ │ │ └── global-exception.filter.ts │ │ │ ├── friendship │ │ │ │ ├── dto │ │ │ │ │ └── create-friendship.dto.ts │ │ │ │ ├── entities │ │ │ │ │ └── friendship.entity.ts │ │ │ │ ├── friendship.controller.ts │ │ │ │ ├── friendship.module.ts │ │ │ │ ├── friendship.service.spec.ts │ │ │ │ ├── friendship.service.ts │ │ │ │ ├── friendship │ │ │ │ │ ├── friendship.gateway.spec.ts │ │ │ │ │ └── friendship.gateway.ts │ │ │ │ └── uservalidating │ │ │ │ │ └── uservalidating.pipe.ts │ │ │ ├── game │ │ │ │ ├── GameInstance.ts │ │ │ │ ├── PositionState.ts │ │ │ │ ├── game.gateway.spec.ts │ │ │ │ ├── game.gateway.ts │ │ │ │ ├── game.module.ts │ │ │ │ ├── game.service.spec.ts │ │ │ │ ├── game.service.ts │ │ │ │ ├── position-state.ts │ │ │ │ └── statistics │ │ │ │ │ └── entities │ │ │ │ │ └── statistics.entity.ts │ │ │ ├── main.ts │ │ │ ├── match │ │ │ │ ├── dto │ │ │ │ │ ├── create-match.dto.ts │ │ │ │ │ └── update-match.dto.ts │ │ │ │ ├── entities │ │ │ │ │ └── match.entity.ts │ │ │ │ ├── match.controller.spec.ts │ │ │ │ ├── match.controller.ts │ │ │ │ ├── match.module.ts │ │ │ │ ├── match.service.spec.ts │ │ │ │ └── match.service.ts │ │ │ └── user │ │ │ │ ├── current_status │ │ │ │ └── current_status.gateway.ts │ │ │ │ ├── dto │ │ │ │ └── create-user.dto.ts │ │ │ │ ├── entities │ │ │ │ └── user.entity.ts │ │ │ │ ├── user.controller.ts │ │ │ │ ├── user.module.ts │ │ │ │ ├── user.service.spec.ts │ │ │ │ └── user.service.ts │ │ │ ├── test │ │ │ ├── app.e2e-spec.ts │ │ │ └── jest-e2e.json │ │ │ ├── tsconfig.build.json │ │ │ ├── tsconfig.json │ │ │ └── upload │ │ │ └── avatars │ │ │ └── .gitkeep │ └── front │ │ └── front │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ └── tasks.json │ │ ├── README.md │ │ ├── angular.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ ├── app │ │ │ ├── app-body │ │ │ │ ├── app-body.component.html │ │ │ │ ├── app-body.component.scss │ │ │ │ ├── app-body.component.spec.ts │ │ │ │ └── app-body.component.ts │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── chat │ │ │ │ ├── channels │ │ │ │ │ ├── channels.component.html │ │ │ │ │ ├── channels.component.scss │ │ │ │ │ ├── channels.component.spec.ts │ │ │ │ │ └── channels.component.ts │ │ │ │ ├── chat-content │ │ │ │ │ ├── chat-content.component.html │ │ │ │ │ ├── chat-content.component.scss │ │ │ │ │ ├── chat-content.component.spec.ts │ │ │ │ │ └── chat-content.component.ts │ │ │ │ ├── chat-info │ │ │ │ │ ├── chat-info.component.html │ │ │ │ │ ├── chat-info.component.scss │ │ │ │ │ ├── chat-info.component.spec.ts │ │ │ │ │ ├── chat-info.component.ts │ │ │ │ │ └── part-chat │ │ │ │ │ │ ├── part-chat.component.html │ │ │ │ │ │ ├── part-chat.component.scss │ │ │ │ │ │ ├── part-chat.component.spec.ts │ │ │ │ │ │ └── part-chat.component.ts │ │ │ │ ├── chat.component.html │ │ │ │ ├── chat.component.scss │ │ │ │ ├── chat.component.spec.ts │ │ │ │ ├── chat.component.ts │ │ │ │ ├── chat.service.ts │ │ │ │ ├── dm-access.guard.spec.ts │ │ │ │ ├── dm-access.guard.ts │ │ │ │ ├── dms │ │ │ │ │ ├── dms.component.html │ │ │ │ │ ├── dms.component.scss │ │ │ │ │ └── dms.component.ts │ │ │ │ ├── messages-mdl │ │ │ │ │ ├── messages-mdl.component.html │ │ │ │ │ ├── messages-mdl.component.scss │ │ │ │ │ ├── messages-mdl.component.spec.ts │ │ │ │ │ └── messages-mdl.component.ts │ │ │ │ ├── messages │ │ │ │ │ ├── message.component.html │ │ │ │ │ ├── message.component.scss │ │ │ │ │ └── message.component.ts │ │ │ │ ├── no-access.guard.spec.ts │ │ │ │ ├── no-access.guard.ts │ │ │ │ └── send-msg │ │ │ │ │ ├── send-msg.component.html │ │ │ │ │ ├── send-msg.component.scss │ │ │ │ │ ├── send-msg.component.spec.ts │ │ │ │ │ └── send-msg.component.ts │ │ │ ├── config-channel │ │ │ │ ├── config-channel.component.html │ │ │ │ ├── config-channel.component.scss │ │ │ │ └── config-channel.component.ts │ │ │ ├── create-channel │ │ │ │ ├── create-channel.component.html │ │ │ │ ├── create-channel.component.scss │ │ │ │ ├── create-channel.component.spec.ts │ │ │ │ └── create-channel.component.ts │ │ │ ├── httpfail.interceptor.ts │ │ │ ├── invite │ │ │ │ ├── invite-lines │ │ │ │ │ ├── invite-lines.component.html │ │ │ │ │ ├── invite-lines.component.scss │ │ │ │ │ ├── invite-lines.component.spec.ts │ │ │ │ │ └── invite-lines.component.ts │ │ │ │ ├── invite.component.html │ │ │ │ ├── invite.component.scss │ │ │ │ ├── invite.component.spec.ts │ │ │ │ └── invite.component.ts │ │ │ ├── joining-channel │ │ │ │ ├── invited-friend │ │ │ │ │ ├── invited-friend.component.html │ │ │ │ │ ├── invited-friend.component.scss │ │ │ │ │ ├── invited-friend.component.spec.ts │ │ │ │ │ └── invited-friend.component.ts │ │ │ │ ├── joining-channel.component.html │ │ │ │ ├── joining-channel.component.scss │ │ │ │ └── joining-channel.component.ts │ │ │ ├── leaderbord │ │ │ │ ├── leader-bord-row │ │ │ │ │ ├── leader-bord-row.component.html │ │ │ │ │ ├── leader-bord-row.component.scss │ │ │ │ │ ├── leader-bord-row.component.spec.ts │ │ │ │ │ └── leader-bord-row.component.ts │ │ │ │ ├── leaderbord.component.html │ │ │ │ ├── leaderbord.component.scss │ │ │ │ ├── leaderbord.component.spec.ts │ │ │ │ └── leaderbord.component.ts │ │ │ ├── login │ │ │ │ ├── auth.service.spec.ts │ │ │ │ ├── auth.service.ts │ │ │ │ ├── guards │ │ │ │ │ ├── auth.guard.ts │ │ │ │ │ └── two-fac.guard.ts │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.scss │ │ │ │ ├── login.component.ts │ │ │ │ └── two-factory │ │ │ │ │ ├── two-factory.component.html │ │ │ │ │ ├── two-factory.component.scss │ │ │ │ │ ├── two-factory.component.spec.ts │ │ │ │ │ └── two-factory.component.ts │ │ │ ├── notification.service.ts │ │ │ ├── page-not-found │ │ │ │ ├── page-not-found.component.html │ │ │ │ ├── page-not-found.component.scss │ │ │ │ ├── page-not-found.component.spec.ts │ │ │ │ └── page-not-found.component.ts │ │ │ ├── play │ │ │ │ ├── about-games.service.ts │ │ │ │ ├── game │ │ │ │ │ ├── game.component.html │ │ │ │ │ ├── game.component.scss │ │ │ │ │ ├── game.component.spec.ts │ │ │ │ │ ├── game.component.ts │ │ │ │ │ ├── game.module.ts │ │ │ │ │ ├── game.scene.ts │ │ │ │ │ ├── game.service.spec.ts │ │ │ │ │ ├── game.service.ts │ │ │ │ │ ├── isgaming.guard.spec.ts │ │ │ │ │ ├── isgaming.guard.ts │ │ │ │ │ └── position.state.ts │ │ │ │ ├── play-withfr │ │ │ │ │ ├── play-withfr.component.html │ │ │ │ │ ├── play-withfr.component.scss │ │ │ │ │ ├── play-withfr.component.spec.ts │ │ │ │ │ └── play-withfr.component.ts │ │ │ │ ├── play.component.html │ │ │ │ ├── play.component.scss │ │ │ │ ├── play.component.spec.ts │ │ │ │ └── play.component.ts │ │ │ ├── popup-to-be-sure │ │ │ │ ├── popup-to-be-sure.component.html │ │ │ │ ├── popup-to-be-sure.component.scss │ │ │ │ └── popup-to-be-sure.component.ts │ │ │ ├── profile │ │ │ │ ├── card-blocked │ │ │ │ │ ├── card-blocked.component.html │ │ │ │ │ ├── card-blocked.component.scss │ │ │ │ │ └── card-blocked.component.ts │ │ │ │ ├── card-friends │ │ │ │ │ ├── card-friends.component.html │ │ │ │ │ ├── card-friends.component.scss │ │ │ │ │ └── card-friends.component.ts │ │ │ │ ├── card-request │ │ │ │ │ ├── card-request.component.html │ │ │ │ │ ├── card-request.component.scss │ │ │ │ │ └── card-request.component.ts │ │ │ │ ├── card-user-statistics │ │ │ │ │ ├── card-user-statistics.component.html │ │ │ │ │ ├── card-user-statistics.component.scss │ │ │ │ │ ├── card-user-statistics.component.spec.ts │ │ │ │ │ └── card-user-statistics.component.ts │ │ │ │ ├── friendship.service.ts │ │ │ │ ├── popup │ │ │ │ │ ├── popup.component.html │ │ │ │ │ ├── popup.component.scss │ │ │ │ │ ├── popup.component.spec.ts │ │ │ │ │ └── popup.component.ts │ │ │ │ ├── profile.component.html │ │ │ │ ├── profile.component.scss │ │ │ │ ├── profile.component.ts │ │ │ │ ├── profile.service.ts │ │ │ │ ├── settings │ │ │ │ │ ├── activatetwo │ │ │ │ │ │ ├── activatetwo.component.html │ │ │ │ │ │ ├── activatetwo.component.scss │ │ │ │ │ │ └── activatetwo.component.ts │ │ │ │ │ ├── settings.component.html │ │ │ │ │ ├── settings.component.scss │ │ │ │ │ ├── settings.component.spec.ts │ │ │ │ │ └── settings.component.ts │ │ │ │ └── user-history-raw │ │ │ │ │ ├── user-history-raw.component.html │ │ │ │ │ ├── user-history-raw.component.scss │ │ │ │ │ └── user-history-raw.component.ts │ │ │ └── status.service.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── 42LogoLogin.svg │ │ │ ├── AddFriend.svg │ │ │ ├── MatchsIcon.svg │ │ │ ├── MessageProfile.svg │ │ │ ├── RankIcon.svg │ │ │ ├── ScoresIcon.svg │ │ │ ├── WinsIcon.svg │ │ │ ├── asset │ │ │ │ ├── ball.png │ │ │ │ ├── blue │ │ │ │ │ └── background.png │ │ │ │ ├── green │ │ │ │ │ └── background.png │ │ │ │ ├── line.png │ │ │ │ ├── logo.svg │ │ │ │ ├── paddle.png │ │ │ │ ├── white │ │ │ │ │ ├── background.png │ │ │ │ │ ├── ball.png │ │ │ │ │ ├── line.png │ │ │ │ │ └── paddle.png │ │ │ │ └── win.png │ │ │ ├── block.svg │ │ │ ├── blueThemeSet.svg │ │ │ ├── closeImg.svg │ │ │ ├── cover.svg │ │ │ ├── firstRank.svg │ │ │ ├── greenThemeSet.svg │ │ │ ├── icons │ │ │ │ ├── 3points.svg │ │ │ │ ├── Dribbble-Light-Preview.svg │ │ │ │ ├── addfriend.svg │ │ │ │ ├── block.svg │ │ │ │ ├── camerawow.svg │ │ │ │ ├── channels.svg │ │ │ │ ├── checkfriend.svg │ │ │ │ ├── closeImg.svg │ │ │ │ ├── direct.svg │ │ │ │ ├── firstRank.svg │ │ │ │ ├── hashtag.svg │ │ │ │ ├── icon.svg │ │ │ │ ├── leaderboard.svg │ │ │ │ ├── message.svg │ │ │ │ ├── more.svg │ │ │ │ ├── moreone.svg │ │ │ │ ├── play.svg │ │ │ │ ├── rank1.svg │ │ │ │ ├── rank2.svg │ │ │ │ ├── rank3.svg │ │ │ │ ├── rank4.svg │ │ │ │ ├── rank5.svg │ │ │ │ ├── send.svg │ │ │ │ ├── viewprofile.svg │ │ │ │ └── winner.svg │ │ │ ├── img │ │ │ │ ├── pingpongimg.svg │ │ │ │ └── profile.jpeg │ │ │ ├── login.svg │ │ │ ├── profilePic.svg │ │ │ ├── secondRank.svg │ │ │ ├── star.png │ │ │ ├── theplayer.svg │ │ │ ├── thirdRank.svg │ │ │ └── whiteThemeSet.svg │ │ ├── config.ts │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.scss │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ └── tsconfig.spec.json ├── docker-compose.yml └── srcs │ ├── back │ ├── Dockerfile │ └── script.sh │ └── front │ ├── Dockerfile │ └── script.sh ├── in production ├── docker-compose.yml └── srcs │ ├── back │ ├── Dockerfile │ ├── back │ │ ├── .eslintrc.js │ │ ├── .gitignore │ │ ├── .prettierrc │ │ ├── README.md │ │ ├── database.config.ts │ │ ├── nest-cli.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ │ ├── app.controller.spec.ts │ │ │ ├── app.controller.ts │ │ │ ├── app.module.ts │ │ │ ├── app.service.ts │ │ │ ├── authenticator │ │ │ │ ├── auth.guard.ts │ │ │ │ ├── authenticator.controller.ts │ │ │ │ ├── authenticator.module.ts │ │ │ │ ├── authenticator.service.ts │ │ │ │ ├── dto │ │ │ │ │ └── factor-confirm.dto.ts │ │ │ │ ├── entities │ │ │ │ │ └── Token.entity.ts │ │ │ │ ├── fortytwo.strategy.ts │ │ │ │ ├── jwt.strategy.ts │ │ │ │ ├── jwtauth.guard.ts │ │ │ │ ├── socket.guard.ts │ │ │ │ └── thisisa.guard.ts │ │ │ ├── chat │ │ │ │ ├── chat.controller.ts │ │ │ │ ├── chat.gateway.ts │ │ │ │ ├── chat.module.ts │ │ │ │ ├── chat.service.ts │ │ │ │ ├── dto │ │ │ │ │ ├── CreateMessage.dto.ts │ │ │ │ │ ├── SwapOwner.dto.ts │ │ │ │ │ ├── createAdmin.dto.ts │ │ │ │ │ ├── createChatroom.dto.ts │ │ │ │ │ ├── createMember.dto.ts │ │ │ │ │ └── updateChatroom.dto.ts │ │ │ │ └── entities │ │ │ │ │ ├── Messages.entity.ts │ │ │ │ │ ├── chat.entity.ts │ │ │ │ │ └── membership.entity.ts │ │ │ ├── class-validator.d.ts │ │ │ ├── envirenment.ts │ │ │ ├── filters │ │ │ │ └── global-exception.filter.ts │ │ │ ├── friendship │ │ │ │ ├── dto │ │ │ │ │ └── create-friendship.dto.ts │ │ │ │ ├── entities │ │ │ │ │ └── friendship.entity.ts │ │ │ │ ├── friendship.controller.ts │ │ │ │ ├── friendship.module.ts │ │ │ │ ├── friendship.service.spec.ts │ │ │ │ ├── friendship.service.ts │ │ │ │ ├── friendship │ │ │ │ │ ├── friendship.gateway.spec.ts │ │ │ │ │ └── friendship.gateway.ts │ │ │ │ └── uservalidating │ │ │ │ │ └── uservalidating.pipe.ts │ │ │ ├── game │ │ │ │ ├── GameInstance.ts │ │ │ │ ├── PositionState.ts │ │ │ │ ├── game.gateway.spec.ts │ │ │ │ ├── game.gateway.ts │ │ │ │ ├── game.module.ts │ │ │ │ ├── game.service.spec.ts │ │ │ │ ├── game.service.ts │ │ │ │ ├── position-state.ts │ │ │ │ └── statistics │ │ │ │ │ └── entities │ │ │ │ │ └── statistics.entity.ts │ │ │ ├── main.ts │ │ │ ├── match │ │ │ │ ├── dto │ │ │ │ │ ├── create-match.dto.ts │ │ │ │ │ └── update-match.dto.ts │ │ │ │ ├── entities │ │ │ │ │ └── match.entity.ts │ │ │ │ ├── match.controller.spec.ts │ │ │ │ ├── match.controller.ts │ │ │ │ ├── match.module.ts │ │ │ │ ├── match.service.spec.ts │ │ │ │ └── match.service.ts │ │ │ └── user │ │ │ │ ├── current_status │ │ │ │ └── current_status.gateway.ts │ │ │ │ ├── dto │ │ │ │ └── create-user.dto.ts │ │ │ │ ├── entities │ │ │ │ └── user.entity.ts │ │ │ │ ├── user.controller.ts │ │ │ │ ├── user.module.ts │ │ │ │ ├── user.service.spec.ts │ │ │ │ └── user.service.ts │ │ ├── test │ │ │ ├── app.e2e-spec.ts │ │ │ └── jest-e2e.json │ │ ├── tsconfig.build.json │ │ ├── tsconfig.json │ │ └── upload │ │ │ └── avatars │ │ │ └── .gitkeep │ └── script.sh │ └── front │ ├── Dockerfile │ ├── front │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-body │ │ │ │ ├── app-body.component.html │ │ │ │ ├── app-body.component.scss │ │ │ │ ├── app-body.component.spec.ts │ │ │ │ └── app-body.component.ts │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── chat │ │ │ │ ├── channels │ │ │ │ │ ├── channels.component.html │ │ │ │ │ ├── channels.component.scss │ │ │ │ │ ├── channels.component.spec.ts │ │ │ │ │ └── channels.component.ts │ │ │ │ ├── chat-content │ │ │ │ │ ├── chat-content.component.html │ │ │ │ │ ├── chat-content.component.scss │ │ │ │ │ ├── chat-content.component.spec.ts │ │ │ │ │ └── chat-content.component.ts │ │ │ │ ├── chat-info │ │ │ │ │ ├── chat-info.component.html │ │ │ │ │ ├── chat-info.component.scss │ │ │ │ │ ├── chat-info.component.spec.ts │ │ │ │ │ ├── chat-info.component.ts │ │ │ │ │ └── part-chat │ │ │ │ │ │ ├── part-chat.component.html │ │ │ │ │ │ ├── part-chat.component.scss │ │ │ │ │ │ ├── part-chat.component.spec.ts │ │ │ │ │ │ └── part-chat.component.ts │ │ │ │ ├── chat.component.html │ │ │ │ ├── chat.component.scss │ │ │ │ ├── chat.component.spec.ts │ │ │ │ ├── chat.component.ts │ │ │ │ ├── chat.service.ts │ │ │ │ ├── dm-access.guard.spec.ts │ │ │ │ ├── dm-access.guard.ts │ │ │ │ ├── dms │ │ │ │ │ ├── dms.component.html │ │ │ │ │ ├── dms.component.scss │ │ │ │ │ └── dms.component.ts │ │ │ │ ├── messages-mdl │ │ │ │ │ ├── messages-mdl.component.html │ │ │ │ │ ├── messages-mdl.component.scss │ │ │ │ │ ├── messages-mdl.component.spec.ts │ │ │ │ │ └── messages-mdl.component.ts │ │ │ │ ├── messages │ │ │ │ │ ├── message.component.html │ │ │ │ │ ├── message.component.scss │ │ │ │ │ └── message.component.ts │ │ │ │ ├── no-access.guard.spec.ts │ │ │ │ ├── no-access.guard.ts │ │ │ │ └── send-msg │ │ │ │ │ ├── send-msg.component.html │ │ │ │ │ ├── send-msg.component.scss │ │ │ │ │ ├── send-msg.component.spec.ts │ │ │ │ │ └── send-msg.component.ts │ │ │ ├── config-channel │ │ │ │ ├── config-channel.component.html │ │ │ │ ├── config-channel.component.scss │ │ │ │ └── config-channel.component.ts │ │ │ ├── create-channel │ │ │ │ ├── create-channel.component.html │ │ │ │ ├── create-channel.component.scss │ │ │ │ ├── create-channel.component.spec.ts │ │ │ │ └── create-channel.component.ts │ │ │ ├── httpfail.interceptor.ts │ │ │ ├── invite │ │ │ │ ├── invite-lines │ │ │ │ │ ├── invite-lines.component.html │ │ │ │ │ ├── invite-lines.component.scss │ │ │ │ │ ├── invite-lines.component.spec.ts │ │ │ │ │ └── invite-lines.component.ts │ │ │ │ ├── invite.component.html │ │ │ │ ├── invite.component.scss │ │ │ │ ├── invite.component.spec.ts │ │ │ │ └── invite.component.ts │ │ │ ├── joining-channel │ │ │ │ ├── invited-friend │ │ │ │ │ ├── invited-friend.component.html │ │ │ │ │ ├── invited-friend.component.scss │ │ │ │ │ ├── invited-friend.component.spec.ts │ │ │ │ │ └── invited-friend.component.ts │ │ │ │ ├── joining-channel.component.html │ │ │ │ ├── joining-channel.component.scss │ │ │ │ └── joining-channel.component.ts │ │ │ ├── leaderbord │ │ │ │ ├── leader-bord-row │ │ │ │ │ ├── leader-bord-row.component.html │ │ │ │ │ ├── leader-bord-row.component.scss │ │ │ │ │ ├── leader-bord-row.component.spec.ts │ │ │ │ │ └── leader-bord-row.component.ts │ │ │ │ ├── leaderbord.component.html │ │ │ │ ├── leaderbord.component.scss │ │ │ │ ├── leaderbord.component.spec.ts │ │ │ │ └── leaderbord.component.ts │ │ │ ├── login │ │ │ │ ├── auth.service.spec.ts │ │ │ │ ├── auth.service.ts │ │ │ │ ├── guards │ │ │ │ │ ├── auth.guard.ts │ │ │ │ │ └── two-fac.guard.ts │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.scss │ │ │ │ ├── login.component.ts │ │ │ │ └── two-factory │ │ │ │ │ ├── two-factory.component.html │ │ │ │ │ ├── two-factory.component.scss │ │ │ │ │ ├── two-factory.component.spec.ts │ │ │ │ │ └── two-factory.component.ts │ │ │ ├── notification.service.ts │ │ │ ├── page-not-found │ │ │ │ ├── page-not-found.component.html │ │ │ │ ├── page-not-found.component.scss │ │ │ │ ├── page-not-found.component.spec.ts │ │ │ │ └── page-not-found.component.ts │ │ │ ├── play │ │ │ │ ├── about-games.service.ts │ │ │ │ ├── game │ │ │ │ │ ├── game.component.html │ │ │ │ │ ├── game.component.scss │ │ │ │ │ ├── game.component.spec.ts │ │ │ │ │ ├── game.component.ts │ │ │ │ │ ├── game.module.ts │ │ │ │ │ ├── game.scene.ts │ │ │ │ │ ├── game.service.spec.ts │ │ │ │ │ ├── game.service.ts │ │ │ │ │ ├── isgaming.guard.spec.ts │ │ │ │ │ ├── isgaming.guard.ts │ │ │ │ │ └── position.state.ts │ │ │ │ ├── play-withfr │ │ │ │ │ ├── play-withfr.component.html │ │ │ │ │ ├── play-withfr.component.scss │ │ │ │ │ ├── play-withfr.component.spec.ts │ │ │ │ │ └── play-withfr.component.ts │ │ │ │ ├── play.component.html │ │ │ │ ├── play.component.scss │ │ │ │ ├── play.component.spec.ts │ │ │ │ └── play.component.ts │ │ │ ├── popup-to-be-sure │ │ │ │ ├── popup-to-be-sure.component.html │ │ │ │ ├── popup-to-be-sure.component.scss │ │ │ │ └── popup-to-be-sure.component.ts │ │ │ ├── profile │ │ │ │ ├── card-blocked │ │ │ │ │ ├── card-blocked.component.html │ │ │ │ │ ├── card-blocked.component.scss │ │ │ │ │ └── card-blocked.component.ts │ │ │ │ ├── card-friends │ │ │ │ │ ├── card-friends.component.html │ │ │ │ │ ├── card-friends.component.scss │ │ │ │ │ └── card-friends.component.ts │ │ │ │ ├── card-request │ │ │ │ │ ├── card-request.component.html │ │ │ │ │ ├── card-request.component.scss │ │ │ │ │ └── card-request.component.ts │ │ │ │ ├── card-user-statistics │ │ │ │ │ ├── card-user-statistics.component.html │ │ │ │ │ ├── card-user-statistics.component.scss │ │ │ │ │ ├── card-user-statistics.component.spec.ts │ │ │ │ │ └── card-user-statistics.component.ts │ │ │ │ ├── friendship.service.ts │ │ │ │ ├── popup │ │ │ │ │ ├── popup.component.html │ │ │ │ │ ├── popup.component.scss │ │ │ │ │ ├── popup.component.spec.ts │ │ │ │ │ └── popup.component.ts │ │ │ │ ├── profile.component.html │ │ │ │ ├── profile.component.scss │ │ │ │ ├── profile.component.ts │ │ │ │ ├── profile.service.ts │ │ │ │ ├── settings │ │ │ │ │ ├── activatetwo │ │ │ │ │ │ ├── activatetwo.component.html │ │ │ │ │ │ ├── activatetwo.component.scss │ │ │ │ │ │ └── activatetwo.component.ts │ │ │ │ │ ├── settings.component.html │ │ │ │ │ ├── settings.component.scss │ │ │ │ │ ├── settings.component.spec.ts │ │ │ │ │ └── settings.component.ts │ │ │ │ └── user-history-raw │ │ │ │ │ ├── user-history-raw.component.html │ │ │ │ │ ├── user-history-raw.component.scss │ │ │ │ │ └── user-history-raw.component.ts │ │ │ └── status.service.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── 42LogoLogin.svg │ │ │ ├── AddFriend.svg │ │ │ ├── MatchsIcon.svg │ │ │ ├── MessageProfile.svg │ │ │ ├── RankIcon.svg │ │ │ ├── ScoresIcon.svg │ │ │ ├── WinsIcon.svg │ │ │ ├── asset │ │ │ │ ├── ball.png │ │ │ │ ├── blue │ │ │ │ │ └── background.png │ │ │ │ ├── green │ │ │ │ │ └── background.png │ │ │ │ ├── line.png │ │ │ │ ├── logo.svg │ │ │ │ ├── paddle.png │ │ │ │ ├── white │ │ │ │ │ ├── background.png │ │ │ │ │ ├── ball.png │ │ │ │ │ ├── line.png │ │ │ │ │ └── paddle.png │ │ │ │ └── win.png │ │ │ ├── block.svg │ │ │ ├── blueThemeSet.svg │ │ │ ├── closeImg.svg │ │ │ ├── cover.svg │ │ │ ├── firstRank.svg │ │ │ ├── greenThemeSet.svg │ │ │ ├── icons │ │ │ │ ├── 3points.svg │ │ │ │ ├── Dribbble-Light-Preview.svg │ │ │ │ ├── addfriend.svg │ │ │ │ ├── block.svg │ │ │ │ ├── camerawow.svg │ │ │ │ ├── channels.svg │ │ │ │ ├── checkfriend.svg │ │ │ │ ├── closeImg.svg │ │ │ │ ├── direct.svg │ │ │ │ ├── firstRank.svg │ │ │ │ ├── hashtag.svg │ │ │ │ ├── icon.svg │ │ │ │ ├── leaderboard.svg │ │ │ │ ├── message.svg │ │ │ │ ├── more.svg │ │ │ │ ├── moreone.svg │ │ │ │ ├── play.svg │ │ │ │ ├── rank1.svg │ │ │ │ ├── rank2.svg │ │ │ │ ├── rank3.svg │ │ │ │ ├── rank4.svg │ │ │ │ ├── rank5.svg │ │ │ │ ├── send.svg │ │ │ │ ├── viewprofile.svg │ │ │ │ └── winner.svg │ │ │ ├── img │ │ │ │ ├── pingpongimg.svg │ │ │ │ └── profile.jpeg │ │ │ ├── login.svg │ │ │ ├── profilePic.svg │ │ │ ├── secondRank.svg │ │ │ ├── star.png │ │ │ ├── theplayer.svg │ │ │ ├── thirdRank.svg │ │ │ └── whiteThemeSet.svg │ │ ├── config.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.scss │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json │ └── script.sh └── screenshots ├── 2FA.png ├── 404 page.png ├── Chat - Channels (1).png ├── Chat - Channels (2).png ├── Chat - Channels.png ├── Chat - DM.png ├── Game.png ├── Invite - Channels.png ├── Profile (1).png ├── Profile (2).png ├── Profile (3).png ├── Profile (4).png ├── Profile.png ├── Settings.png ├── box list profile.png ├── ft_transcendence web application.zip └── load page.png /.gitignore: -------------------------------------------------------------------------------- 1 | #env 2 | 3 | .env 4 | 5 | #DS_Store 6 | .DS_Store -------------------------------------------------------------------------------- /in development/Data/back/back/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | parserOptions: { 4 | project: 'tsconfig.json', 5 | tsconfigRootDir: __dirname, 6 | sourceType: 'module', 7 | }, 8 | plugins: ['@typescript-eslint/eslint-plugin'], 9 | extends: [ 10 | 'plugin:@typescript-eslint/recommended', 11 | 'plugin:prettier/recommended', 12 | ], 13 | root: true, 14 | env: { 15 | node: true, 16 | jest: true, 17 | }, 18 | ignorePatterns: ['.eslintrc.js'], 19 | rules: { 20 | '@typescript-eslint/interface-name-prefix': 'off', 21 | '@typescript-eslint/explicit-function-return-type': 'off', 22 | '@typescript-eslint/explicit-module-boundary-types': 'off', 23 | '@typescript-eslint/no-explicit-any': 'off', 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /in development/Data/back/back/.gitignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist 3 | /node_modules 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | pnpm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | lerna-debug.log* 13 | 14 | # OS 15 | .DS_Store 16 | 17 | # Tests 18 | /coverage 19 | /.nyc_output 20 | 21 | # IDEs and editors 22 | /.idea 23 | .project 24 | .classpath 25 | .c9/ 26 | *.launch 27 | .settings/ 28 | *.sublime-workspace 29 | 30 | # IDE - VSCode 31 | .vscode/* 32 | !.vscode/settings.json 33 | !.vscode/tasks.json 34 | !.vscode/launch.json 35 | !.vscode/extensions.json 36 | 37 | #env 38 | 39 | .env -------------------------------------------------------------------------------- /in development/Data/back/back/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } -------------------------------------------------------------------------------- /in development/Data/back/back/database.config.ts: -------------------------------------------------------------------------------- 1 | import { Token } from 'src/authenticator/entities/Token.entity'; 2 | import { Messages } from 'src/chat/entities/Messages.entity'; 3 | import { Chat } from 'src/chat/entities/chat.entity'; 4 | import { Members } from 'src/chat/entities/membership.entity'; 5 | import { Friendship } from 'src/friendship/entities/friendship.entity'; 6 | import { Statastics } from 'src/game/statistics/entities/statistics.entity'; 7 | import { Match } from 'src/match/entities/match.entity'; 8 | import { User } from 'src/user/entities/user.entity'; 9 | import { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions'; 10 | 11 | const DataConf: PostgresConnectionOptions = { 12 | type: 'postgres', 13 | host: 'database', 14 | port: 5432, 15 | username: process.env.POSTGRES_USER, 16 | password: process.env.POSTGRES_PASSWORD, 17 | database: process.env.POSTGRES_DB, 18 | entities: [User, Friendship, Token, Match, Statastics, Chat, Messages, Members], // you can integrate the Entity you're working on here 19 | synchronize: true, 20 | } 21 | export default DataConf; -------------------------------------------------------------------------------- /in development/Data/back/back/nest-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/nest-cli", 3 | "collection": "@nestjs/schematics", 4 | "sourceRoot": "src", 5 | "compilerOptions": { 6 | "deleteOutDir": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/app.controller.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { AppController } from './app.controller'; 3 | import { AppService } from './app.service'; 4 | 5 | describe('AppController', () => { 6 | let appController: AppController; 7 | 8 | beforeEach(async () => { 9 | const app: TestingModule = await Test.createTestingModule({ 10 | controllers: [AppController], 11 | providers: [AppService], 12 | }).compile(); 13 | 14 | appController = app.get(AppController); 15 | }); 16 | 17 | describe('root', () => { 18 | it('should return "Hello World!"', () => { 19 | expect(appController.getHello()).toBe('Hello World!'); 20 | }); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/app.controller.ts: -------------------------------------------------------------------------------- 1 | import { Controller, Get } from '@nestjs/common'; 2 | import { AppService } from './app.service'; 3 | 4 | @Controller() 5 | export class AppController { 6 | constructor(private readonly appService: AppService) {} 7 | 8 | @Get() 9 | getHello(): string { 10 | return this.appService.getHello(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/app.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | 3 | @Injectable() 4 | export class AppService { 5 | getHello(): string { 6 | return 'Hello World!'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/authenticator/auth.guard.ts: -------------------------------------------------------------------------------- 1 | import { ExecutionContext, Injectable, UnauthorizedException } from '@nestjs/common'; 2 | import { AuthGuard } from "@nestjs/passport"; 3 | 4 | @Injectable() 5 | export class fortytwoAuthGuard extends AuthGuard('42') { } -------------------------------------------------------------------------------- /in development/Data/back/back/src/authenticator/authenticator.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AuthenticatorService } from './authenticator.service'; 3 | import { AuthenticatorController } from './authenticator.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { User } from 'src/user/entities/user.entity'; 6 | import { JwtModule, JwtService } from '@nestjs/jwt'; 7 | import { JwtStrategy } from './jwt.strategy'; 8 | import { AuthStrategy } from './fortytwo.strategy'; 9 | import { Token } from './entities/Token.entity'; 10 | import { Statastics } from 'src/game/statistics/entities/statistics.entity'; 11 | 12 | @Module({ 13 | imports: [TypeOrmModule.forFeature([User, Token, Statastics])], 14 | controllers: [AuthenticatorController], 15 | providers: [AuthenticatorService, JwtStrategy, AuthStrategy], 16 | exports: [AuthenticatorService] 17 | }) 18 | export class AuthenticatorModule { } 19 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/authenticator/dto/factor-confirm.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsBoolean, IsEmail, IsNotEmpty, Matches } from "class-validator"; 2 | 3 | 4 | export class FactorConfirmDTO { 5 | @IsNotEmpty() 6 | @Matches(/^[0-9]*$/) 7 | token: string; 8 | } 9 | export class validateConfirmDTO { 10 | 11 | @IsNotEmpty() 12 | @Matches(/^[0-9]*$/) 13 | token: string; 14 | } 15 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/authenticator/entities/Token.entity.ts: -------------------------------------------------------------------------------- 1 | import { Exclude } from 'class-transformer'; 2 | import { User } from 'src/user/entities/user.entity'; 3 | import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm'; 4 | 5 | @Entity() 6 | export class Token { 7 | @Exclude() 8 | @PrimaryColumn() 9 | token: string; 10 | 11 | @Exclude() 12 | @Column() 13 | expiration_date: Date; 14 | 15 | @Column() 16 | loggedIn: boolean; 17 | 18 | 19 | @OneToOne(() => User) 20 | @JoinColumn() 21 | User: User; 22 | 23 | constructor(partial: Partial) { 24 | Object.assign(this, partial); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/authenticator/jwt.strategy.ts: -------------------------------------------------------------------------------- 1 | import { ExtractJwt, Strategy } from 'passport-jwt'; 2 | import { PassportStrategy } from '@nestjs/passport'; 3 | import { Injectable, ExecutionContext } from '@nestjs/common'; 4 | 5 | export type JwtPayload = { 6 | sub: number; 7 | user_name: string; 8 | }; 9 | 10 | @Injectable() 11 | export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') { 12 | constructor() { 13 | const extractJwtFromCookie = (req) => { 14 | let token = null; 15 | 16 | if (req && req.cookies) { 17 | token = req.cookies[process.env.TOKEN_NAME]; 18 | } 19 | return token || ExtractJwt.fromAuthHeaderAsBearerToken()(req); 20 | }; 21 | 22 | super({ 23 | ignoreExpiration: false, 24 | secretOrKey: process.env.ACCESS_TOKEN_SECRET, 25 | jwtFromRequest: extractJwtFromCookie, 26 | }); 27 | } 28 | 29 | async validate(payload: JwtPayload) { 30 | return { 31 | id: payload.sub, 32 | user_name: payload.user_name, 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/authenticator/socket.guard.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ExecutionContext, 3 | Injectable, 4 | UnauthorizedException, 5 | } from '@nestjs/common'; 6 | import { AuthGuard } from '@nestjs/passport'; 7 | import { JwtService } from '@nestjs/jwt'; 8 | import { AuthenticatorService } from './authenticator.service'; 9 | 10 | @Injectable() 11 | export class SocketAuthGuard extends AuthGuard('jwt') { 12 | constructor( 13 | private readonly serviceJWt: JwtService, 14 | private readonly serviceToken: AuthenticatorService, 15 | ) { 16 | super(); 17 | } 18 | async canActivate(context: ExecutionContext) { 19 | const client = context.switchToWs().getClient(); 20 | if (!client.handshake.headers.authorization) return false; 21 | const xyz: any = this.serviceJWt.decode( 22 | client.handshake.headers.authorization, 23 | ); 24 | if (!xyz) 25 | return this.serviceToken.IsSame( 26 | xyz.sub || -1, 27 | client.handshake.headers.authorization, 28 | ); 29 | return false; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/dto/CreateMessage.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty, MinLength, MaxLength } from 'class-validator'; 2 | 3 | export class CreateMessage { 4 | 5 | @IsNotEmpty() 6 | @MinLength(1, { 7 | message: "Message can't be empty", 8 | }) 9 | @MaxLength(500, { 10 | message: 'Message too long', 11 | }) 12 | value!: string; 13 | 14 | @IsNotEmpty() 15 | charRoomId!: number; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/dto/SwapOwner.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty } from 'class-validator'; 2 | 3 | export class SwapOwnerDTO { 4 | @IsNotEmpty() 5 | roleGiver!: number; 6 | @IsNotEmpty() 7 | roleReciver!: number; 8 | } 9 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/dto/createAdmin.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty } from 'class-validator'; 2 | 3 | export class createAdminDTO { 4 | @IsNotEmpty() 5 | roleGiver!: number; 6 | 7 | @IsNotEmpty() 8 | roleReceiver!: number; 9 | } 10 | 11 | export class invitesDTO { 12 | @IsNotEmpty() 13 | chatID: number; 14 | 15 | @IsNotEmpty() 16 | UserId: number; 17 | } 18 | export class CreateBanDTO { 19 | @IsNotEmpty() 20 | chatID: number; 21 | 22 | @IsNotEmpty() 23 | UserId: number; 24 | } 25 | export class SeenDTO { 26 | @IsNotEmpty() 27 | isRoom: boolean; 28 | 29 | @IsNotEmpty() 30 | chatID: number; 31 | } -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/dto/createChatroom.dto.ts: -------------------------------------------------------------------------------- 1 | import { MaxLength, IsNotEmpty } from 'class-validator'; 2 | 3 | export class createChatroomDTO { 4 | @IsNotEmpty() 5 | type!: string; 6 | 7 | @IsNotEmpty() 8 | @MaxLength(26, { 9 | message: 'chat name too long', 10 | }) 11 | chatroomName!: string; 12 | 13 | password!: string; 14 | } 15 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/dto/createMember.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty } from 'class-validator'; 2 | 3 | export class createMemberDTO { 4 | @IsNotEmpty() 5 | member!: number; 6 | 7 | password?: string; 8 | } 9 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/dto/updateChatroom.dto.ts: -------------------------------------------------------------------------------- 1 | export class UpdateChatroomDTO { 2 | newType?: string; 3 | newPassword?: string; 4 | newChatroomName?: string; 5 | } 6 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/entities/Messages.entity.ts: -------------------------------------------------------------------------------- 1 | import { User } from "src/user/entities/user.entity"; 2 | import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; 3 | import { Chat } from "./chat.entity"; 4 | 5 | @Entity('messages') 6 | export class Messages { 7 | 8 | @PrimaryGeneratedColumn() 9 | id: number; 10 | 11 | @Column() 12 | content: string; 13 | 14 | @Column() 15 | time: Date; 16 | 17 | @ManyToOne(() => User, (user) => user.id) 18 | @JoinColumn({ name: 'sender_id' }) 19 | sender: number; 20 | 21 | @ManyToOne(() => Chat, (chat) => chat.id) 22 | @JoinColumn({ name: 'part_of_chat_id' }) 23 | chat_id: number; 24 | } 25 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/entities/chat.entity.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm"; 2 | import { Messages } from "./Messages.entity"; 3 | 4 | @Entity('Chat') 5 | export class Chat { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ nullable: true, unique: true }) 11 | name: string; 12 | 13 | @Column({ type: 'enum', enum: ['direct', 'public', 'private', 'protected'] }) 14 | type: string; 15 | 16 | @Column() 17 | password: string; 18 | 19 | @OneToMany(() => Messages, (messages) => messages.chat_id) 20 | messages: Messages; 21 | } 22 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/chat/entities/membership.entity.ts: -------------------------------------------------------------------------------- 1 | import { User } from "src/user/entities/user.entity"; 2 | import { Column, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; 3 | import { Chat } from "./chat.entity"; 4 | 5 | @Entity('Members') 6 | export class Members { 7 | @PrimaryColumn() 8 | Userid: number; 9 | 10 | @PrimaryColumn() 11 | chatID: number; 12 | 13 | @Column() 14 | state: number; // active 1 - blocked 0 - invited 2 - muted 3 15 | 16 | @Column({ type: 'enum', enum: ["none", "admin", "owner"] }) 17 | role: string; 18 | 19 | @Column({ nullable: true }) 20 | mute: Date; // should be the date and time when mute ends 21 | 22 | @Column({ nullable: true }) 23 | notSeen: number; 24 | 25 | @ManyToOne(() => User) 26 | @JoinColumn({ name: 'Userid' }) 27 | user: User; 28 | 29 | @ManyToOne(() => Chat) 30 | @JoinColumn({ name: 'chatID' }) 31 | chat: Chat; 32 | 33 | @DeleteDateColumn({ name: 'deleted_at' }) 34 | deleted_at: Date; 35 | } -------------------------------------------------------------------------------- /in development/Data/back/back/src/class-validator.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'class-validator'; 2 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/envirenment.ts: -------------------------------------------------------------------------------- 1 | const hostSocket = process.env.HOST + ":4200"; 2 | export default hostSocket; -------------------------------------------------------------------------------- /in development/Data/back/back/src/filters/global-exception.filter.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ExceptionFilter, 3 | Catch, 4 | ArgumentsHost, 5 | HttpException, 6 | HttpStatus, 7 | } from '@nestjs/common'; 8 | import { Request, Response } from 'express'; 9 | 10 | @Catch() 11 | export class GlobalExceptionFilter implements ExceptionFilter { 12 | catch(exception: unknown, host: ArgumentsHost) { 13 | const ctx = host.switchToHttp(); 14 | const response = ctx.getResponse(); 15 | const request = ctx.getRequest(); 16 | const status = 17 | exception instanceof HttpException 18 | ? exception.getStatus() 19 | : HttpStatus.INTERNAL_SERVER_ERROR; 20 | const message = 21 | exception instanceof HttpException 22 | ? exception.getResponse() 23 | : HttpStatus.INTERNAL_SERVER_ERROR; 24 | response.status(200).json({ 25 | statusCode: status, 26 | message: message, 27 | timestamp: new Date().toISOString(), 28 | path: request.url, 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/friendship/friendship.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { FriendshipService } from './friendship.service'; 3 | import { FriendshipController } from './friendship.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { Friendship } from './entities/friendship.entity'; 6 | import { User } from 'src/user/entities/user.entity'; 7 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 8 | // import { UservalidatingPipe } from './uservalidating/uservalidating.pipe'; 9 | import { FriendshipGateway } from './friendship/friendship.gateway'; 10 | 11 | @Module({ 12 | imports: [TypeOrmModule.forFeature([Friendship, User]), AuthenticatorModule], 13 | controllers: [FriendshipController], 14 | providers: [FriendshipService, FriendshipGateway] 15 | }) 16 | export class FriendshipModule {} 17 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/friendship/friendship.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { FriendshipService } from './friendship.service'; 3 | 4 | describe('FriendshipService', () => { 5 | let service: FriendshipService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [FriendshipService], 10 | }).compile(); 11 | 12 | service = module.get(FriendshipService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/friendship/friendship/friendship.gateway.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { FriendshipGateway } from './friendship.gateway'; 3 | 4 | describe('FriendshipGateway', () => { 5 | let gateway: FriendshipGateway; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [FriendshipGateway], 10 | }).compile(); 11 | 12 | gateway = module.get(FriendshipGateway); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(gateway).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/friendship/uservalidating/uservalidating.pipe.ts: -------------------------------------------------------------------------------- 1 | import { ArgumentMetadata, BadRequestException, Injectable, PipeTransform } from '@nestjs/common'; 2 | import { plainToClass } from 'class-transformer'; 3 | import { validate } from 'class-validator'; 4 | 5 | @Injectable() 6 | export class UservalidatingPipe implements PipeTransform { 7 | async transform(value: any, {metatype}: ArgumentMetadata) { 8 | if (!metatype || !this.validateMetaType(metatype)){ 9 | return value; 10 | } 11 | 12 | const object = plainToClass(metatype, value); 13 | const errors = await validate(object); 14 | 15 | if(errors.length > 0) { 16 | throw new BadRequestException('Invalid Input Data') 17 | } 18 | 19 | return value; 20 | 21 | } 22 | 23 | private validateMetaType(metatype: Function): boolean { 24 | const types: Function[] = [String, Boolean, Number, Array, Object]; 25 | return !types.includes(metatype) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/game/PositionState.ts: -------------------------------------------------------------------------------- 1 | // automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | export { PositionState } from './position-state.js'; 4 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/game/game.gateway.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { GameGateway } from './game.gateway'; 3 | import { GameService } from './game.service'; 4 | 5 | describe('GameGateway', () => { 6 | let gateway: GameGateway; 7 | 8 | beforeEach(async () => { 9 | const module: TestingModule = await Test.createTestingModule({ 10 | providers: [GameGateway, GameService], 11 | }).compile(); 12 | 13 | gateway = module.get(GameGateway); 14 | }); 15 | 16 | it('should be defined', () => { 17 | expect(gateway).toBeDefined(); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/game/game.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { GameService } from './game.service'; 3 | import { GameGateway } from './game.gateway'; 4 | import { MatchModule } from 'src/match/match.module'; 5 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 6 | import { User } from 'src/user/entities/user.entity'; 7 | import { TypeOrmModule } from '@nestjs/typeorm'; 8 | import { Statastics } from './statistics/entities/statistics.entity'; 9 | 10 | @Module({ 11 | imports: [MatchModule, AuthenticatorModule, TypeOrmModule.forFeature([User, Statastics])], 12 | providers: [GameGateway, GameService] 13 | }) 14 | export class GameModule { } 15 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/game/game.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { GameService } from './game.service'; 3 | 4 | describe('GameService', () => { 5 | let service: GameService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [GameService], 10 | }).compile(); 11 | 12 | service = module.get(GameService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/game/statistics/entities/statistics.entity.ts: -------------------------------------------------------------------------------- 1 | 2 | import { User } from "src/user/entities/user.entity"; 3 | import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from "typeorm"; 4 | 5 | @Entity() 6 | export class Statastics { 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | total: number; 12 | 13 | @Column() 14 | score: number; 15 | 16 | @Column() 17 | win: number; 18 | 19 | @OneToOne(() => User) 20 | @JoinColumn() 21 | User: User; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/main.ts: -------------------------------------------------------------------------------- 1 | import { NestFactory } from '@nestjs/core'; 2 | import { AppModule } from './app.module'; 3 | import * as cookieParser from 'cookie-parser'; 4 | import * as express from 'express'; 5 | import { ValidationPipe } from '@nestjs/common'; 6 | import { GlobalExceptionFilter } from './filters/global-exception.filter'; 7 | import { join } from 'path'; 8 | async function bootstrap() { 9 | const app = await NestFactory.create(AppModule); 10 | app.use('/avatar', express.static(join(__dirname, '../../upload/avatars'))); 11 | app.enableCors({ 12 | credentials: true, 13 | origin: process.env.HOST + ':4200', 14 | }); 15 | app.use(cookieParser()); 16 | app.useGlobalPipes(new ValidationPipe({ transform: true })); 17 | app.useGlobalFilters(new GlobalExceptionFilter()); 18 | await app.listen(3000); 19 | } 20 | bootstrap(); 21 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/match/dto/create-match.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNumber } from "class-validator"; 2 | 3 | export class CreateMatchDto { 4 | @IsNumber() 5 | player1Id: number; 6 | 7 | @IsNumber() 8 | player2Id: number; 9 | 10 | @IsNumber() 11 | winnerId: number; 12 | } 13 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/match/dto/update-match.dto.ts: -------------------------------------------------------------------------------- 1 | import { PartialType } from '@nestjs/mapped-types'; 2 | import { CreateMatchDto } from './create-match.dto'; 3 | 4 | export class UpdateMatchDto extends PartialType(CreateMatchDto) {} 5 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/match/entities/match.entity.ts: -------------------------------------------------------------------------------- 1 | 2 | import { User } from "src/user/entities/user.entity"; 3 | import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; 4 | 5 | @Entity() 6 | export class Match { 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @ManyToOne(() => User, user => user.matchesAsPlayer1) 11 | player1: User; 12 | 13 | @ManyToOne(() => User, user => user.matchesAsPlayer2) 14 | player2: User; 15 | 16 | @ManyToOne(() => User, user => user.wonMatches) 17 | winner: User; 18 | 19 | @Column() 20 | date: Date; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/match/match.controller.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { MatchController } from './match.controller'; 3 | import { MatchService } from './match.service'; 4 | 5 | describe('MatchController', () => { 6 | let controller: MatchController; 7 | 8 | beforeEach(async () => { 9 | const module: TestingModule = await Test.createTestingModule({ 10 | controllers: [MatchController], 11 | providers: [MatchService], 12 | }).compile(); 13 | 14 | controller = module.get(MatchController); 15 | }); 16 | 17 | it('should be defined', () => { 18 | expect(controller).toBeDefined(); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/match/match.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { MatchService } from './match.service'; 3 | import { MatchController } from './match.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { Match } from './entities/match.entity'; 6 | import { UserModule } from 'src/user/user.module'; 7 | // import { User } from 'src/user/entities/user.entity'; 8 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 9 | import { Statastics } from 'src/game/statistics/entities/statistics.entity'; 10 | import { User } from 'src/user/entities/user.entity'; 11 | 12 | @Module({ 13 | imports: [UserModule, TypeOrmModule.forFeature([User, Match, Statastics]), AuthenticatorModule], 14 | controllers: [MatchController], 15 | providers: [MatchService], 16 | exports: [MatchService], 17 | }) 18 | export class MatchModule { } 19 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/match/match.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { MatchService } from './match.service'; 3 | 4 | describe('MatchService', () => { 5 | let service: MatchService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [MatchService], 10 | }).compile(); 11 | 12 | service = module.get(MatchService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/user/dto/create-user.dto.ts: -------------------------------------------------------------------------------- 1 | import { MinLength } from 'class-validator'; 2 | import { MaxLength } from 'class-validator'; 3 | import { IsBoolean, IsEmail, IsNotEmpty, IsNumber, Matches } from 'class-validator'; 4 | 5 | export class CreateUserDto { 6 | @IsNotEmpty() 7 | @Matches(/^[a-z]+(-[a-z]+)?$/) 8 | @MinLength(2) 9 | @MaxLength(10) 10 | username: string; 11 | 12 | @MinLength(2) 13 | @MaxLength(20) 14 | @IsNotEmpty() 15 | name: string; 16 | 17 | @IsNotEmpty() 18 | avatar: string; 19 | 20 | @IsNotEmpty() 21 | @IsEmail() 22 | email: string; 23 | 24 | @IsNotEmpty() 25 | @IsBoolean() 26 | TwoFAenabled: boolean; 27 | } 28 | 29 | export class UpdateUserDto { 30 | @IsNotEmpty() 31 | @Matches(/^[a-z]+(-[a-z]+)?$/) 32 | @MinLength(2) 33 | @MaxLength(10) 34 | username: string; 35 | 36 | @MinLength(2) 37 | @MaxLength(20) 38 | @IsNotEmpty() 39 | name: string; 40 | 41 | @IsNotEmpty() 42 | avatar: string; 43 | 44 | @IsNotEmpty() 45 | twofactor: boolean; 46 | 47 | @IsNumber() 48 | theme: number; 49 | } 50 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/user/user.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { UserService } from './user.service'; 3 | import { UserController } from './user.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { User } from './entities/user.entity'; 6 | import { Token } from 'src/authenticator/entities/Token.entity'; 7 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 8 | import { CurrentStatusGateway } from './current_status/current_status.gateway'; 9 | // import { Match } from 'src/match/entities/match.entity'; 10 | 11 | @Module({ 12 | imports: [TypeOrmModule.forFeature([User, Token]), AuthenticatorModule], 13 | controllers: [UserController], 14 | providers: [UserService, CurrentStatusGateway], 15 | exports: [UserService] 16 | }) 17 | export class UserModule {} 18 | -------------------------------------------------------------------------------- /in development/Data/back/back/src/user/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { UserService } from './user.service'; 3 | 4 | describe('UserService', () => { 5 | let service: UserService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [UserService], 10 | }).compile(); 11 | 12 | service = module.get(UserService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in development/Data/back/back/test/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { INestApplication } from '@nestjs/common'; 3 | import * as request from 'supertest'; 4 | import { AppModule } from './../src/app.module'; 5 | 6 | describe('AppController (e2e)', () => { 7 | let app: INestApplication; 8 | 9 | beforeEach(async () => { 10 | const moduleFixture: TestingModule = await Test.createTestingModule({ 11 | imports: [AppModule], 12 | }).compile(); 13 | 14 | app = moduleFixture.createNestApplication(); 15 | await app.init(); 16 | }); 17 | 18 | it('/ (GET)', () => { 19 | return request(app.getHttpServer()) 20 | .get('/') 21 | .expect(200) 22 | .expect('Hello World!'); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /in development/Data/back/back/test/jest-e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleFileExtensions": ["js", "json", "ts"], 3 | "rootDir": ".", 4 | "testEnvironment": "node", 5 | "testRegex": ".e2e-spec.ts$", 6 | "transform": { 7 | "^.+\\.(t|j)s$": "ts-jest" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /in development/Data/back/back/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /in development/Data/back/back/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /in development/Data/back/back/upload/avatars/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/back/back/upload/avatars/.gitkeep -------------------------------------------------------------------------------- /in development/Data/front/front/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /in development/Data/front/front/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /in development/Data/front/front/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /in development/Data/front/front/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://10.12.8.1:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://10.12.8.1:9876/debug.html" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/app-body/app-body.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AppBodyComponent } from './app-body.component'; 4 | 5 | describe('AppBodyComponent', () => { 6 | let component: AppBodyComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [AppBodyComponent] 12 | }); 13 | fixture = TestBed.createComponent(AppBodyComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/app/app.component.scss -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Component } from '@angular/core'; 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/channels/channels.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

{{channel?.chat?.name}}

4 |
{{channel.notSeen}}
5 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/channels/channels.component.scss: -------------------------------------------------------------------------------- 1 | .channel { 2 | transition: 0.3s; 3 | display: grid; 4 | grid-template-columns: min-content auto min-content; 5 | gap: 6px; 6 | align-items: center; 7 | font-size: 15px; 8 | padding: 7px; 9 | cursor: pointer; 10 | } 11 | 12 | .channel:hover { 13 | background-color: #184E77; 14 | border-radius: 10px; 15 | } 16 | 17 | .hashtag { 18 | position: relative; 19 | width: 33px; 20 | } 21 | 22 | .nb-messages { 23 | height: 16px; 24 | width: 16px; 25 | font-size: 11px; 26 | background-color: #FF5E5E; 27 | display: flex; 28 | border-radius: 50%; 29 | justify-content: center; 30 | align-items: center; 31 | padding: 2px; 32 | } 33 | 34 | @media only screen and (max-width: 600px) { 35 | .nb-messages { 36 | display: none; 37 | } 38 | } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/channels/channels.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChannelsComponent } from './channels.component'; 4 | 5 | describe('ChannelsComponent', () => { 6 | let component: ChannelsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChannelsComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChannelsComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/channels/channels.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { ChatService } from '../chat.service'; 4 | 5 | @Component({ 6 | selector: 'app-channels', 7 | templateUrl: './channels.component.html', 8 | styleUrls: ['./channels.component.scss'] 9 | }) 10 | export class ChannelsComponent { 11 | @Input() channel: any; 12 | constructor(private readonly switchRoute: Router, private readonly chatService: ChatService) { 13 | } 14 | openChat(id: number) { 15 | this.chatService.GoForSeen(id, true); 16 | this.switchRoute.navigateByUrl("/chat/" + id) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/chat-content/chat-content.component.html: -------------------------------------------------------------------------------- 1 |
2 | 4 | 5 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/chat-content/chat-content.component.scss: -------------------------------------------------------------------------------- 1 | .griding { 2 | display: grid; 3 | grid-template-columns: 70% 30%; 4 | height: 100%; 5 | } 6 | 7 | @media only screen and (max-width: 900px) { 8 | .grid3 { 9 | display: none; 10 | } 11 | 12 | .griding { 13 | display: grid; 14 | grid-template-columns: 100%; 15 | height: 100%; 16 | } 17 | } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/chat-content/chat-content.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChatContentComponent } from './chat-content.component'; 4 | 5 | describe('ChatContentComponent', () => { 6 | let component: ChatContentComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChatContentComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChatContentComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/chat-info/chat-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChatInfoComponent } from './chat-info.component'; 4 | 5 | describe('ChatInfoComponent', () => { 6 | let component: ChatInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChatInfoComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChatInfoComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/chat-info/part-chat/part-chat.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PartChatComponent } from './part-chat.component'; 4 | 5 | describe('PartChatComponent', () => { 6 | let component: PartChatComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PartChatComponent] 12 | }); 13 | fixture = TestBed.createComponent(PartChatComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/chat.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChatComponent } from './chat.component'; 4 | 5 | describe('ChatComponent', () => { 6 | let component: ChatComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChatComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChatComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/dm-access.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { CanActivateFn } from '@angular/router'; 3 | 4 | import { dMACCESSGuard } from './dm-access.guard'; 5 | 6 | describe('dMACCESSGuard', () => { 7 | const executeGuard: CanActivateFn = (...guardParameters) => 8 | TestBed.runInInjectionContext(() => dMACCESSGuard(...guardParameters)); 9 | 10 | beforeEach(() => { 11 | TestBed.configureTestingModule({}); 12 | }); 13 | 14 | it('should be created', () => { 15 | expect(executeGuard).toBeTruthy(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/dm-access.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { ChatService } from './chat.service'; 3 | import { inject } from '@angular/core'; 4 | import { firstValueFrom, lastValueFrom } from 'rxjs'; 5 | 6 | export const dMACCESSGuard: CanActivateFn = async (route, state) => { 7 | const chatService: ChatService = inject(ChatService); 8 | const switchRoute: Router = inject(Router); 9 | 10 | const access = await lastValueFrom(chatService.hasAccessToDM(route.params['username']), { defaultValue: false }); 11 | if (!access) { 12 | switchRoute.navigateByUrl('/chat'); 13 | return false; 14 | } 15 | return true; 16 | }; 17 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/dms/dms.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{statusLoading(user.id)}} 3 |
4 | 5 |
7 |
8 |
9 |

{{user.name}}

10 |
{{count}}
11 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/messages-mdl/messages-mdl.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MessagesMdlComponent } from './messages-mdl.component'; 4 | 5 | describe('MessagesMdlComponent', () => { 6 | let component: MessagesMdlComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [MessagesMdlComponent] 12 | }); 13 | fixture = TestBed.createComponent(MessagesMdlComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/messages/message.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

{{myId() != value?.sender?.id ? value?.sender?.name : 'You'}}

6 |

{{ (today|date:'longDate') == (value?.time|date:'longDate') ? (value?.time|date:'shortTime') 7 | : (value?.time|date:'longDate') + ', ' +(value?.time|date:'shortTime')}}

8 |
9 |
{{value?.content}}
10 |
11 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/messages/message.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { AuthService } from 'src/app/login/auth.service'; 4 | import { ProfileService } from 'src/app/profile/profile.service'; 5 | 6 | @Component({ 7 | selector: 'app-message', 8 | templateUrl: './message.component.html', 9 | styleUrls: ['./message.component.scss'] 10 | }) 11 | export class MessageComponent { 12 | @Input() value !: any; 13 | today: number = Date.now(); 14 | whoIs$ !: Observable; 15 | constructor(private readonly serviceProfile: ProfileService, private readonly serviceAuth: AuthService) { 16 | } 17 | 18 | imageLink(url: string) { 19 | return this.serviceProfile.getUserAvatarPath(url); 20 | } 21 | myId() { 22 | return this.serviceAuth.getId(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/no-access.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { CanActivateFn } from '@angular/router'; 3 | 4 | import { noACCESSGuard } from './no-access.guard'; 5 | 6 | describe('noACCESSGuard', () => { 7 | const executeGuard: CanActivateFn = (...guardParameters) => 8 | TestBed.runInInjectionContext(() => noACCESSGuard(...guardParameters)); 9 | 10 | beforeEach(() => { 11 | TestBed.configureTestingModule({}); 12 | }); 13 | 14 | it('should be created', () => { 15 | expect(executeGuard).toBeTruthy(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/no-access.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { ChatService } from './chat.service'; 3 | import { inject } from '@angular/core'; 4 | import { lastValueFrom } from 'rxjs'; 5 | 6 | export const noACCESSGuard: CanActivateFn = async (route, state) => { 7 | 8 | const chatService: ChatService = inject(ChatService); 9 | const switchRoute: Router = inject(Router); 10 | 11 | try { 12 | const access = await lastValueFrom(chatService.hasAccessToChannel(route.params['id']), { defaultValue: false }); 13 | if (!access) { 14 | switchRoute.navigateByUrl('/chat'); 15 | return false; 16 | } 17 | } 18 | catch (err) { 19 | return false; 20 | } 21 | return true; 22 | }; 23 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/send-msg/send-msg.component.html: -------------------------------------------------------------------------------- 1 |
2 | 4 | 5 |

Send

6 | 7 |
8 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/send-msg/send-msg.component.scss: -------------------------------------------------------------------------------- 1 | .sendMessage { 2 | display: flex; 3 | gap: 5px; 4 | padding: 25px; 5 | } 6 | 7 | .textbox { 8 | color: #D8D8D8; 9 | height: 32px; 10 | background: #184E77; 11 | box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25); 12 | border-radius: 8px; 13 | border: none; 14 | outline: none; 15 | padding-left: 10px; 16 | } 17 | 18 | .textbox::placeholder { 19 | color: #7FABCC; 20 | } 21 | 22 | .message { 23 | width: 100%; 24 | height: 38px; 25 | } 26 | 27 | .buttonSend { 28 | display: flex; 29 | gap: 3px; 30 | align-items: center; 31 | font-size: 11px; 32 | font-weight: 600; 33 | color: #103959; 34 | cursor: pointer; 35 | border-radius: 8px; 36 | background: #99D98C; 37 | padding-left: 20px; 38 | padding-right: 20px; 39 | box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.25); 40 | transition: 0.3; 41 | } 42 | 43 | .buttonSend:hover { 44 | opacity: 70%; 45 | } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/chat/send-msg/send-msg.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SendMsgComponent } from './send-msg.component'; 4 | 5 | describe('SendMsgComponent', () => { 6 | let component: SendMsgComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [SendMsgComponent] 12 | }); 13 | fixture = TestBed.createComponent(SendMsgComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/create-channel/create-channel.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CreateChannelComponent } from './create-channel.component'; 4 | 5 | describe('CreateChannelComponent', () => { 6 | let component: CreateChannelComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [CreateChannelComponent] 12 | }); 13 | fixture = TestBed.createComponent(CreateChannelComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/httpfail.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { 3 | HttpRequest, 4 | HttpHandler, 5 | HttpEvent, 6 | HttpInterceptor 7 | } from '@angular/common/http'; 8 | import { EMPTY, Observable, catchError, isEmpty, of, retry } from 'rxjs'; 9 | 10 | @Injectable() 11 | export class HttpfailInterceptor implements HttpInterceptor { 12 | 13 | constructor() {} 14 | 15 | intercept(request: HttpRequest, next: HttpHandler): Observable { 16 | return next.handle(request).pipe(retry(1), catchError((err) => {return of({statusCode: 403})}) ) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/invite/invite-lines/invite-lines.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

{{user.name}}

4 | Invite 6 | Invited 8 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/invite/invite-lines/invite-lines.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InviteLinesComponent } from './invite-lines.component'; 4 | 5 | describe('InviteLinesComponent', () => { 6 | let component: InviteLinesComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [InviteLinesComponent] 12 | }); 13 | fixture = TestBed.createComponent(InviteLinesComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/invite/invite.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |

{{'Invite friends to #' + (channelInfos$|async)?.name}}

6 |
7 |
You 9 | have No friends to 10 | invite
11 | 12 |
13 | 14 |
15 |
16 |
17 | 18 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/invite/invite.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InviteComponent } from './invite.component'; 4 | 5 | describe('InviteComponent', () => { 6 | let component: InviteComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [InviteComponent] 12 | }); 13 | fixture = TestBed.createComponent(InviteComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/joining-channel/invited-friend/invited-friend.component.html: -------------------------------------------------------------------------------- 1 |
3 |
4 |

{{'#' + invite.chat.name}}

5 |

{{' ' + invite.chat.type + ' channel'}}

6 |
7 | Accept 8 | 9 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/joining-channel/invited-friend/invited-friend.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InvitedFriendComponent } from './invited-friend.component'; 4 | 5 | describe('InvitedFriendComponent', () => { 6 | let component: InvitedFriendComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [InvitedFriendComponent] 12 | }); 13 | fixture = TestBed.createComponent(InvitedFriendComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/leaderbord/leader-bord-row/leader-bord-row.component.html: -------------------------------------------------------------------------------- 1 | 2 |
1
3 |
2
4 |
3
5 | 6 |
{{index}}
7 |
8 | user 11 |

{{data.user.username}}

12 |
13 |
{{data.matchPlayed}}
14 |
{{data.win}}
15 |
{{data.ratio}}
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/leaderbord/leader-bord-row/leader-bord-row.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LeaderBordRowComponent } from './leader-bord-row.component'; 4 | 5 | describe('LeaderBordRowComponent', () => { 6 | let component: LeaderBordRowComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LeaderBordRowComponent] 12 | }); 13 | fixture = TestBed.createComponent(LeaderBordRowComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/leaderbord/leader-bord-row/leader-bord-row.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ProfileService } from 'src/app/profile/profile.service'; 3 | 4 | @Component({ 5 | selector: 'app-leader-bord-row', 6 | templateUrl: './leader-bord-row.component.html', 7 | styleUrls: ['./leader-bord-row.component.scss'] 8 | }) 9 | export class LeaderBordRowComponent { 10 | @Input() data: any; 11 | @Input() index !: number; 12 | 13 | constructor(private profile: ProfileService) { 14 | } 15 | 16 | avataring(url: string) { 17 | return this.profile.getUserAvatarPath(url) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/leaderbord/leaderbord.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Leaderboard

3 |
4 |
Rank
5 |
Players
6 |
Matches played
7 |
Wins
8 |
Score
9 |
10 | 13 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/leaderbord/leaderbord.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LeaderbordComponent } from './leaderbord.component'; 4 | 5 | describe('LeaderbordComponent', () => { 6 | let component: LeaderbordComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LeaderbordComponent] 12 | }); 13 | fixture = TestBed.createComponent(LeaderbordComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/login/auth.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthService } from './auth.service'; 4 | 5 | describe('AuthService', () => { 6 | let service: AuthService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(AuthService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/login/guards/two-fac.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { AuthService } from '../auth.service'; 3 | import { inject } from '@angular/core'; 4 | import { firstValueFrom } from 'rxjs'; 5 | 6 | export const twoFacGuard: CanActivateFn = async (route, state) => { 7 | 8 | const authService: AuthService = inject(AuthService); 9 | const switchRoute: Router = inject(Router); 10 | let replay: any = {}; 11 | try { 12 | replay = await firstValueFrom(authService.getCurrentUser(), { defaultValue: { statusCode: 403 } }); 13 | } 14 | catch (err) { 15 | replay = { statusCode: 403 } 16 | } 17 | if (replay?.statusCode && replay.statusCode == 403) { 18 | switchRoute.navigateByUrl('login'); 19 | return false; 20 | } 21 | if (!replay.steps) { 22 | switchRoute.navigateByUrl(''); 23 | return true; 24 | } 25 | return true; 26 | // return replay.steps; 27 | }; 28 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/login/login.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |

ft_transcendence is web project 7 | for learning purposes, it has almost all the basics 8 | concepts of Web Dev

9 | 10 | 42 11 |

login with 42

12 |
13 |
14 | Error 15 |
16 | 19 |
20 |
21 | 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { AuthService } from './auth.service'; 3 | import { Observable } from 'rxjs'; 4 | import { hostIp } from 'src/config'; 5 | 6 | @Component({ 7 | selector: 'app-login', 8 | templateUrl: './login.component.html', 9 | styleUrls: ['./login.component.scss'] 10 | }) 11 | export class LoginComponent { 12 | public ip: string = hostIp; 13 | // private user$: Observable = this.authService.getCurrentUser(); 14 | constructor(private authService: AuthService) { } 15 | } 16 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/login/two-factory/two-factory.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

2F authentication

4 |
5 |

write down your token

6 |
7 | 8 |

Token should be six numbers 9 |

10 |

Incorrect code

11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/login/two-factory/two-factory.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TwoFactoryComponent } from './two-factory.component'; 4 | 5 | describe('TwoFactoryComponent', () => { 6 | let component: TwoFactoryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [TwoFactoryComponent] 12 | }); 13 | fixture = TestBed.createComponent(TwoFactoryComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/notification.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class NotificationService { 7 | 8 | constructor() { } 9 | } 10 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/page-not-found/page-not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | 404 4 |

5 |

6 | Not Found 7 |

8 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/page-not-found/page-not-found.component.scss: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: 150px; 3 | font-weight: 700; 4 | } 5 | 6 | p { 7 | font-size: 44px; 8 | font-weight: 500; 9 | } 10 | 11 | div { 12 | color: #7FABCC; 13 | height: 100%; 14 | align-items: center; 15 | display: flex; 16 | justify-content: center; 17 | flex-direction: column; 18 | } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/page-not-found/page-not-found.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PageNotFoundComponent } from './page-not-found.component'; 4 | 5 | describe('PageNotFoundComponent', () => { 6 | let component: PageNotFoundComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PageNotFoundComponent] 12 | }); 13 | fixture = TestBed.createComponent(PageNotFoundComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-page-not-found', 5 | templateUrl: './page-not-found.component.html', 6 | styleUrls: ['./page-not-found.component.scss'] 7 | }) 8 | export class PageNotFoundComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/game/game.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GameComponent } from './game.component'; 4 | 5 | describe('GameComponent', () => { 6 | let component: GameComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [GameComponent] 12 | }); 13 | fixture = TestBed.createComponent(GameComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/game/game.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { GameComponent } from './game.component'; 4 | 5 | @NgModule({ 6 | declarations: [GameComponent], 7 | imports: [ 8 | CommonModule, 9 | ], 10 | providers: [], 11 | exports: [GameComponent, ], 12 | }) 13 | export class GameModule { } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/game/game.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { GameService } from './game.service'; 4 | 5 | describe('GameService', () => { 6 | let service: GameService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(GameService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/game/isgaming.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { CanActivateFn } from '@angular/router'; 3 | 4 | import { isgamingGuard } from './isgaming.guard'; 5 | 6 | describe('isgamingGuard', () => { 7 | const executeGuard: CanActivateFn = (...guardParameters) => 8 | TestBed.runInInjectionContext(() => isgamingGuard(...guardParameters)); 9 | 10 | beforeEach(() => { 11 | TestBed.configureTestingModule({}); 12 | }); 13 | 14 | it('should be created', () => { 15 | expect(executeGuard).toBeTruthy(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/game/isgaming.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { GameService } from './game.service'; 3 | import { inject } from '@angular/core'; 4 | 5 | export const isgamingGuard: CanActivateFn = (route, state) => { 6 | const gameService: GameService = inject(GameService); 7 | const switchRoute: Router = inject(Router); 8 | if (gameService.isIngame) 9 | return true; 10 | switchRoute.navigateByUrl('/play') 11 | return false; 12 | }; 13 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/play-withfr/play-withfr.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{statusLoading(item.id)}} 3 |
4 | 5 |

{{item.username}}

6 |
7 |
8 |

{{status}}

9 | 10 |
11 |
12 |
13 |

Offline

14 |
15 |
16 |
17 |

InGame

18 |
19 | Challenge 20 |
21 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/play-withfr/play-withfr.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PlayWithfrComponent } from './play-withfr.component'; 4 | 5 | describe('PlayWithfrComponent', () => { 6 | let component: PlayWithfrComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PlayWithfrComponent] 12 | }); 13 | fixture = TestBed.createComponent(PlayWithfrComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/play/play.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PlayComponent } from './play.component'; 4 | 5 | describe('PlayComponent', () => { 6 | let component: PlayComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PlayComponent] 12 | }); 13 | fixture = TestBed.createComponent(PlayComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/popup-to-be-sure/popup-to-be-sure.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 |

Are you sure you want to leave ?

7 |
8 | No 9 | Yes 10 |
11 |
12 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/card-blocked/card-blocked.component.html: -------------------------------------------------------------------------------- 1 |
2 |
nope
3 |
    4 |
  • Unblock
  • 5 |
6 | nope 7 |
{{(otherUser$ | async)?.username}}
8 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/card-friends/card-friends.component.html: -------------------------------------------------------------------------------- 1 |
2 |
nope 3 |
4 |
    5 |
  • View Profile
  • 6 |
  • Delete
  • 7 |
  • Block
  • 8 |
9 | nope 10 |
{{data.username}}
11 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/card-request/card-request.component.html: -------------------------------------------------------------------------------- 1 |
2 |
nope
3 |
    4 |
  • Confirm request
  • 5 |
  • Delete request
  • 6 |
  • View Profile
  • 7 |
  • Block
  • 8 |
9 | nope 10 |
{{(otherUser$ | async)?.username}}
11 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/card-user-statistics/card-user-statistics.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
{{ data.name }}
5 |
{{ helps?.rank }}
6 |
{{ helps?.matchPlayed }} 7 |
8 |
{{ helps?.win }}
9 |
{{ helps?.score }}
10 |
11 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/card-user-statistics/card-user-statistics.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CardUserStatisticsComponent } from './card-user-statistics.component'; 4 | 5 | describe('CardUserStatisticsComponent', () => { 6 | let component: CardUserStatisticsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [CardUserStatisticsComponent] 12 | }); 13 | fixture = TestBed.createComponent(CardUserStatisticsComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/card-user-statistics/card-user-statistics.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-card-user-statistics', 5 | templateUrl: './card-user-statistics.component.html', 6 | styleUrls: ['./card-user-statistics.component.scss'] 7 | }) 8 | export class CardUserStatisticsComponent { 9 | @Input() data: any; 10 | @Input() helps: any; 11 | constructor() { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/popup/popup.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/popup/popup.component.scss: -------------------------------------------------------------------------------- 1 | .pop { 2 | padding: 25px; 3 | position: absolute; 4 | width: 467px; 5 | left: calc(50% - 467px/2 - 0.5px); 6 | top: calc(50% - 502px/2); 7 | background: #184E77; 8 | border-radius: 30px; 9 | } 10 | 11 | .up { 12 | position: absolute; 13 | width: 100%; 14 | height: 100%; 15 | left: calc(50% - 100%/2); 16 | top: calc(50% - 100%/2); 17 | background: rgba(17, 34, 47, 0.87); 18 | } 19 | 20 | @media only screen and (max-width: 700px) { 21 | .pop { 22 | width: 350px; 23 | left: calc(50% - 350px/2 - 0.5px); 24 | } 25 | } -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/popup/popup.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PopupComponent } from './popup.component'; 4 | 5 | describe('PopupComponent', () => { 6 | let component: PopupComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PopupComponent] 12 | }); 13 | fixture = TestBed.createComponent(PopupComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/popup/popup.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; 2 | @Component({ 3 | selector: 'app-popup', 4 | templateUrl: './popup.component.html', 5 | styleUrls: ['./popup.component.scss'] 6 | }) 7 | export class PopupComponent implements OnInit{ 8 | @Input() data: any; 9 | @Output() ChildrenEvent = new EventEmitter(); 10 | parentButtonClick = new EventEmitter(); 11 | constructor() { } 12 | ngOnInit(): void 13 | {} 14 | 15 | notifyChild() { 16 | this.parentButtonClick.emit(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/settings/settings.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SettingsComponent } from './settings.component'; 4 | 5 | describe('SettingsComponent', () => { 6 | let component: SettingsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [SettingsComponent] 12 | }); 13 | fixture = TestBed.createComponent(SettingsComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/user-history-raw/user-history-raw.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |

{{item.player1.username + ' vs ' + item.player2.username}}

8 |
9 |
win 🏆
10 |
Lost 😥
11 |
{{item.date}}
12 |
-------------------------------------------------------------------------------- /in development/Data/front/front/src/app/profile/user-history-raw/user-history-raw.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ProfileService } from '../profile.service'; 3 | 4 | @Component({ 5 | selector: 'app-user-history-raw', 6 | templateUrl: './user-history-raw.component.html', 7 | styleUrls: ['./user-history-raw.component.scss'] 8 | }) 9 | export class UserHistoryRawComponent { 10 | @Input() item: any; 11 | constructor(public profile: ProfileService) { } 12 | } 13 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/.gitkeep -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/ball.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/blue/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/blue/background.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/green/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/green/background.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/line.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/paddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/paddle.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/white/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/white/background.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/white/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/white/ball.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/white/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/white/line.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/white/paddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/white/paddle.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/asset/win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/asset/win.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/block.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/blueThemeSet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/closeImg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/greenThemeSet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/3points.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/Dribbble-Light-Preview.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/block.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/channels.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/closeImg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/direct.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/hashtag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/more.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/moreone.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/send.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/icons/viewprofile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/img/profile.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/img/profile.jpeg -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in development/Data/front/front/src/assets/star.png -------------------------------------------------------------------------------- /in development/Data/front/front/src/assets/whiteThemeSet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/config.ts: -------------------------------------------------------------------------------- 1 | export const hostIp='http://10.13.1.9' 2 | export const tokenName='token' 3 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ft_transcendence 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /in development/Data/front/front/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { AppModule } from './app/app.module'; 3 | 4 | platformBrowserDynamic().bootstrapModule(AppModule) 5 | .catch(err => err); 6 | 7 | -------------------------------------------------------------------------------- /in development/Data/front/front/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } -------------------------------------------------------------------------------- /in development/Data/front/front/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "allowSyntheticDefaultImports": true, 6 | "baseUrl": "./", 7 | "outDir": "./dist/out-tsc", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "downlevelIteration": true, 17 | "experimentalDecorators": true, 18 | "moduleResolution": "node", 19 | "importHelpers": true, 20 | "target": "ES2022", 21 | "module": "ES2022", 22 | "useDefineForClassFields": false, 23 | "lib": [ 24 | "ES2022", 25 | "dom", 26 | "scripthost" 27 | ] 28 | }, 29 | "angularCompilerOptions": { 30 | "enableI18nLegacyMessageIdFormat": false, 31 | "strictInjectionParameters": true, 32 | "strictInputAccessModifiers": true, 33 | "strictTemplates": true 34 | } 35 | } -------------------------------------------------------------------------------- /in development/Data/front/front/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /in development/srcs/back/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-bullseye-slim 2 | 3 | RUN apt update -y && apt upgrade -y && apt install -y git;\ 4 | npm install -g npm@latest && npm i -g @nestjs/cli; 5 | 6 | COPY script.sh . 7 | 8 | CMD ["sh", "/script.sh"] -------------------------------------------------------------------------------- /in development/srcs/front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-bullseye-slim 2 | 3 | RUN apt update -y && apt upgrade -y && apt install -y git;\ 4 | npm install -g npm@latest && npm i -g @angular/cli;\ 5 | npm install -g @angular-devkit/build-angular; 6 | 7 | COPY script.sh . 8 | 9 | CMD ["sh", "script.sh"] -------------------------------------------------------------------------------- /in production/srcs/back/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-bullseye-slim 2 | 3 | RUN apt update -y && apt upgrade -y && apt install -y git;\ 4 | npm install -g npm@latest && npm i -g @nestjs/cli; 5 | 6 | WORKDIR /var/www/html/back 7 | COPY back . 8 | WORKDIR / 9 | COPY script.sh . 10 | 11 | CMD ["sh", "/script.sh"] -------------------------------------------------------------------------------- /in production/srcs/back/back/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | parserOptions: { 4 | project: 'tsconfig.json', 5 | tsconfigRootDir: __dirname, 6 | sourceType: 'module', 7 | }, 8 | plugins: ['@typescript-eslint/eslint-plugin'], 9 | extends: [ 10 | 'plugin:@typescript-eslint/recommended', 11 | 'plugin:prettier/recommended', 12 | ], 13 | root: true, 14 | env: { 15 | node: true, 16 | jest: true, 17 | }, 18 | ignorePatterns: ['.eslintrc.js'], 19 | rules: { 20 | '@typescript-eslint/interface-name-prefix': 'off', 21 | '@typescript-eslint/explicit-function-return-type': 'off', 22 | '@typescript-eslint/explicit-module-boundary-types': 'off', 23 | '@typescript-eslint/no-explicit-any': 'off', 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /in production/srcs/back/back/.gitignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist 3 | /node_modules 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | pnpm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | lerna-debug.log* 13 | 14 | # OS 15 | .DS_Store 16 | 17 | # Tests 18 | /coverage 19 | /.nyc_output 20 | 21 | # IDEs and editors 22 | /.idea 23 | .project 24 | .classpath 25 | .c9/ 26 | *.launch 27 | .settings/ 28 | *.sublime-workspace 29 | 30 | # IDE - VSCode 31 | .vscode/* 32 | !.vscode/settings.json 33 | !.vscode/tasks.json 34 | !.vscode/launch.json 35 | !.vscode/extensions.json 36 | 37 | #env 38 | 39 | .env -------------------------------------------------------------------------------- /in production/srcs/back/back/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } -------------------------------------------------------------------------------- /in production/srcs/back/back/database.config.ts: -------------------------------------------------------------------------------- 1 | import { Token } from 'src/authenticator/entities/Token.entity'; 2 | import { Messages } from 'src/chat/entities/Messages.entity'; 3 | import { Chat } from 'src/chat/entities/chat.entity'; 4 | import { Members } from 'src/chat/entities/membership.entity'; 5 | import { Friendship } from 'src/friendship/entities/friendship.entity'; 6 | import { Statastics } from 'src/game/statistics/entities/statistics.entity'; 7 | import { Match } from 'src/match/entities/match.entity'; 8 | import { User } from 'src/user/entities/user.entity'; 9 | import { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions'; 10 | 11 | const DataConf: PostgresConnectionOptions = { 12 | type: 'postgres', 13 | host: 'database', 14 | port: 5432, 15 | username: process.env.POSTGRES_USER, 16 | password: process.env.POSTGRES_PASSWORD, 17 | database: process.env.POSTGRES_DB, 18 | entities: [User, Friendship, Token, Match, Statastics, Chat, Messages, Members], // you can integrate the Entity you're working on here 19 | synchronize: true, 20 | } 21 | export default DataConf; -------------------------------------------------------------------------------- /in production/srcs/back/back/nest-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/nest-cli", 3 | "collection": "@nestjs/schematics", 4 | "sourceRoot": "src", 5 | "compilerOptions": { 6 | "deleteOutDir": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/app.controller.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { AppController } from './app.controller'; 3 | import { AppService } from './app.service'; 4 | 5 | describe('AppController', () => { 6 | let appController: AppController; 7 | 8 | beforeEach(async () => { 9 | const app: TestingModule = await Test.createTestingModule({ 10 | controllers: [AppController], 11 | providers: [AppService], 12 | }).compile(); 13 | 14 | appController = app.get(AppController); 15 | }); 16 | 17 | describe('root', () => { 18 | it('should return "Hello World!"', () => { 19 | expect(appController.getHello()).toBe('Hello World!'); 20 | }); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/app.controller.ts: -------------------------------------------------------------------------------- 1 | import { Controller, Get } from '@nestjs/common'; 2 | import { AppService } from './app.service'; 3 | 4 | @Controller() 5 | export class AppController { 6 | constructor(private readonly appService: AppService) {} 7 | 8 | @Get() 9 | getHello(): string { 10 | return this.appService.getHello(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/app.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | 3 | @Injectable() 4 | export class AppService { 5 | getHello(): string { 6 | return 'Hello World!'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/authenticator/auth.guard.ts: -------------------------------------------------------------------------------- 1 | import { ExecutionContext, Injectable, UnauthorizedException } from '@nestjs/common'; 2 | import { AuthGuard } from "@nestjs/passport"; 3 | 4 | @Injectable() 5 | export class fortytwoAuthGuard extends AuthGuard('42') { } -------------------------------------------------------------------------------- /in production/srcs/back/back/src/authenticator/authenticator.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AuthenticatorService } from './authenticator.service'; 3 | import { AuthenticatorController } from './authenticator.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { User } from 'src/user/entities/user.entity'; 6 | import { JwtModule, JwtService } from '@nestjs/jwt'; 7 | import { JwtStrategy } from './jwt.strategy'; 8 | import { AuthStrategy } from './fortytwo.strategy'; 9 | import { Token } from './entities/Token.entity'; 10 | import { Statastics } from 'src/game/statistics/entities/statistics.entity'; 11 | 12 | @Module({ 13 | imports: [TypeOrmModule.forFeature([User, Token, Statastics])], 14 | controllers: [AuthenticatorController], 15 | providers: [AuthenticatorService, JwtStrategy, AuthStrategy], 16 | exports: [AuthenticatorService] 17 | }) 18 | export class AuthenticatorModule { } 19 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/authenticator/dto/factor-confirm.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsBoolean, IsEmail, IsNotEmpty, Matches } from "class-validator"; 2 | 3 | 4 | export class FactorConfirmDTO { 5 | @IsNotEmpty() 6 | @Matches(/^[0-9]*$/) 7 | token: string; 8 | } 9 | export class validateConfirmDTO { 10 | 11 | @IsNotEmpty() 12 | @Matches(/^[0-9]*$/) 13 | token: string; 14 | } 15 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/authenticator/entities/Token.entity.ts: -------------------------------------------------------------------------------- 1 | import { Exclude } from 'class-transformer'; 2 | import { User } from 'src/user/entities/user.entity'; 3 | import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm'; 4 | 5 | @Entity() 6 | export class Token { 7 | @Exclude() 8 | @PrimaryColumn() 9 | token: string; 10 | 11 | @Exclude() 12 | @Column() 13 | expiration_date: Date; 14 | 15 | @Column() 16 | loggedIn: boolean; 17 | 18 | 19 | @OneToOne(() => User) 20 | @JoinColumn() 21 | User: User; 22 | 23 | constructor(partial: Partial) { 24 | Object.assign(this, partial); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/authenticator/jwt.strategy.ts: -------------------------------------------------------------------------------- 1 | import { ExtractJwt, Strategy } from 'passport-jwt'; 2 | import { PassportStrategy } from '@nestjs/passport'; 3 | import { Injectable, ExecutionContext } from '@nestjs/common'; 4 | 5 | export type JwtPayload = { 6 | sub: number; 7 | user_name: string; 8 | }; 9 | 10 | @Injectable() 11 | export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') { 12 | constructor() { 13 | const extractJwtFromCookie = (req) => { 14 | let token = null; 15 | 16 | if (req && req.cookies) { 17 | token = req.cookies[process.env.TOKEN_NAME]; 18 | } 19 | return token || ExtractJwt.fromAuthHeaderAsBearerToken()(req); 20 | }; 21 | 22 | super({ 23 | ignoreExpiration: false, 24 | secretOrKey: process.env.ACCESS_TOKEN_SECRET, 25 | jwtFromRequest: extractJwtFromCookie, 26 | }); 27 | } 28 | 29 | async validate(payload: JwtPayload) { 30 | return { 31 | id: payload.sub, 32 | user_name: payload.user_name, 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/authenticator/socket.guard.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ExecutionContext, 3 | Injectable, 4 | UnauthorizedException, 5 | } from '@nestjs/common'; 6 | import { AuthGuard } from '@nestjs/passport'; 7 | import { JwtService } from '@nestjs/jwt'; 8 | import { AuthenticatorService } from './authenticator.service'; 9 | 10 | @Injectable() 11 | export class SocketAuthGuard extends AuthGuard('jwt') { 12 | constructor( 13 | private readonly serviceJWt: JwtService, 14 | private readonly serviceToken: AuthenticatorService, 15 | ) { 16 | super(); 17 | } 18 | async canActivate(context: ExecutionContext) { 19 | const client = context.switchToWs().getClient(); 20 | if (!client.handshake.headers.authorization) return false; 21 | const xyz: any = this.serviceJWt.decode( 22 | client.handshake.headers.authorization, 23 | ); 24 | if (!xyz) 25 | return this.serviceToken.IsSame( 26 | xyz.sub || -1, 27 | client.handshake.headers.authorization, 28 | ); 29 | return false; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/dto/CreateMessage.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty, MinLength, MaxLength } from 'class-validator'; 2 | 3 | export class CreateMessage { 4 | 5 | @IsNotEmpty() 6 | @MinLength(1, { 7 | message: "Message can't be empty", 8 | }) 9 | @MaxLength(500, { 10 | message: 'Message too long', 11 | }) 12 | value!: string; 13 | 14 | @IsNotEmpty() 15 | charRoomId!: number; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/dto/SwapOwner.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty } from 'class-validator'; 2 | 3 | export class SwapOwnerDTO { 4 | @IsNotEmpty() 5 | roleGiver!: number; 6 | @IsNotEmpty() 7 | roleReciver!: number; 8 | } 9 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/dto/createAdmin.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty } from 'class-validator'; 2 | 3 | export class createAdminDTO { 4 | @IsNotEmpty() 5 | roleGiver!: number; 6 | 7 | @IsNotEmpty() 8 | roleReceiver!: number; 9 | } 10 | 11 | export class invitesDTO { 12 | @IsNotEmpty() 13 | chatID: number; 14 | 15 | @IsNotEmpty() 16 | UserId: number; 17 | } 18 | export class CreateBanDTO { 19 | @IsNotEmpty() 20 | chatID: number; 21 | 22 | @IsNotEmpty() 23 | UserId: number; 24 | } 25 | export class SeenDTO { 26 | @IsNotEmpty() 27 | isRoom: boolean; 28 | 29 | @IsNotEmpty() 30 | chatID: number; 31 | } -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/dto/createChatroom.dto.ts: -------------------------------------------------------------------------------- 1 | import { MaxLength, IsNotEmpty } from 'class-validator'; 2 | 3 | export class createChatroomDTO { 4 | @IsNotEmpty() 5 | type!: string; 6 | 7 | @IsNotEmpty() 8 | @MaxLength(26, { 9 | message: 'chat name too long', 10 | }) 11 | chatroomName!: string; 12 | 13 | password!: string; 14 | } 15 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/dto/createMember.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty } from 'class-validator'; 2 | 3 | export class createMemberDTO { 4 | @IsNotEmpty() 5 | member!: number; 6 | 7 | password?: string; 8 | } 9 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/dto/updateChatroom.dto.ts: -------------------------------------------------------------------------------- 1 | export class UpdateChatroomDTO { 2 | newType?: string; 3 | newPassword?: string; 4 | newChatroomName?: string; 5 | } 6 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/entities/Messages.entity.ts: -------------------------------------------------------------------------------- 1 | import { User } from "src/user/entities/user.entity"; 2 | import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; 3 | import { Chat } from "./chat.entity"; 4 | 5 | @Entity('messages') 6 | export class Messages { 7 | 8 | @PrimaryGeneratedColumn() 9 | id: number; 10 | 11 | @Column() 12 | content: string; 13 | 14 | @Column() 15 | time: Date; 16 | 17 | @ManyToOne(() => User, (user) => user.id) 18 | @JoinColumn({ name: 'sender_id' }) 19 | sender: number; 20 | 21 | @ManyToOne(() => Chat, (chat) => chat.id) 22 | @JoinColumn({ name: 'part_of_chat_id' }) 23 | chat_id: number; 24 | } 25 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/entities/chat.entity.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm"; 2 | import { Messages } from "./Messages.entity"; 3 | 4 | @Entity('Chat') 5 | export class Chat { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ nullable: true, unique: true }) 11 | name: string; 12 | 13 | @Column({ type: 'enum', enum: ['direct', 'public', 'private', 'protected'] }) 14 | type: string; 15 | 16 | @Column() 17 | password: string; 18 | 19 | @OneToMany(() => Messages, (messages) => messages.chat_id) 20 | messages: Messages; 21 | } 22 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/chat/entities/membership.entity.ts: -------------------------------------------------------------------------------- 1 | import { User } from "src/user/entities/user.entity"; 2 | import { Column, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; 3 | import { Chat } from "./chat.entity"; 4 | 5 | @Entity('Members') 6 | export class Members { 7 | @PrimaryColumn() 8 | Userid: number; 9 | 10 | @PrimaryColumn() 11 | chatID: number; 12 | 13 | @Column() 14 | state: number; // active 1 - blocked 0 - invited 2 - muted 3 15 | 16 | @Column({ type: 'enum', enum: ["none", "admin", "owner"] }) 17 | role: string; 18 | 19 | @Column({ nullable: true }) 20 | mute: Date; // should be the date and time when mute ends 21 | 22 | @Column({ nullable: true }) 23 | notSeen: number; 24 | 25 | @ManyToOne(() => User) 26 | @JoinColumn({ name: 'Userid' }) 27 | user: User; 28 | 29 | @ManyToOne(() => Chat) 30 | @JoinColumn({ name: 'chatID' }) 31 | chat: Chat; 32 | 33 | @DeleteDateColumn({ name: 'deleted_at' }) 34 | deleted_at: Date; 35 | } -------------------------------------------------------------------------------- /in production/srcs/back/back/src/class-validator.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'class-validator'; 2 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/envirenment.ts: -------------------------------------------------------------------------------- 1 | const hostSocket = process.env.HOST + ":4200"; 2 | export default hostSocket; -------------------------------------------------------------------------------- /in production/srcs/back/back/src/filters/global-exception.filter.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ExceptionFilter, 3 | Catch, 4 | ArgumentsHost, 5 | HttpException, 6 | HttpStatus, 7 | } from '@nestjs/common'; 8 | import { Request, Response } from 'express'; 9 | 10 | @Catch() 11 | export class GlobalExceptionFilter implements ExceptionFilter { 12 | catch(exception: unknown, host: ArgumentsHost) { 13 | const ctx = host.switchToHttp(); 14 | const response = ctx.getResponse(); 15 | const request = ctx.getRequest(); 16 | const status = 17 | exception instanceof HttpException 18 | ? exception.getStatus() 19 | : HttpStatus.INTERNAL_SERVER_ERROR; 20 | const message = 21 | exception instanceof HttpException 22 | ? exception.getResponse() 23 | : HttpStatus.INTERNAL_SERVER_ERROR; 24 | response.status(200).json({ 25 | statusCode: status, 26 | message: message, 27 | timestamp: new Date().toISOString(), 28 | path: request.url, 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/friendship/friendship.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { FriendshipService } from './friendship.service'; 3 | import { FriendshipController } from './friendship.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { Friendship } from './entities/friendship.entity'; 6 | import { User } from 'src/user/entities/user.entity'; 7 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 8 | // import { UservalidatingPipe } from './uservalidating/uservalidating.pipe'; 9 | import { FriendshipGateway } from './friendship/friendship.gateway'; 10 | 11 | @Module({ 12 | imports: [TypeOrmModule.forFeature([Friendship, User]), AuthenticatorModule], 13 | controllers: [FriendshipController], 14 | providers: [FriendshipService, FriendshipGateway] 15 | }) 16 | export class FriendshipModule {} 17 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/friendship/friendship.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { FriendshipService } from './friendship.service'; 3 | 4 | describe('FriendshipService', () => { 5 | let service: FriendshipService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [FriendshipService], 10 | }).compile(); 11 | 12 | service = module.get(FriendshipService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/friendship/friendship/friendship.gateway.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { FriendshipGateway } from './friendship.gateway'; 3 | 4 | describe('FriendshipGateway', () => { 5 | let gateway: FriendshipGateway; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [FriendshipGateway], 10 | }).compile(); 11 | 12 | gateway = module.get(FriendshipGateway); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(gateway).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/friendship/uservalidating/uservalidating.pipe.ts: -------------------------------------------------------------------------------- 1 | import { ArgumentMetadata, BadRequestException, Injectable, PipeTransform } from '@nestjs/common'; 2 | import { plainToClass } from 'class-transformer'; 3 | import { validate } from 'class-validator'; 4 | 5 | @Injectable() 6 | export class UservalidatingPipe implements PipeTransform { 7 | async transform(value: any, {metatype}: ArgumentMetadata) { 8 | if (!metatype || !this.validateMetaType(metatype)){ 9 | return value; 10 | } 11 | 12 | const object = plainToClass(metatype, value); 13 | const errors = await validate(object); 14 | 15 | if(errors.length > 0) { 16 | throw new BadRequestException('Invalid Input Data') 17 | } 18 | 19 | return value; 20 | 21 | } 22 | 23 | private validateMetaType(metatype: Function): boolean { 24 | const types: Function[] = [String, Boolean, Number, Array, Object]; 25 | return !types.includes(metatype) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/game/PositionState.ts: -------------------------------------------------------------------------------- 1 | // automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | export { PositionState } from './position-state.js'; 4 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/game/game.gateway.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { GameGateway } from './game.gateway'; 3 | import { GameService } from './game.service'; 4 | 5 | describe('GameGateway', () => { 6 | let gateway: GameGateway; 7 | 8 | beforeEach(async () => { 9 | const module: TestingModule = await Test.createTestingModule({ 10 | providers: [GameGateway, GameService], 11 | }).compile(); 12 | 13 | gateway = module.get(GameGateway); 14 | }); 15 | 16 | it('should be defined', () => { 17 | expect(gateway).toBeDefined(); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/game/game.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { GameService } from './game.service'; 3 | import { GameGateway } from './game.gateway'; 4 | import { MatchModule } from 'src/match/match.module'; 5 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 6 | import { User } from 'src/user/entities/user.entity'; 7 | import { TypeOrmModule } from '@nestjs/typeorm'; 8 | import { Statastics } from './statistics/entities/statistics.entity'; 9 | 10 | @Module({ 11 | imports: [MatchModule, AuthenticatorModule, TypeOrmModule.forFeature([User, Statastics])], 12 | providers: [GameGateway, GameService] 13 | }) 14 | export class GameModule { } 15 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/game/game.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { GameService } from './game.service'; 3 | 4 | describe('GameService', () => { 5 | let service: GameService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [GameService], 10 | }).compile(); 11 | 12 | service = module.get(GameService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/game/statistics/entities/statistics.entity.ts: -------------------------------------------------------------------------------- 1 | 2 | import { User } from "src/user/entities/user.entity"; 3 | import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from "typeorm"; 4 | 5 | @Entity() 6 | export class Statastics { 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | total: number; 12 | 13 | @Column() 14 | score: number; 15 | 16 | @Column() 17 | win: number; 18 | 19 | @OneToOne(() => User) 20 | @JoinColumn() 21 | User: User; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/main.ts: -------------------------------------------------------------------------------- 1 | import { NestFactory } from '@nestjs/core'; 2 | import { AppModule } from './app.module'; 3 | import * as cookieParser from 'cookie-parser'; 4 | import * as express from 'express'; 5 | import { ValidationPipe } from '@nestjs/common'; 6 | import { GlobalExceptionFilter } from './filters/global-exception.filter'; 7 | import { join } from 'path'; 8 | async function bootstrap() { 9 | const app = await NestFactory.create(AppModule); 10 | app.use('/avatar', express.static(join(__dirname, '../../upload/avatars'))); 11 | app.enableCors({ 12 | credentials: true, 13 | origin: process.env.HOST + ':4200', 14 | }); 15 | app.use(cookieParser()); 16 | app.useGlobalPipes(new ValidationPipe({ transform: true })); 17 | app.useGlobalFilters(new GlobalExceptionFilter()); 18 | await app.listen(3000); 19 | } 20 | bootstrap(); 21 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/match/dto/create-match.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNumber } from "class-validator"; 2 | 3 | export class CreateMatchDto { 4 | @IsNumber() 5 | player1Id: number; 6 | 7 | @IsNumber() 8 | player2Id: number; 9 | 10 | @IsNumber() 11 | winnerId: number; 12 | } 13 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/match/dto/update-match.dto.ts: -------------------------------------------------------------------------------- 1 | import { PartialType } from '@nestjs/mapped-types'; 2 | import { CreateMatchDto } from './create-match.dto'; 3 | 4 | export class UpdateMatchDto extends PartialType(CreateMatchDto) {} 5 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/match/entities/match.entity.ts: -------------------------------------------------------------------------------- 1 | 2 | import { User } from "src/user/entities/user.entity"; 3 | import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; 4 | 5 | @Entity() 6 | export class Match { 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @ManyToOne(() => User, user => user.matchesAsPlayer1) 11 | player1: User; 12 | 13 | @ManyToOne(() => User, user => user.matchesAsPlayer2) 14 | player2: User; 15 | 16 | @ManyToOne(() => User, user => user.wonMatches) 17 | winner: User; 18 | 19 | @Column() 20 | date: Date; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/match/match.controller.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { MatchController } from './match.controller'; 3 | import { MatchService } from './match.service'; 4 | 5 | describe('MatchController', () => { 6 | let controller: MatchController; 7 | 8 | beforeEach(async () => { 9 | const module: TestingModule = await Test.createTestingModule({ 10 | controllers: [MatchController], 11 | providers: [MatchService], 12 | }).compile(); 13 | 14 | controller = module.get(MatchController); 15 | }); 16 | 17 | it('should be defined', () => { 18 | expect(controller).toBeDefined(); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/match/match.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { MatchService } from './match.service'; 3 | import { MatchController } from './match.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { Match } from './entities/match.entity'; 6 | import { UserModule } from 'src/user/user.module'; 7 | // import { User } from 'src/user/entities/user.entity'; 8 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 9 | import { Statastics } from 'src/game/statistics/entities/statistics.entity'; 10 | import { User } from 'src/user/entities/user.entity'; 11 | 12 | @Module({ 13 | imports: [UserModule, TypeOrmModule.forFeature([User, Match, Statastics]), AuthenticatorModule], 14 | controllers: [MatchController], 15 | providers: [MatchService], 16 | exports: [MatchService], 17 | }) 18 | export class MatchModule { } 19 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/match/match.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { MatchService } from './match.service'; 3 | 4 | describe('MatchService', () => { 5 | let service: MatchService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [MatchService], 10 | }).compile(); 11 | 12 | service = module.get(MatchService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/user/dto/create-user.dto.ts: -------------------------------------------------------------------------------- 1 | import { MinLength } from 'class-validator'; 2 | import { MaxLength } from 'class-validator'; 3 | import { IsBoolean, IsEmail, IsNotEmpty, IsNumber, Matches } from 'class-validator'; 4 | 5 | export class CreateUserDto { 6 | @IsNotEmpty() 7 | @Matches(/^[a-z]+(-[a-z]+)?$/) 8 | @MinLength(2) 9 | @MaxLength(10) 10 | username: string; 11 | 12 | @MinLength(2) 13 | @MaxLength(20) 14 | @IsNotEmpty() 15 | name: string; 16 | 17 | @IsNotEmpty() 18 | avatar: string; 19 | 20 | @IsNotEmpty() 21 | @IsEmail() 22 | email: string; 23 | 24 | @IsNotEmpty() 25 | @IsBoolean() 26 | TwoFAenabled: boolean; 27 | } 28 | 29 | export class UpdateUserDto { 30 | @IsNotEmpty() 31 | @Matches(/^[a-z]+(-[a-z]+)?$/) 32 | @MinLength(2) 33 | @MaxLength(10) 34 | username: string; 35 | 36 | @MinLength(2) 37 | @MaxLength(20) 38 | @IsNotEmpty() 39 | name: string; 40 | 41 | @IsNotEmpty() 42 | avatar: string; 43 | 44 | @IsNotEmpty() 45 | twofactor: boolean; 46 | 47 | @IsNumber() 48 | theme: number; 49 | } 50 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/user/user.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { UserService } from './user.service'; 3 | import { UserController } from './user.controller'; 4 | import { TypeOrmModule } from '@nestjs/typeorm'; 5 | import { User } from './entities/user.entity'; 6 | import { Token } from 'src/authenticator/entities/Token.entity'; 7 | import { AuthenticatorModule } from 'src/authenticator/authenticator.module'; 8 | import { CurrentStatusGateway } from './current_status/current_status.gateway'; 9 | // import { Match } from 'src/match/entities/match.entity'; 10 | 11 | @Module({ 12 | imports: [TypeOrmModule.forFeature([User, Token]), AuthenticatorModule], 13 | controllers: [UserController], 14 | providers: [UserService, CurrentStatusGateway], 15 | exports: [UserService] 16 | }) 17 | export class UserModule {} 18 | -------------------------------------------------------------------------------- /in production/srcs/back/back/src/user/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { UserService } from './user.service'; 3 | 4 | describe('UserService', () => { 5 | let service: UserService; 6 | 7 | beforeEach(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [UserService], 10 | }).compile(); 11 | 12 | service = module.get(UserService); 13 | }); 14 | 15 | it('should be defined', () => { 16 | expect(service).toBeDefined(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /in production/srcs/back/back/test/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { INestApplication } from '@nestjs/common'; 3 | import * as request from 'supertest'; 4 | import { AppModule } from './../src/app.module'; 5 | 6 | describe('AppController (e2e)', () => { 7 | let app: INestApplication; 8 | 9 | beforeEach(async () => { 10 | const moduleFixture: TestingModule = await Test.createTestingModule({ 11 | imports: [AppModule], 12 | }).compile(); 13 | 14 | app = moduleFixture.createNestApplication(); 15 | await app.init(); 16 | }); 17 | 18 | it('/ (GET)', () => { 19 | return request(app.getHttpServer()) 20 | .get('/') 21 | .expect(200) 22 | .expect('Hello World!'); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /in production/srcs/back/back/test/jest-e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleFileExtensions": ["js", "json", "ts"], 3 | "rootDir": ".", 4 | "testEnvironment": "node", 5 | "testRegex": ".e2e-spec.ts$", 6 | "transform": { 7 | "^.+\\.(t|j)s$": "ts-jest" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /in production/srcs/back/back/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /in production/srcs/back/back/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /in production/srcs/back/back/upload/avatars/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/back/back/upload/avatars/.gitkeep -------------------------------------------------------------------------------- /in production/srcs/front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-bullseye-slim 2 | 3 | RUN apt update -y && apt upgrade -y && apt install -y git;\ 4 | npm install -g npm@latest && npm i -g @angular/cli;\ 5 | npm install -g @angular-devkit/build-angular; 6 | 7 | WORKDIR /var/www/html/front 8 | 9 | COPY front . 10 | 11 | WORKDIR / 12 | 13 | COPY script.sh . 14 | 15 | CMD ["sh", "script.sh"] -------------------------------------------------------------------------------- /in production/srcs/front/front/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /in production/srcs/front/front/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /in production/srcs/front/front/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /in production/srcs/front/front/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://10.12.8.1:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://10.12.8.1:9876/debug.html" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/app-body/app-body.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AppBodyComponent } from './app-body.component'; 4 | 5 | describe('AppBodyComponent', () => { 6 | let component: AppBodyComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [AppBodyComponent] 12 | }); 13 | fixture = TestBed.createComponent(AppBodyComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/app/app.component.scss -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Component } from '@angular/core'; 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/channels/channels.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

{{channel?.chat?.name}}

4 |
{{channel.notSeen}}
5 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/channels/channels.component.scss: -------------------------------------------------------------------------------- 1 | .channel { 2 | transition: 0.3s; 3 | display: grid; 4 | grid-template-columns: min-content auto min-content; 5 | gap: 6px; 6 | align-items: center; 7 | font-size: 15px; 8 | padding: 7px; 9 | cursor: pointer; 10 | } 11 | 12 | .channel:hover { 13 | background-color: #184E77; 14 | border-radius: 10px; 15 | } 16 | 17 | .hashtag { 18 | position: relative; 19 | width: 33px; 20 | } 21 | 22 | .nb-messages { 23 | height: 16px; 24 | width: 16px; 25 | font-size: 11px; 26 | background-color: #FF5E5E; 27 | display: flex; 28 | border-radius: 50%; 29 | justify-content: center; 30 | align-items: center; 31 | padding: 2px; 32 | } 33 | 34 | @media only screen and (max-width: 600px) { 35 | .nb-messages { 36 | display: none; 37 | } 38 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/channels/channels.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChannelsComponent } from './channels.component'; 4 | 5 | describe('ChannelsComponent', () => { 6 | let component: ChannelsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChannelsComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChannelsComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/channels/channels.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { ChatService } from '../chat.service'; 4 | 5 | @Component({ 6 | selector: 'app-channels', 7 | templateUrl: './channels.component.html', 8 | styleUrls: ['./channels.component.scss'] 9 | }) 10 | export class ChannelsComponent { 11 | @Input() channel: any; 12 | constructor(private readonly switchRoute: Router, private readonly chatService: ChatService) { 13 | } 14 | openChat(id: number) { 15 | this.chatService.GoForSeen(id, true); 16 | this.switchRoute.navigateByUrl("/chat/" + id) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/chat-content/chat-content.component.html: -------------------------------------------------------------------------------- 1 |
2 | 4 | 5 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/chat-content/chat-content.component.scss: -------------------------------------------------------------------------------- 1 | .griding { 2 | display: grid; 3 | grid-template-columns: 70% 30%; 4 | height: 100%; 5 | } 6 | 7 | @media only screen and (max-width: 900px) { 8 | .grid3 { 9 | display: none; 10 | } 11 | 12 | .griding { 13 | display: grid; 14 | grid-template-columns: 100%; 15 | height: 100%; 16 | } 17 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/chat-content/chat-content.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChatContentComponent } from './chat-content.component'; 4 | 5 | describe('ChatContentComponent', () => { 6 | let component: ChatContentComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChatContentComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChatContentComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/chat-info/chat-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChatInfoComponent } from './chat-info.component'; 4 | 5 | describe('ChatInfoComponent', () => { 6 | let component: ChatInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChatInfoComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChatInfoComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/chat-info/part-chat/part-chat.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PartChatComponent } from './part-chat.component'; 4 | 5 | describe('PartChatComponent', () => { 6 | let component: PartChatComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PartChatComponent] 12 | }); 13 | fixture = TestBed.createComponent(PartChatComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/chat.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChatComponent } from './chat.component'; 4 | 5 | describe('ChatComponent', () => { 6 | let component: ChatComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ChatComponent] 12 | }); 13 | fixture = TestBed.createComponent(ChatComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/dm-access.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { CanActivateFn } from '@angular/router'; 3 | 4 | import { dMACCESSGuard } from './dm-access.guard'; 5 | 6 | describe('dMACCESSGuard', () => { 7 | const executeGuard: CanActivateFn = (...guardParameters) => 8 | TestBed.runInInjectionContext(() => dMACCESSGuard(...guardParameters)); 9 | 10 | beforeEach(() => { 11 | TestBed.configureTestingModule({}); 12 | }); 13 | 14 | it('should be created', () => { 15 | expect(executeGuard).toBeTruthy(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/dm-access.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { ChatService } from './chat.service'; 3 | import { inject } from '@angular/core'; 4 | import { firstValueFrom, lastValueFrom } from 'rxjs'; 5 | 6 | export const dMACCESSGuard: CanActivateFn = async (route, state) => { 7 | const chatService: ChatService = inject(ChatService); 8 | const switchRoute: Router = inject(Router); 9 | 10 | const access = await lastValueFrom(chatService.hasAccessToDM(route.params['username']), { defaultValue: false }); 11 | if (!access) { 12 | switchRoute.navigateByUrl('/chat'); 13 | return false; 14 | } 15 | return true; 16 | }; 17 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/dms/dms.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{statusLoading(user.id)}} 3 |
4 | 5 |
7 |
8 |
9 |

{{user.name}}

10 |
{{count}}
11 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/messages-mdl/messages-mdl.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MessagesMdlComponent } from './messages-mdl.component'; 4 | 5 | describe('MessagesMdlComponent', () => { 6 | let component: MessagesMdlComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [MessagesMdlComponent] 12 | }); 13 | fixture = TestBed.createComponent(MessagesMdlComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/messages/message.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

{{myId() != value?.sender?.id ? value?.sender?.name : 'You'}}

6 |

{{ (today|date:'longDate') == (value?.time|date:'longDate') ? (value?.time|date:'shortTime') 7 | : (value?.time|date:'longDate') + ', ' +(value?.time|date:'shortTime')}}

8 |
9 |
{{value?.content}}
10 |
11 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/messages/message.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { AuthService } from 'src/app/login/auth.service'; 4 | import { ProfileService } from 'src/app/profile/profile.service'; 5 | 6 | @Component({ 7 | selector: 'app-message', 8 | templateUrl: './message.component.html', 9 | styleUrls: ['./message.component.scss'] 10 | }) 11 | export class MessageComponent { 12 | @Input() value !: any; 13 | today: number = Date.now(); 14 | whoIs$ !: Observable; 15 | constructor(private readonly serviceProfile: ProfileService, private readonly serviceAuth: AuthService) { 16 | } 17 | 18 | imageLink(url: string) { 19 | return this.serviceProfile.getUserAvatarPath(url); 20 | } 21 | myId() { 22 | return this.serviceAuth.getId(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/no-access.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { CanActivateFn } from '@angular/router'; 3 | 4 | import { noACCESSGuard } from './no-access.guard'; 5 | 6 | describe('noACCESSGuard', () => { 7 | const executeGuard: CanActivateFn = (...guardParameters) => 8 | TestBed.runInInjectionContext(() => noACCESSGuard(...guardParameters)); 9 | 10 | beforeEach(() => { 11 | TestBed.configureTestingModule({}); 12 | }); 13 | 14 | it('should be created', () => { 15 | expect(executeGuard).toBeTruthy(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/no-access.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { ChatService } from './chat.service'; 3 | import { inject } from '@angular/core'; 4 | import { lastValueFrom } from 'rxjs'; 5 | 6 | export const noACCESSGuard: CanActivateFn = async (route, state) => { 7 | 8 | const chatService: ChatService = inject(ChatService); 9 | const switchRoute: Router = inject(Router); 10 | 11 | try { 12 | const access = await lastValueFrom(chatService.hasAccessToChannel(route.params['id']), { defaultValue: false }); 13 | if (!access) { 14 | switchRoute.navigateByUrl('/chat'); 15 | return false; 16 | } 17 | } 18 | catch (err) { 19 | return false; 20 | } 21 | return true; 22 | }; 23 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/send-msg/send-msg.component.html: -------------------------------------------------------------------------------- 1 |
2 | 4 | 5 |

Send

6 | 7 |
8 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/send-msg/send-msg.component.scss: -------------------------------------------------------------------------------- 1 | .sendMessage { 2 | display: flex; 3 | gap: 5px; 4 | padding: 25px; 5 | } 6 | 7 | .textbox { 8 | color: #D8D8D8; 9 | height: 32px; 10 | background: #184E77; 11 | box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25); 12 | border-radius: 8px; 13 | border: none; 14 | outline: none; 15 | padding-left: 10px; 16 | } 17 | 18 | .textbox::placeholder { 19 | color: #7FABCC; 20 | } 21 | 22 | .message { 23 | width: 100%; 24 | height: 38px; 25 | } 26 | 27 | .buttonSend { 28 | display: flex; 29 | gap: 3px; 30 | align-items: center; 31 | font-size: 11px; 32 | font-weight: 600; 33 | color: #103959; 34 | cursor: pointer; 35 | border-radius: 8px; 36 | background: #99D98C; 37 | padding-left: 20px; 38 | padding-right: 20px; 39 | box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.25); 40 | transition: 0.3; 41 | } 42 | 43 | .buttonSend:hover { 44 | opacity: 70%; 45 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/chat/send-msg/send-msg.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SendMsgComponent } from './send-msg.component'; 4 | 5 | describe('SendMsgComponent', () => { 6 | let component: SendMsgComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [SendMsgComponent] 12 | }); 13 | fixture = TestBed.createComponent(SendMsgComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/create-channel/create-channel.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CreateChannelComponent } from './create-channel.component'; 4 | 5 | describe('CreateChannelComponent', () => { 6 | let component: CreateChannelComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [CreateChannelComponent] 12 | }); 13 | fixture = TestBed.createComponent(CreateChannelComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/httpfail.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { 3 | HttpRequest, 4 | HttpHandler, 5 | HttpEvent, 6 | HttpInterceptor 7 | } from '@angular/common/http'; 8 | import { EMPTY, Observable, catchError, isEmpty, of, retry } from 'rxjs'; 9 | 10 | @Injectable() 11 | export class HttpfailInterceptor implements HttpInterceptor { 12 | 13 | constructor() {} 14 | 15 | intercept(request: HttpRequest, next: HttpHandler): Observable { 16 | return next.handle(request).pipe(retry(1), catchError((err) => {return of({statusCode: 403})}) ) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/invite/invite-lines/invite-lines.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

{{user.name}}

4 | Invite 6 | Invited 8 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/invite/invite-lines/invite-lines.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InviteLinesComponent } from './invite-lines.component'; 4 | 5 | describe('InviteLinesComponent', () => { 6 | let component: InviteLinesComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [InviteLinesComponent] 12 | }); 13 | fixture = TestBed.createComponent(InviteLinesComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/invite/invite.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |

{{'Invite friends to #' + (channelInfos$|async)?.name}}

6 |
7 |
You 9 | have No friends to 10 | invite
11 | 12 |
13 | 14 |
15 |
16 |
17 | 18 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/invite/invite.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InviteComponent } from './invite.component'; 4 | 5 | describe('InviteComponent', () => { 6 | let component: InviteComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [InviteComponent] 12 | }); 13 | fixture = TestBed.createComponent(InviteComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/joining-channel/invited-friend/invited-friend.component.html: -------------------------------------------------------------------------------- 1 |
3 |
4 |

{{'#' + invite.chat.name}}

5 |

{{' ' + invite.chat.type + ' channel'}}

6 |
7 | Accept 8 | 9 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/joining-channel/invited-friend/invited-friend.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InvitedFriendComponent } from './invited-friend.component'; 4 | 5 | describe('InvitedFriendComponent', () => { 6 | let component: InvitedFriendComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [InvitedFriendComponent] 12 | }); 13 | fixture = TestBed.createComponent(InvitedFriendComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/leaderbord/leader-bord-row/leader-bord-row.component.html: -------------------------------------------------------------------------------- 1 | 2 |
1
3 |
2
4 |
3
5 | 6 |
{{index}}
7 |
8 | user 11 |

{{data.user.username}}

12 |
13 |
{{data.matchPlayed}}
14 |
{{data.win}}
15 |
{{data.ratio}}
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/leaderbord/leader-bord-row/leader-bord-row.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LeaderBordRowComponent } from './leader-bord-row.component'; 4 | 5 | describe('LeaderBordRowComponent', () => { 6 | let component: LeaderBordRowComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LeaderBordRowComponent] 12 | }); 13 | fixture = TestBed.createComponent(LeaderBordRowComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/leaderbord/leader-bord-row/leader-bord-row.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ProfileService } from 'src/app/profile/profile.service'; 3 | 4 | @Component({ 5 | selector: 'app-leader-bord-row', 6 | templateUrl: './leader-bord-row.component.html', 7 | styleUrls: ['./leader-bord-row.component.scss'] 8 | }) 9 | export class LeaderBordRowComponent { 10 | @Input() data: any; 11 | @Input() index !: number; 12 | 13 | constructor(private profile: ProfileService) { 14 | } 15 | 16 | avataring(url: string) { 17 | return this.profile.getUserAvatarPath(url) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/leaderbord/leaderbord.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Leaderboard

3 |
4 |
Rank
5 |
Players
6 |
Matches played
7 |
Wins
8 |
Score
9 |
10 | 13 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/leaderbord/leaderbord.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LeaderbordComponent } from './leaderbord.component'; 4 | 5 | describe('LeaderbordComponent', () => { 6 | let component: LeaderbordComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LeaderbordComponent] 12 | }); 13 | fixture = TestBed.createComponent(LeaderbordComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/login/auth.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthService } from './auth.service'; 4 | 5 | describe('AuthService', () => { 6 | let service: AuthService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(AuthService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/login/guards/two-fac.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { AuthService } from '../auth.service'; 3 | import { inject } from '@angular/core'; 4 | import { firstValueFrom } from 'rxjs'; 5 | 6 | export const twoFacGuard: CanActivateFn = async (route, state) => { 7 | 8 | const authService: AuthService = inject(AuthService); 9 | const switchRoute: Router = inject(Router); 10 | let replay: any = {}; 11 | try { 12 | replay = await firstValueFrom(authService.getCurrentUser(), { defaultValue: { statusCode: 403 } }); 13 | } 14 | catch (err) { 15 | replay = { statusCode: 403 } 16 | } 17 | if (replay?.statusCode && replay.statusCode == 403) { 18 | switchRoute.navigateByUrl('login'); 19 | return false; 20 | } 21 | if (!replay.steps) { 22 | switchRoute.navigateByUrl(''); 23 | return true; 24 | } 25 | return true; 26 | // return replay.steps; 27 | }; 28 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/login/login.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |

ft_transcendence is web project 7 | for learning purposes, it has almost all the basics 8 | concepts of Web Dev

9 | 10 | 42 11 |

login with 42

12 |
13 |
14 | Error 15 |
16 | 19 |
20 |
21 | 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { AuthService } from './auth.service'; 3 | import { Observable } from 'rxjs'; 4 | import { hostIp } from 'src/config'; 5 | 6 | @Component({ 7 | selector: 'app-login', 8 | templateUrl: './login.component.html', 9 | styleUrls: ['./login.component.scss'] 10 | }) 11 | export class LoginComponent { 12 | public ip: string = hostIp; 13 | // private user$: Observable = this.authService.getCurrentUser(); 14 | constructor(private authService: AuthService) { } 15 | } 16 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/login/two-factory/two-factory.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

2F authentication

4 |
5 |

write down your token

6 |
7 | 8 |

Token should be six numbers 9 |

10 |

Incorrect code

11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/login/two-factory/two-factory.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TwoFactoryComponent } from './two-factory.component'; 4 | 5 | describe('TwoFactoryComponent', () => { 6 | let component: TwoFactoryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [TwoFactoryComponent] 12 | }); 13 | fixture = TestBed.createComponent(TwoFactoryComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/notification.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class NotificationService { 7 | 8 | constructor() { } 9 | } 10 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/page-not-found/page-not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | 404 4 |

5 |

6 | Not Found 7 |

8 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/page-not-found/page-not-found.component.scss: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: 150px; 3 | font-weight: 700; 4 | } 5 | 6 | p { 7 | font-size: 44px; 8 | font-weight: 500; 9 | } 10 | 11 | div { 12 | color: #7FABCC; 13 | height: 100%; 14 | align-items: center; 15 | display: flex; 16 | justify-content: center; 17 | flex-direction: column; 18 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/page-not-found/page-not-found.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PageNotFoundComponent } from './page-not-found.component'; 4 | 5 | describe('PageNotFoundComponent', () => { 6 | let component: PageNotFoundComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PageNotFoundComponent] 12 | }); 13 | fixture = TestBed.createComponent(PageNotFoundComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-page-not-found', 5 | templateUrl: './page-not-found.component.html', 6 | styleUrls: ['./page-not-found.component.scss'] 7 | }) 8 | export class PageNotFoundComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/game/game.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GameComponent } from './game.component'; 4 | 5 | describe('GameComponent', () => { 6 | let component: GameComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [GameComponent] 12 | }); 13 | fixture = TestBed.createComponent(GameComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/game/game.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { GameComponent } from './game.component'; 4 | 5 | @NgModule({ 6 | declarations: [GameComponent], 7 | imports: [ 8 | CommonModule, 9 | ], 10 | providers: [], 11 | exports: [GameComponent, ], 12 | }) 13 | export class GameModule { } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/game/game.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { GameService } from './game.service'; 4 | 5 | describe('GameService', () => { 6 | let service: GameService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(GameService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/game/isgaming.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { CanActivateFn } from '@angular/router'; 3 | 4 | import { isgamingGuard } from './isgaming.guard'; 5 | 6 | describe('isgamingGuard', () => { 7 | const executeGuard: CanActivateFn = (...guardParameters) => 8 | TestBed.runInInjectionContext(() => isgamingGuard(...guardParameters)); 9 | 10 | beforeEach(() => { 11 | TestBed.configureTestingModule({}); 12 | }); 13 | 14 | it('should be created', () => { 15 | expect(executeGuard).toBeTruthy(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/game/isgaming.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn, Router } from '@angular/router'; 2 | import { GameService } from './game.service'; 3 | import { inject } from '@angular/core'; 4 | 5 | export const isgamingGuard: CanActivateFn = (route, state) => { 6 | const gameService: GameService = inject(GameService); 7 | const switchRoute: Router = inject(Router); 8 | if (gameService.isIngame) 9 | return true; 10 | switchRoute.navigateByUrl('/play') 11 | return false; 12 | }; 13 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/play-withfr/play-withfr.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{statusLoading(item.id)}} 3 |
4 | 5 |

{{item.username}}

6 |
7 |
8 |

{{status}}

9 | 10 |
11 |
12 |
13 |

Offline

14 |
15 |
16 |
17 |

InGame

18 |
19 | Challenge 20 |
21 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/play-withfr/play-withfr.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PlayWithfrComponent } from './play-withfr.component'; 4 | 5 | describe('PlayWithfrComponent', () => { 6 | let component: PlayWithfrComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PlayWithfrComponent] 12 | }); 13 | fixture = TestBed.createComponent(PlayWithfrComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/play/play.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PlayComponent } from './play.component'; 4 | 5 | describe('PlayComponent', () => { 6 | let component: PlayComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PlayComponent] 12 | }); 13 | fixture = TestBed.createComponent(PlayComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/popup-to-be-sure/popup-to-be-sure.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 |

Are you sure you want to leave ?

7 |
8 | No 9 | Yes 10 |
11 |
12 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/card-blocked/card-blocked.component.html: -------------------------------------------------------------------------------- 1 |
2 |
nope
3 |
    4 |
  • Unblock
  • 5 |
6 | nope 7 |
{{(otherUser$ | async)?.username}}
8 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/card-friends/card-friends.component.html: -------------------------------------------------------------------------------- 1 |
2 |
nope 3 |
4 |
    5 |
  • View Profile
  • 6 |
  • Delete
  • 7 |
  • Block
  • 8 |
9 | nope 10 |
{{data.username}}
11 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/card-request/card-request.component.html: -------------------------------------------------------------------------------- 1 |
2 |
nope
3 |
    4 |
  • Confirm request
  • 5 |
  • Delete request
  • 6 |
  • View Profile
  • 7 |
  • Block
  • 8 |
9 | nope 10 |
{{(otherUser$ | async)?.username}}
11 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/card-user-statistics/card-user-statistics.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
{{ data.name }}
5 |
{{ helps?.rank }}
6 |
{{ helps?.matchPlayed }} 7 |
8 |
{{ helps?.win }}
9 |
{{ helps?.score }}
10 |
11 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/card-user-statistics/card-user-statistics.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CardUserStatisticsComponent } from './card-user-statistics.component'; 4 | 5 | describe('CardUserStatisticsComponent', () => { 6 | let component: CardUserStatisticsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [CardUserStatisticsComponent] 12 | }); 13 | fixture = TestBed.createComponent(CardUserStatisticsComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/card-user-statistics/card-user-statistics.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-card-user-statistics', 5 | templateUrl: './card-user-statistics.component.html', 6 | styleUrls: ['./card-user-statistics.component.scss'] 7 | }) 8 | export class CardUserStatisticsComponent { 9 | @Input() data: any; 10 | @Input() helps: any; 11 | constructor() { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/popup/popup.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/popup/popup.component.scss: -------------------------------------------------------------------------------- 1 | .pop { 2 | padding: 25px; 3 | position: absolute; 4 | width: 467px; 5 | left: calc(50% - 467px/2 - 0.5px); 6 | top: calc(50% - 502px/2); 7 | background: #184E77; 8 | border-radius: 30px; 9 | } 10 | 11 | .up { 12 | position: absolute; 13 | width: 100%; 14 | height: 100%; 15 | left: calc(50% - 100%/2); 16 | top: calc(50% - 100%/2); 17 | background: rgba(17, 34, 47, 0.87); 18 | } 19 | 20 | @media only screen and (max-width: 700px) { 21 | .pop { 22 | width: 350px; 23 | left: calc(50% - 350px/2 - 0.5px); 24 | } 25 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/popup/popup.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PopupComponent } from './popup.component'; 4 | 5 | describe('PopupComponent', () => { 6 | let component: PopupComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PopupComponent] 12 | }); 13 | fixture = TestBed.createComponent(PopupComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/popup/popup.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; 2 | @Component({ 3 | selector: 'app-popup', 4 | templateUrl: './popup.component.html', 5 | styleUrls: ['./popup.component.scss'] 6 | }) 7 | export class PopupComponent implements OnInit{ 8 | @Input() data: any; 9 | @Output() ChildrenEvent = new EventEmitter(); 10 | parentButtonClick = new EventEmitter(); 11 | constructor() { } 12 | ngOnInit(): void 13 | {} 14 | 15 | notifyChild() { 16 | this.parentButtonClick.emit(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/settings/settings.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SettingsComponent } from './settings.component'; 4 | 5 | describe('SettingsComponent', () => { 6 | let component: SettingsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [SettingsComponent] 12 | }); 13 | fixture = TestBed.createComponent(SettingsComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/user-history-raw/user-history-raw.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |

{{item.player1.username + ' vs ' + item.player2.username}}

8 |
9 |
win 🏆
10 |
Lost 😥
11 |
{{item.date}}
12 |
-------------------------------------------------------------------------------- /in production/srcs/front/front/src/app/profile/user-history-raw/user-history-raw.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ProfileService } from '../profile.service'; 3 | 4 | @Component({ 5 | selector: 'app-user-history-raw', 6 | templateUrl: './user-history-raw.component.html', 7 | styleUrls: ['./user-history-raw.component.scss'] 8 | }) 9 | export class UserHistoryRawComponent { 10 | @Input() item: any; 11 | constructor(public profile: ProfileService) { } 12 | } 13 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/.gitkeep -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/ball.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/blue/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/blue/background.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/green/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/green/background.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/line.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/paddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/paddle.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/white/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/white/background.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/white/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/white/ball.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/white/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/white/line.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/white/paddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/white/paddle.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/asset/win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/asset/win.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/block.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/blueThemeSet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/closeImg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/greenThemeSet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/3points.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/Dribbble-Light-Preview.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/block.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/channels.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/closeImg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/direct.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/hashtag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/more.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/moreone.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/send.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/icons/viewprofile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/img/profile.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/img/profile.jpeg -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/assets/star.png -------------------------------------------------------------------------------- /in production/srcs/front/front/src/assets/whiteThemeSet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/config.ts: -------------------------------------------------------------------------------- 1 | export const hostIp = 'http://10.13.4.6'; 2 | export const tokenName = 'access_token'; -------------------------------------------------------------------------------- /in production/srcs/front/front/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/in production/srcs/front/front/src/favicon.ico -------------------------------------------------------------------------------- /in production/srcs/front/front/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ft_transcendence 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /in production/srcs/front/front/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { AppModule } from './app/app.module'; 3 | 4 | platformBrowserDynamic().bootstrapModule(AppModule) 5 | .catch(err => err); 6 | 7 | -------------------------------------------------------------------------------- /in production/srcs/front/front/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "allowSyntheticDefaultImports": true, 6 | "baseUrl": "./", 7 | "outDir": "./dist/out-tsc", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "downlevelIteration": true, 17 | "experimentalDecorators": true, 18 | "moduleResolution": "node", 19 | "importHelpers": true, 20 | "target": "ES2022", 21 | "module": "ES2022", 22 | "useDefineForClassFields": false, 23 | "lib": [ 24 | "ES2022", 25 | "dom", 26 | "scripthost" 27 | ] 28 | }, 29 | "angularCompilerOptions": { 30 | "enableI18nLegacyMessageIdFormat": false, 31 | "strictInjectionParameters": true, 32 | "strictInputAccessModifiers": true, 33 | "strictTemplates": true 34 | } 35 | } -------------------------------------------------------------------------------- /in production/srcs/front/front/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /screenshots/2FA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/2FA.png -------------------------------------------------------------------------------- /screenshots/404 page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/404 page.png -------------------------------------------------------------------------------- /screenshots/Chat - Channels (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Chat - Channels (1).png -------------------------------------------------------------------------------- /screenshots/Chat - Channels (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Chat - Channels (2).png -------------------------------------------------------------------------------- /screenshots/Chat - Channels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Chat - Channels.png -------------------------------------------------------------------------------- /screenshots/Chat - DM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Chat - DM.png -------------------------------------------------------------------------------- /screenshots/Game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Game.png -------------------------------------------------------------------------------- /screenshots/Invite - Channels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Invite - Channels.png -------------------------------------------------------------------------------- /screenshots/Profile (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Profile (1).png -------------------------------------------------------------------------------- /screenshots/Profile (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Profile (2).png -------------------------------------------------------------------------------- /screenshots/Profile (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Profile (3).png -------------------------------------------------------------------------------- /screenshots/Profile (4).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Profile (4).png -------------------------------------------------------------------------------- /screenshots/Profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Profile.png -------------------------------------------------------------------------------- /screenshots/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/Settings.png -------------------------------------------------------------------------------- /screenshots/box list profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/box list profile.png -------------------------------------------------------------------------------- /screenshots/ft_transcendence web application.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/ft_transcendence web application.zip -------------------------------------------------------------------------------- /screenshots/load page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EVBLOOD/ft_transcendence/6a20bd55129d57842c3d4b1d2ef60c58f24f9738/screenshots/load page.png --------------------------------------------------------------------------------