Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

MaximMaximS/TheQuoter

Repository files navigation

The Quoter GitHub package.json version CodeFactor Grade GitHub commit activity

TheQuoter (also known as "Hláškomat") is will be server application for storing and viewing quotes (or rather, funny catchphrases). It was made for a school environment, but that may be subject to change (probably not since that would mean a lot of work).

Roles and permissions

Roles

Role Description
admin Manager of the database, accepts global quotes
moderator Can accept quotes from their own class, and moderates them
user Member of a class, can submit quotes globally or for their class
guest Can view only global quotes, but cannot submit any, can request to join a class

Permissions

Users

These permissions aren't implemented yet.

Role View Promote to user Remove from class
admin
moderator Same class Same class Same class
Themself

Quotes

Symbol Meaning
P Public
W Pending
S Same class (as the user)
N No class
O Own (Means user's existing)
A Any
X None
Role Create View Edit Publish Delete
admin A A A A A
moderator PS, WN P(S, N), W(S, O) W(S, O) WS W(S, O)
user W(S, N) P(S, N), WO WO X WO
guest X PN X X X

Classes

Role View Modify
admin
Others

People

Role View Modify
admin
Others

Usage

Be aware that the application is not yet fully functional.

Before you can use the application, you need to have a MongoDB cluster running.

Env configuration:

# Configure theses variables to your liking
RATELIMIT_WINDOW_MS=60000
RATELIMIT_DELAY_AFTER=10
RATELIMIT_DELAY_MS=500
RATELIMIT_MAX=20

MONGODB_URI=<URI>
JWT_SECRET=<RANDOM> # Replace with a random string

PORT=<PORT>

Docker

# Use the tag from the badge above without the `v`
docker pull maximmaxims/thequoter:<TAG>
docker run -p 3000:<PORT> --env-file ".env" maximmaxims/thequoter:<TAG>

Manually

git clone https://github.com/MaximMaximS/TheQuoter.git
cd TheQuoter
npm install --omit=dev --ignore-scripts
npm run build
npm run start