Skip to content

Commit

Permalink
Release v1.0.0-alpha.3 (#10)
Browse files Browse the repository at this point in the history
* update package

* update gitignore

* add prisma

* add user service

* add auth service

* add password encryption

* implement login route

* add auth guard

* remove test files

* add dotenv package

* add jwt generation

* add jwt guard with profile controller

* add profile site

* improve code style with prettier

* remove hello worlds

* add helmet

* add vue framework

* connect vue to nest

* add css

* add login route

* add logger middleware + loggin route

* update package

* add catch for duplicate user registration

* implement submit method

* make login and registerView more dynamic

* hotfix

* update prisma schema

* update structure

* generate Movie db service

* add env tmp

* update movie relation and service

* create movie route and add imdb package

* hotfix

* implement GET movie:id

* fix auth bugs

* add info

* implement POST movie

* add try catch

* implement GET movie/all

* implement movie table

* add client profile

* client: add movie add button

* prisma: add vote table

* backend: edit structure

* backend: add vote boilerplate

* edit structure

* backend: implement POST vote

* db: improve naming

* backend: add DELETE Vote

* backend: add GET vote

* update vote output

* update proposer output

* update package

* Client: implement client-side state management to react on loading and logged_in

* client: add history view

* client: improve movie component table

* backend: update route GET movie/all

* client: display movie votes

* client: implement vote

* client: implement router logout

* BD: add "name" attribute to userDB

* backend: remove middleware from auth

* backend: implement email confirm

* common: update env tmp

* client: add privacy

* client: hot fix

* client: hot fix

* client: add AlertComponent.vue

* backend: update movie information

* backend: implement movie delete

* client: implement delete own movie

* client: implement form validation

* common: add port configuration

* client: add vertical scrolling in movie table

* client: rename page title

* client: add regex to imdb upload

* client: outsource api call

* client: hotfix

* backend: fix initial interest (now server handled instead of client handled)

* backend: restrict unvoting for own proposed movie

* client: implement triggerable alert components

* common: implemented client warnings on auth

* common: implemented better version of client warnings on auth

* client: style hotfix

* common: update README.md

* client: add GitHub Link

* client: update login regex + add password confirm

* client: create e-mail verified page

* client: edit plugin structure

* client: hot fix

* client: hot fix

* client: implement profile page style

* client: divide form inputs into separate components

* client: text improve

* client: hotfix

* client: hotfix

* client: change route api/profile to api/user

* backend: update auth (outsource password service + reduce payload to user_id)

* backend: implemented user routes for self-management of own account

* client: add profile options + implement get all user data

* backend: add gravatar generation

* client: add api logic to profile

* backend: allow gravatar in helmet

* backend: implement md5 hash algorithm

* client: add logic to delete account

* backend: outsource gravatar in a service + update gravatar url on email change

* update README.md

* prisma: Update database model to support history and watchlist

* backend: add event service

* backend: add job schedule structure

* backend: add db infrastructure for history and watchlist model

* backend: implement get_most_voted in vote db

* backend: add event module

* backend: implement watchlist job

* backend: implement history job

* backend: add routes GET movie/watchlist & movie/history

* client: movie ts folder in components folder to util folder in src + add CardComponent

* backend: add start_time to watchlist

* backend: restrict deleting watchlist movies

* client: hotfix

* client: update favicon

* backend: hotfix

* backend: update GET watchlist information

* common: improve packages

* client: create TableComponent to outsource tables

* client: add watchlist

* client: implement history view

* backend: implement GET public user information

* backend: hotfix

* client: implement watchlist interested feature

* client: replace bad emojis with cool svg

* client: add trash icon

* backend: replace node-schedule with @nest/schedule

* client: hotfix

* backend: restrict user deletion, when proposed video is in watchlist + restrict already watched movies

* client: alerts now shown when adding a movie

* client: alerts now shown when deleting a movie
  • Loading branch information
EliasSchaut committed Nov 21, 2022
1 parent 4c6e26d commit 351d866
Show file tree
Hide file tree
Showing 52 changed files with 664 additions and 80 deletions.
6 changes: 6 additions & 0 deletions .env.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ PROJECT_NAME="Movie-Monday-Manager"
FRONTEND_URL="http://localhost:3000/"
PORT="3000"

SCHEDULE_WATCHLIST="0 15 * * 1"
SCHEDULE_START="0 19 * * 1"
SCHEDULE_HISTORY="45 23 * * 1"
PAUSE_TIME_MIN="15"
NUM_OF_MOVIES="2"

DATABASE_URL="file:./dev.db"
JWT_SECRET="secret"
JWT_EXPIRATION="2h"
Expand Down
1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"devDependencies": {
"@types/jquery": "^3.5.14",
"@types/bootstrap": "^5.2.6",
"@types/bootstrap-table": "^1.12.0",
"@types/node": "^16.11.47",
"@vitejs/plugin-vue": "^3.0.1",
"@vue/tsconfig": "^0.1.3",
Expand Down
Binary file modified client/public/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions client/src/assets/svg/heart-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/src/assets/svg/heartbreak-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/src/assets/svg/person-hearts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/src/assets/svg/trash-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions client/src/components/HistroyComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<TableComponent id="table_history" :head="head">
<tr v-for="movie in history">
<td>{{ (new Date(movie.watched_at)).toLocaleDateString() }}</td>
<td><a :href="movie.link" target="_blank">{{ movie.title }}</a></td>
</tr>
</TableComponent>
</template>

<script lang="ts">
import TableComponent from "@/components/util/TableComponent.vue";
import { ref } from "vue";
import { call } from "@/util/api";
export default {
name: "HistroyComponent",
components: { TableComponent },
data() {
return {
head: ["Watched At", "Title"]
}
},
setup() {
const history = ref([]);
call("/api/movie/history")
.then((data) => {
history.value = data;
});
return {
history
}
}
};
</script>

<style scoped>
#table_history {
width: 90vw;
margin: 20px auto;
}
</style>
2 changes: 1 addition & 1 deletion client/src/components/LoginComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script lang="ts">
import router from "@/router/router";
import { call } from "@/components/ts/api";
import { call } from "@/util/api";
import PasswordComponent from "@/components/util/form/PasswordComponent.vue";
import EmailComponent from "@/components/util/form/EmailComponent.vue";
import NameComponent from "@/components/util/form/NameComponent.vue";
Expand Down
29 changes: 22 additions & 7 deletions client/src/components/MovieComponent.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<WatchlistComponent />
<div class="main table-responsive">
<table class="table table-striped table-bordered table-active" >
<thead>
Expand All @@ -24,13 +25,13 @@
<td><p>{{ movie.votes }}</p></td>
<td>
<button v-if="store.logged_in && movie.proposer_id === user_id" :id="'v_' + movie.imdb_id" class="btn btn-danger" @click="delete_media(movie.imdb_id)" :disabled="!store.logged_in">
<i class="fas fa-edit">X</i>
<img class="fas fa-edit" src="../assets/svg/trash-fill.svg" alt="trash">
</button>
<button v-else-if="votes.includes(movie.imdb_id)" :id="'v_' + movie.imdb_id" class="btn btn-primary" @click="unvote(movie.imdb_id)" :disabled="!store.logged_in">
<i class="fas fa-edit">👍</i>
<img class="fas fa-edit" src="../assets/svg/heart-fill.svg" alt="heart">
</button>
<button v-else :id="'v_' + movie.imdb_id" class="btn btn-outline-primary" @click="vote(movie.imdb_id)" :disabled="!store.logged_in">
<i class="fas fa-edit">👍</i>
<img class="fas fa-edit" src="../assets/svg/heartbreak-fill.svg" alt="heartbreak">
</button>
</td>
</tr>
Expand Down Expand Up @@ -67,16 +68,18 @@
</template>

<script lang="ts">
import { store } from './ts/store'
import { ref } from "vue";
import { call } from "@/components/ts/api";
import { store } from '@/util/store'
import { call } from "@/util/api";
import router from "@/router/router";
import WatchlistComponent from "@/components/WatchlistComponent.vue";
export default {
name: "MovieComponent",
data() {
return { store }
},
components: { WatchlistComponent },
setup() {
let movies = ref([] as any[]);
let votes = ref([] as any[]);
Expand Down Expand Up @@ -109,11 +112,23 @@ export default {
const imdb_id = form.get("imdb_id") as string
call(form_html.action + imdb_id, "POST")
.then(() => router.go(0))
.then((data) => {
if (data.hasOwnProperty("statusCode")) {
form_html.setAttribute("data-bs-dismiss", "modal");
form_html.click()
form_html.removeAttribute("data-bs-dismiss");
} else {
router.go(0)
}
})
},
delete_media(imdb_id: string) {
call("api/movie/" + imdb_id, "DELETE")
.then(() => router.go(0))
.then((data) => {
if (!data.hasOwnProperty("statusCode")) {
router.go(0)
}
})
},
vote(imdb_id: string) {
call("api/vote/" + imdb_id, "POST")
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/NavbarComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</template>

<script lang="ts" setup>
import { store } from './ts/store'
import { store } from '@/util/store'
</script>

<script lang="ts">
Expand Down
21 changes: 9 additions & 12 deletions client/src/components/ProfileComponent.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<div id="card_profile" class="card text-center">
<div class="card-header">
Profile
</div>
<div class="card-body d-flex flex-column justify-content-between">
<CardComponent id="card_profile" header="Profile">
<div class="d-flex flex-column justify-content-between">
<div class="mb-3">
<img v-if="user.use_gravatar" class="card-img-top" :src="user.gravatar_url" alt="Profile Picture" id="profile_picture">
<img v-else class="card-img-top" src="../assets/img/Portrait_Placeholder.png" alt="Placeholder Picture" id="profile_picture">
Expand All @@ -22,17 +19,15 @@
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modal_change_password">Change Password</button>
</div>
</div>
<div class="card text-center">
<div class="card-header">
Options
</div>

<CardComponent header="Options" nobody>
<ul class="list-group list-group-flush">
<li class="list-group-item"><a @click.prevent="get_user_data" href="">Get all user data</a></li>
<li class="list-group-item"><a @click.prevent="" data-bs-toggle="modal" data-bs-target="#modal_delete_account" style="color: red" href="">Delete account</a></li>
</ul>
</div>
</CardComponent>
</div>
</div>
</CardComponent>

<!-- Modal: Change Profile -->
<ModalComponent id="modal_profile" title="Edit Profile">
Expand Down Expand Up @@ -79,7 +74,7 @@
</template>

<script lang="ts">
import { call } from "@/components/ts/api";
import { call } from "@/util/api";
import PasswordComponent from "@/components/util/form/PasswordComponent.vue";
import ModalComponent from "@/components/util/ModalComponent.vue";
import SubmitComponent from "@/components/util/form/SubmitComponent.vue";
Expand All @@ -88,11 +83,13 @@ import NameComponent from "@/components/util/form/NameComponent.vue";
import InputComponent from "@/components/util/form/InputComponent.vue";
import { ref } from "vue";
import router from "@/router/router";
import CardComponent from "@/components/util/CardComponent.vue";
const user = ref({})
export default {
name: "ProfileComponent",
components: {
CardComponent,
InputComponent,
NameComponent,
EmailComponent,
Expand Down
86 changes: 86 additions & 0 deletions client/src/components/WatchlistComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<template>
<CardComponent v-if="watchlist.length > 0" id="watchlist" header="Watchlist">
<TableComponent :head="head">
<tr v-for="movie in watchlist">
<td>{{ (new Date(movie.start_time)).toLocaleString() }}</td>
<td><a :href="movie.link" target="_blank">{{ movie.title }}</a></td>
<td>
<button class="btn btn-primary" @click="interested(movie.interested)"
data-bs-target="#modal_watchlist" data-bs-toggle="modal">
<img src="../assets/svg/person-hearts.svg" alt="Heart" />
</button>
</td>
</tr>
</TableComponent>
</CardComponent>

<ModalComponent id="modal_watchlist" title="Interested">
<TableComponent :head="head_modal">
<tr v-for="user in interested_local">
<td><img v-if="user.use_gravatar" :src="user.gravatar_url" alt="avatar" class="profile" />
<img v-else src="../assets/img/Portrait_Placeholder.png" alt="placeholder_avatar" class="profile" /></td>
<td>{{ user.name }}</td>
</tr>
</TableComponent>
</ModalComponent>
</template>

<script lang="ts">
import CardComponent from "@/components/util/CardComponent.vue";
import TableComponent from "@/components/util/TableComponent.vue";
import ModalComponent from "@/components/util/ModalComponent.vue";
import { call } from "@/util/api";
import { ref } from "vue";
const interested_local = ref([] as any);
export default {
name: "WatchlistComponent",
components: { TableComponent, CardComponent, ModalComponent },
data() {
return {
head: ["Start", "Title", "Interested"],
head_modal: ["Profile", "Name"],
interested_local: interested_local
};
},
setup() {
const watchlist = ref([]);
call("/api/movie/watchlist")
.then((data) => {
watchlist.value = data;
});
return {
watchlist
};
},
methods: {
interested(user_ids: number[]) {
interested_local.value = [];
for (const user_id of user_ids) {
call(`/api/user/${user_id}`)
.then((data) => {
interested_local.value.push(data);
});
}
}
}
};
</script>

<style scoped>
#watchlist {
width: min(90vw, 800px);
margin: 20px auto;
}
#modal_watchlist {
font-size: larger;
}
.profile {
width: 40px;
height: 40px;
border-radius: 50%;
}
</style>
2 changes: 1 addition & 1 deletion client/src/components/alert/AlertComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<script setup lang="ts">
import { store } from "@/components/ts/store";
import { store } from "@/util/store";
import AlertInfoComponent from "@/components/alert/AlertInfoComponent.vue";
import AlertDangerComponent from "@/components/alert/AlertDangerComponent.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/alert/AlertDangerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup lang="ts">
import { store } from "@/components/ts/store";
import { store } from "@/util/store";
import warn_svg from "@/assets/svg/exclamation-triangle-fill.svg";
</script>

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/alert/AlertInfoComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup lang="ts">
import { store } from "@/components/ts/store";
import { store } from "@/util/store";
import info_svg from "@/assets/svg/info-circle-fill.svg";
</script>

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/alert/AlertSuccessComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup lang="ts">
import { store } from "@/components/ts/store";
import { store } from "@/util/store";
import check_svg from "@/assets/svg/check-circle-fill.svg";
</script>

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/alert/AlertWarningComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup lang="ts">
import { store } from "@/components/ts/store";
import { store } from "@/util/store";
import warn_svg from "@/assets/svg/exclamation-triangle-fill.svg";
</script>

Expand Down
Loading

0 comments on commit 351d866

Please sign in to comment.