Skip to content

Commit

Permalink
Release v1.0.0-alpha.5 (#29)
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

* client: make tables responsive

* client: hotfix

* backend: hotfix password reset

* backend: email send now html instead of text

* backend: add route GET auth/reset/:username to send a pw reset request + add pw reset flag in db

* backend: add route POST auth/reset/:username to reset password via challenge

* backend: change challenge url for pw reset

* client: edit structure (replace some components with views)

* client: add ResetRequestView

* backend: hotfix

* client: create FormComponent and outsource Form from ResetViews

* client: Outsource form from Login and Register

* client: edit component structure

* client: add router link to reset page in login view

* client: remove bootstrap-table in plugins folder for now

* backend: implement discord.service for sending messages to a webhook + create announce job to sende invites to endpoints like discord

* backend: add notify opt in value for users + logic to notify every opt-in user

* backend: add route POST email_opt_in

* client: add profile option email_opt_in

* backend: emails now only send via text instead of html

* client: import cookie library and create cookie util

* client: replace localstorage with cookie

* Bump qs and formidable

Bumps [qs](https://github.com/ljharb/qs) and [formidable](https://github.com/node-formidable/formidable). These dependencies needed to be updated together.

Updates `qs` from 6.9.3 to 6.10.3
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.9.3...v6.10.3)

Updates `formidable` from 2.0.1 to 2.1.1
- [Release notes](https://github.com/node-formidable/formidable/releases)
- [Changelog](https://github.com/node-formidable/formidable/blob/master/CHANGELOG.md)
- [Commits](https://github.com/node-formidable/formidable/commits)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
- dependency-name: formidable
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* backend: add compodoc package + run doc script + ignore docs folder

* backend: implemented some params

* types: implemented types for user controller

* backend: edit structure

* backend: add PUBLIC/PRIVATE desc in docs

* docs: add docs to movie controller

* types: add MovieAll type

* types: add types for movie controller

* types: improve names

* types: add types and docs for vote controller

* backend: hotfix

* build: add build:all script to fully build all project components

* build: hotfix

* build: add lots of build scripts

* common: update README.md

* common: update README.md

* client: add docs link in navbar

* types: add types and doc to auth controller

* common: add start:doc run script

* common: update README.md

* common: update README.md

* common: edit .env.tmp file

* common: replace dotenv package with @nestjs/config

* common: serve docs in route /docs

* client: add docs to navbar

* common: rename doc scripts to docs script

* backend: fix role ping bug

* common: edit env file

* common: add config schema validation

* common: add description to config.validation.ts

* common: update README.md

* common: hotfix package

* backend: add patterns and use them for various input validation

* client: improve client patterns

* backend: close issue #11

* common: add env value MAX_PROPOSED_MOVIES with its functionality to restrict the maximum proposeable movies per user + improve MAX_VOTES feedback

* common: rename env var

* backend: add api documentation with swagger + update dtos to classes

* backend: add route descriptions for swagger

* client: add doc view for the different documentations

* backend: small improvements for swagger

* update README.md

* common: update version

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
EliasSchaut and dependabot[bot] committed Dec 12, 2022
1 parent 52d4a5c commit 8d2db8f
Show file tree
Hide file tree
Showing 57 changed files with 13,858 additions and 6,957 deletions.
16 changes: 9 additions & 7 deletions .env.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@ PROJECT_NAME="Movie-Monday-Manager"
FRONTEND_URL="http://localhost:3000/"
PORT="3000"

DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/ID/TOKEN
DATABASE_URL="file:./dev.db"
JWT_SECRET="secret"
JWT_EXPIRATION="2h"
OMDB_API_KEY="XXXXXXXX"
MAX_VOTES="20"
MAX_PROPOSEABLE_MOVIES="5"

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"
OMDB_API_KEY="XXXXXXXX"
MAX_VOTES="2"

EMAIL_HOST="smtp.example.com"
EMAIL_PORT="587"
EMAIL_HOST_USER="noreply@example.com"
EMAIL_HOST_PASSWORD="XXXXXXXXX"

DISCORD_ENABLE="false"
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/ID/TOKEN
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ lerna-debug.log*
# Prisma
/prisma/migrations
dev.db*
*.env
*.env

# Docs
/docs
69 changes: 52 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,61 @@
![](https://img.shields.io/github/license/EliasSchaut/Movie-Monday-Manager)

# Movie Monday Manager
A full stack management application for voting movies for weekly movie events.
A full stack management application for voting movies for cyclic movie events.

## Features
- Account-registration with email verification
- Users can vote, add and remove movies
- Users can manage own profile
- Clean and responsive Bootstrap-UI
- 100% useable without client (via REST-API)
- **(soon)** automatic management of voted movies around movie events
- **(soon)** automatic notifications for movie events with the list of interested users
- account-registration with email verification
- users can vote, add and remove movies
- users can manage own profile
- clean and responsive Bootstrap-UI
- 100% usable without client (via REST-API)
- automatic management of voted movies around movie events
- automatic notifications for movie events with the list of interested users

## Installation
1. You need [node.js](https://nodejs.org/en/) installed (version 18.12.1 or newer).
2. Download the [newest version](https://github.com/EliasSchaut/Movie-Monday-Managerreleases) of the code
2. Download the [newest version](https://github.com/EliasSchaut/Movie-Monday-Manager/releases) of the code
3. Rename the .env file from ```.env.tmp``` to ```.env```
4. Open the configuration file (now ```.env```) and set values.
5. In ```client``` folder: run ```npm install``` and ```npm run build```
6. In ```prisma``` folder: run prismas ```migrate``` command (e.g. ```prisma migrate dev --name init```)
7. In root folder: `npm install`.
8. Run the server with `npm start`.

## Dev-Docs & API-Docs
This documentation is still work in progress.
4. Open the configuration file (now ```.env```) and set values (see [config-section](#configuration) below).
5. Build the project with ```npm run build:all```
6. Run the server with ```npm run start:prod```

## Configuration
The configuration file is located in the root directory of the project and is called ```.env```. It will be validated on startup via the [Joi](https://joi.dev/) library. To see the validation schema, see the [config.validation.ts](./src/common/validation/config.validation.ts) file.

## API-Docs
This project is 100% usable without client via a REST-API!
The routes start with the prefix ```/api``` (e.g. `http://[::1]:3000/api`).
The api is documented with [Swagger](https://swagger.io/) at ```/docs/api``` route of the website (e.g. `http://[::1]:3000/docs/api`).

## Dev-Docs
This small guide assumes, that you have already some knowledge about node.js and the used frameworks.
The whole project is written in [Typescript](https://www.typescriptlang.org/).

### MoMoMat (Backend)
The backend uses the [NestJS](https://nestjs.com/) framework to handle the REST-API with all its corresponding services. It is also documented with [compodoc](https://compodoc.app/) at ```/docs/backend``` route of the website (e.g. `http://[::1]:3000/docs/backend`).
This project (`/src` folder) is dived into 3 main parts:
The routes (controllers) to handle incoming requests;
a common section with lots of usefully functions and classes to support the other parts;
and type definitions for internal data structures and data transmission objects (dto's).

To run the backend in development mode, you need to `npm install` the dependencies and run ```npm run start:dev``` in the root folder of the project. Note, that the client has to be built via `npm run build:client` because the client is only statically served from the `/client/dist` folder. So every change in the client has to be built to show up in the backend project. Also note, that the database should also be built (see `MoMoMat-DB` below). The backend can generate docs as static website by run `npm run build:docs` and shown by `npm run start:docs`. The backend itself can be build with `npm run build`. The build files are located in the `/dist` folder. The `npm run build:all` command can be used to build everything in with just one step.

### MoMoMat-Client (Frontend)
The frontend uses the [Vue.js](https://vuejs.org/) framework to handle the user interface.
It can be found in the `/client` folder.

The frontend uses the [Vue Router](https://router.vuejs.org/) defined in `/client/src/router` folder to handle the navigation between the different pages as singe page application.
The router shows different view components depending on the current route. These view components are defined in the `/client/src/views` folder. Some views use special components defined in the `/client/src/components` folder.

To run the client in development mode, you need to `npm install` the dependencies and run ```npm run dev``` in the `/client` folder.
But in this mode, the backend is disabled and the website cannot interact with any backend route.
To build the client for production, you need to run `npm run build` in the `/client` folder. The build files are located in the `/client/dist` folder.

### MoMoMat-DB (Database)
The database use [Prisma](https://www.prisma.io/) as ORM to handle the database connection and management.
Its database schema is defined in the ```/prisma``` folder.
Which database is used under the hood can be defined in the ```.env``` file.

The scheme can be formatted with ```npx prisma format``` in `/prisma` folder.
A database can be created via ```npx prisma migrate dev``` from `/prisma` folder or ```npm run build:db``` from root folder.
131 changes: 129 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "movie-monday-client",
"version": "0.0.0",
"version": "1.0.0-alpha.5",
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
Expand All @@ -13,6 +13,7 @@
"bootstrap-table": "^1.21.1",
"jquery": "^3.6.1",
"js-cookie": "^3.0.1",
"movie-monday-manager": "file:..",
"vue": "^3.2.37",
"vue-router": "^4.1.3"
},
Expand Down
3 changes: 3 additions & 0 deletions client/src/components/NavbarComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<li>
<router-link class="nav-link" to="/privacy">Privacy</router-link>
</li>
<li>
<router-link class="nav-link" to="/docs">Docs</router-link>
</li>
<li>
<a class="nav-link" href="https://github.com/EliasSchaut/Movie-Monday-Manager" target="_blank">GitHub</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/form/NameComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type="text"
placeholder="Max Mustermann"
name="name"
pattern="^[A-Z](.*)"
pattern="^[A-Z].{2,20}$"
:invalid_feedback="invalid_feedback"
required />
</template>
Expand All @@ -17,7 +17,7 @@ export default {
data() {
return {
label: "Name",
invalid_feedback: "Should start with a capital letter.",
invalid_feedback: "Must be between 3 and 20 characters and start with a capital letter!",
}
},
};
Expand Down
6 changes: 6 additions & 0 deletions client/src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import HistoryView from '../views/HistoryView.vue'
import PrivacyView from '../views/PrivacyView.vue'
import { store } from "@/util/store";
import { get_cookie, remove_cookie } from "@/util/cookie";
import DocsView from "@/views/DocsView.vue";

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
Expand Down Expand Up @@ -52,6 +53,11 @@ const router = createRouter({
path: '/privacy',
name: 'privacy',
component: PrivacyView
},
{
path: '/docs',
name: 'docs',
component: DocsView
}
]
})
Expand Down
28 changes: 28 additions & 0 deletions client/src/views/DocsView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<CardComponent header="Docs" id="card_docs" nobody>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a href="/docs/api" target="_blank">Api Docs</a>
</li>
<li class="list-group-item">
<a href="/docs/backend" target="_blank">Backend Docs</a>
</li>
</ul>
</CardComponent>
</template>

<script lang="ts">
import CardComponent from "@/components/CardComponent.vue";
export default {
name: "DocsView",
components: { CardComponent }
};
</script>

<style scoped>
#card_docs {
width: min(500px, 90vw);
margin: 20px auto
}
</style>
5 changes: 4 additions & 1 deletion nest-cli.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src"
"sourceRoot": "src",
"compilerOptions": {
"plugins": ["@nestjs/swagger"]
}
}
Loading

0 comments on commit 8d2db8f

Please sign in to comment.