Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3179a48
:bug: image cassé
RamisL Sep 6, 2023
0e84327
Merge pull request #39 from js-suck/develop
lailacha Sep 6, 2023
fa3eb56
Merge pull request #42 from js-suck/develop
lailacha Sep 6, 2023
958397c
:sparkless: Back office + gestion des users
RamisL Sep 6, 2023
fa23dfa
Merge branch 'main' into QB-lucas
RamisL Sep 6, 2023
4a319e5
Merge pull request #43 from js-suck/QB-lucas
RamisL Sep 6, 2023
0c6c6bf
:sparkless: Back office + gestion des users
RamisL Sep 6, 2023
d9706a5
Merge pull request #44 from js-suck/QB-lucas
RamisL Sep 6, 2023
9a089fe
:sparkless: Back office + gestion des users
RamisL Sep 6, 2023
55d60f5
Merge pull request #45 from js-suck/QB-lucas
RamisL Sep 6, 2023
f574b79
:sparkless: Back office + gestion des users
RamisL Sep 7, 2023
0015fcb
Merge pull request #46 from js-suck/QB-lucas
RamisL Sep 7, 2023
a7381b2
:sparkless: Back office + gestion des users
RamisL Sep 7, 2023
e65dd60
Merge pull request #47 from js-suck/QB-lucas
RamisL Sep 7, 2023
5965ab7
:sparkless: Back office + gestion des users
RamisL Sep 7, 2023
05e9cac
:sparkless: Back office + gestion des users
RamisL Sep 7, 2023
33c0cbd
Merge pull request #48 from js-suck/QB-lucas
RamisL Sep 7, 2023
9e2c448
:sparkless: Back office + gestion des users
RamisL Sep 7, 2023
c130c29
:sparkless: Back office + gestion des users
RamisL Sep 7, 2023
e914e15
Merge pull request #49 from js-suck/QB-lucas
RamisL Sep 7, 2023
5c74b48
:sparkless: Back office + gestion des users
RamisL Sep 7, 2023
4f3579c
Merge pull request #50 from js-suck/QB-lucas
RamisL Sep 7, 2023
29d8daf
fix(image) remove src
lailacha Sep 7, 2023
866a93d
Merge pull request #51 from js-suck/feat/last_improvements
lailacha Sep 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions QuizzBattle/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
uploads/
coverage/
!/uploads/defaultUser.png
!/uploads/arts_and_literature.jpeg
!/uploads/film_and_tv.jpeg
!/uploads/food_and_drink.jpeg
!/uploads/general_knowledge.jpeg
!/uploads/geography.jpeg
!/uploads/history.png
!/uploads/history.jpeg
!/uploads/music.jpeg
!/uploads/science.jpeg
!/uploads/society_and_culture.jpeg
!/uploads/sport_and_leisure.jpeg
!/uploads/sport.avif

7 changes: 2 additions & 5 deletions QuizzBattle/back/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ const quizzBattleSocket = new QuizzBattleSocket(server)

const multer = require('multer');
const upload = multer({ dest: __dirname + '/uploads/' });

console.log(upload, 'updza', __dirname, 'tototot')

app.use(express.urlencoded({ extended: false }));
app.use('/uploads', express.static(path.join(__dirname, './uploads')));

app.use('/uploads', express.static(path.join(__dirname, 'uploads')));

app.post('/upload', upload.single('profileImage'), (req, res) => {
if (!req['file']) {
Expand All @@ -85,8 +84,6 @@ app.post('/upload', upload.single('profileImage'), (req, res) => {
}
});



initMongo()
app.use(express.json())

Expand Down
2 changes: 1 addition & 1 deletion QuizzBattle/back/src/routers/categoryRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const multer = require('multer');
import path from 'path';
import usersRouter from "./userRouter";
const storage = multer.diskStorage({
destination: 'src/uploads/',
destination: 'dist/uploads/',
filename: function (req, file, cb) {
const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1E9);
const fileExtension = path.extname(file.originalname);
Expand Down
2 changes: 1 addition & 1 deletion QuizzBattle/back/src/routers/userRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const usersRouter = express.Router();
const destinationFolder = path.join(__dirname, 'uploads/');

const storage = multer.diskStorage({
destination: 'src/uploads/',
destination: 'dist/uploads/',
filename: function (req, file, cb) {
const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1E9);
const fileExtension = path.extname(file.originalname);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added QuizzBattle/back/src/uploads/film_and_tv.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added QuizzBattle/back/src/uploads/geography.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added QuizzBattle/back/src/uploads/history.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added QuizzBattle/back/src/uploads/history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added QuizzBattle/back/src/uploads/music.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added QuizzBattle/back/src/uploads/science.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added QuizzBattle/back/src/uploads/sport.avif
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion QuizzBattle/front/src/components/EditSurvey.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="p-4 sm:ml-64 flex flex-col">
<h2 class="text-2xl font-semibold mb-4">User Sheet</h2>
<h2 class="text-2xl font-semibold mb-4">Edit Survey</h2>
<div class="container flex">
<div class="card flex mr-4">
<form class="my-4 w-full" @submit.prevent="submitForm" enctype="multipart/form-data">
Expand Down
3 changes: 2 additions & 1 deletion QuizzBattle/front/src/components/RankingTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<img
@click="openModal(userData.userId)"
class="rounded-full h-full object-cover w-full"
:src="`${API_URL}/uploads/${userData.image}`"
:src="`${API_URL}/uploads/${userData.userProfilePicture}`"
alt=""
/>
</div>
Expand Down Expand Up @@ -85,6 +85,7 @@ const openModal = (user) => {
onMounted(async () => {
const response = await client.get(url)
items.value = response.data
console.log(items)
})
</script>

Expand Down
7 changes: 2 additions & 5 deletions QuizzBattle/front/src/components/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
type="submit"
class="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 focus:outline-none focus:bg-blue-600"
>
Register
Enregistré
</button>
</div>
<div class="mt-6">
Expand All @@ -114,21 +114,18 @@
</div>
</form>
</div>
<div class="card flex mr-4">
<span>Match History In Coming</span>
</div>
</div>
</div>
</template>

<script setup>
import { defineProps, onMounted, ref } from 'vue'


import { API_URL } from '@/constants'

import client from '../helpers/client'

const stats = ref({})
const responseUser = ref({})
const fileInputRef = ref(null)
const profilePicture = ref(null)
Expand Down
9 changes: 0 additions & 9 deletions QuizzBattle/front/src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
<img src="@/assets/images/LogoQuizzBattleWithoutBG.png">

</li>
<li>
<router-link :to="{ name: 'admin_dashboard' }" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100 group">
<svg class="w-8 h-8 text-gray-500 transition duration-75 group-hover:text-gray-900" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 22 21">
<path d="M16.975 11H10V4.025a1 1 0 0 0-1.066-.998 8.5 8.5 0 1 0 9.039 9.039.999.999 0 0 0-1-1.066h.002Z"/>
<path d="M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z"/>
</svg>
<h2 class="ml-3 text-gray-700">Dashboard</h2>
</router-link>
</li>
<li>
<router-link :to="{ name: 'admin_users' }" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100 group">
<svg class="flex-shrink-0 w-8 h-8 text-gray-500 transition duration-75 group-hover:text-gray-900" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18">
Expand Down
2 changes: 0 additions & 2 deletions QuizzBattle/front/src/components/SurveyModalForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@
<script>
import { onMounted, ref } from 'vue'

import axios from 'axios'

import { API_URL } from '@/constants'

import client from '../helpers/client'
Expand Down
4 changes: 2 additions & 2 deletions QuizzBattle/front/src/components/Surveys.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ import {onMounted, reactive} from 'vue';
import axios from 'axios';
import {API_URL} from "@/constants";
const surveys = reactive([]);
import { RouterLink } from 'vue-router';
import SurveyModalForm from "@/components/SurveyModalForm.vue";
import client from '../helpers/client'

onMounted(() => {
axios.get(`${API_URL}/api/category/`, {
client.get(`${API_URL}/api/category/`, {
headers: {
Authorization: `Bearer ${localStorage.getItem('token')}`
},
Expand Down
2 changes: 1 addition & 1 deletion QuizzBattle/front/src/components/UserStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
:key="stats.id"
:style="{ display: stats.userObtain ? 'initial' : 'hidden' }"
>
<img :src="`/src/assets/badges/${stats.image}`" class="w-24" />
<img :src="`/assets/badges/${stats.image}`" class="w-24" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion QuizzBattle/front/src/constants/files.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const FILE_PATHS = {
profilePictures : "/src/assets/uploads/profile/",
categoryPictures: "/src/assets/images/categories/",
emotes: '/src/assets/images/emotes/'
emotes: '/assets/images/emotes/'
}

export default FILE_PATHS
9 changes: 0 additions & 9 deletions QuizzBattle/front/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,6 @@ const router = createRouter({
component: () => import('../views/ScoreboardView.vue')
},
//BackOffice / Admin
{
path: '/admin/dashboard',
name: 'admin_dashboard',
// route level code-splitting
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import('../views/admin/HomeView.vue')
// beforeEnter: roleCheckMiddleware // Appliquer le middleware seulement pour la route admin
},
{
path: '/admin/users',
name: 'admin_users',
Expand Down
2 changes: 1 addition & 1 deletion QuizzBattle/front/src/views/Badges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:key="stats.label"
:style="{ backgroundColor: stats.userObtain ? 'violet' : '#71717154' }"
>
<img :src='`/src/assets/badges/${stats.image}`'>
<img :src='`/assets/badges/${stats.image}`'>
<h2>{{stats.label}}</h2>
<v-progress-linear v-if="stats.gamesNeeds"
:model-value="`${gameStats.totalGamesPlayed / stats.gamesNeeds * 100}`"
Expand Down
2 changes: 1 addition & 1 deletion QuizzBattle/front/src/views/StartQuizz.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<v-slide-group>
<v-slide-group-item v-for="(category, key) in categories" :key="category">
<QuizzCard @click="startGameWithCategory(category.name)" class="ma-2" :title="category.name"
:text="category.description" :image="`${FILE_PATHS.categoryPictures}${category.image_url}`" :categoryId="category.id" />
:text="category.description" :image="`${API_URL}/uploads/${category.image_url}`" :categoryId="category.id" />
</v-slide-group-item>
</v-slide-group>
</v-sheet>
Expand Down
11 changes: 6 additions & 5 deletions QuizzBattle/front/src/views/WaitingGameView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ arrow_back
</div>
<div class="flex flex-col mt-10">

<Card v-if="category" :name="category.name" :image="`${FILE_PATHS.categoryPictures}${category.image_url}`"/>
<Card v-if="category" :name="category.name" :image="`${API_URL}/uploads/${category.image_url}`"/>
<v-progress-circular class="spinner"
:size="70"
:width="7"
Expand All @@ -25,14 +25,15 @@ import {
onMounted,
ref
} from 'vue'
import socket from "./../config/socket"

import { useRoute } from 'vue-router'
import client from './../helpers/client'

import { userManagerKey } from '@/contexts/userManagerKeys'

import Card from '../components/Card.vue'
import socket from '../config/socket'
import { API_URL } from '../constants/index'
import { FILE_PATHS } from '../constants/files'
import { userManagerKey } from '@/contexts/userManagerKeys';
import client from '../helpers/client'

const route = useRoute();
const category = ref("")
Expand Down
2 changes: 1 addition & 1 deletion QuizzBattle/front/src/views/admin/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Stats from "@/components/Stats.vue";
<template>
<main>
<Sidebar />
<Stats />
<DataTable />
</main>
</template>