You can find an Installationguide here
- arsnova-click.env - This file contains all environment variables for the arsnova-click backend
TWITTER_ENABLED
: Flag if the twitter polling should be enabled (default:false
)TWITTER_CONSUMER_KEY
: Consumer API Key from TwitterTWITTER_CONSUMER_SECRET
: Consumer API Key secret from TwitterTWITTER_ACCESS_TOKEN_KEY
: Access Token from TwitterTWITTER_ACCESS_TOKEN_SECRET
: Access Token secret from TwitterTWITTER_BEARER_TOKEN
: Bearer Token from Twitter. If a bearer token is provided access tokens will not be used (seehttps://developer.twitter.com/en/docs/basics/authentication/oauth-2-0/bearer-tokens
)TWITTER_SEARCH_KEY
: Key to search for tweets on Twitter (default:arsnova.click
)CHROMIUM_PATH
: Path to a local chromium instance (default:/usr/bin/chromium-browser
)MONGODB_SERVICE_NAME
: Hostname of the MongoDB (eg:mongodb
)MONGODB_DATABASE
: Database name (eg:arsnova-click-v2
)MONGODB_USER
: User with access to theMONGODB_DATABASE
MONGODB_PASSWORD
: Password of the user provided withMONGODB_USER
MONGODB_AUTH_SOURCE
: [Optional] The database of the auth dbLOG_LEVEL
: [Optional] Log level of the node process (eg:debug
)NODE_ENV
: [Optional] Node Environment (eg:development
)GITLAB_HOST
: [Optional] Host where to find the gitlab projects for frontend and backend (eg:https://git.thm.de
)GITLAB_TOKEN
: [Optional] Access Token for gitlab project to retrieve and parse i18n filesGITLAB_BACKEND_PROJECT_ID
: [Optional] Project ID where the backend i18n files are foundGITLAB_FRONTEND_PROJECT_ID
: [Optional] Project ID where the frontend i18n files are foundGITLAB_TARGET_BRANCH
: [Optional] Branch name of the frontend and backend project which will be used to consume the i18n files (default:master
)AMQP_HOSTNAME
: Hostname of the AMQP Server (eg:rabbitmq
)AMQP_USER
: User with access to the AMQP ServerAMQP_PASSWORD
: Password of the user provided byAMQP_USER
AMQP_VHOST
: (default:/
)AMQP_PROTOCOL
: Protocol for the connection (default:amqp
)AMQP_MANAGEMENT_API_PROTOCOL
(default:http:
);AMQP_MANAGEMENT_API_HOST
(default:AMQP_HOSTNAME
);AMQP_MANAGEMENT_API_PORT
(default:15672
);AMQP_MANAGEMENT_USER
(eg:AMQP_USER
);AMQP_MANAGEMENT_PASSWORD
(eg:AMQP_PASSWORD
);PROJECT_MAIL_ADDRESS
: [Optional] Mail Address for contacting the project owner (used by VAPID)VAPID_PUBLIC_KEY
: [Optional] Public VAPID key for web push notificationsVAPID_PRIVATE_KEY
: [Optional] Private VAPID key for web push notificationsARSNOVA_CLICK_BACKEND_BASE_PATH
: [Optional] Sets the path relative to the working directory which contains the appARSNOVA_CLICK_BACKEND_PORT_EXTERNAL
: [Optional] This is the external port used for rewriting the urls of cached quizzes (default:ARSNOVA_CLICK_BACKEND_PORT_INTERNAL
)ARSNOVA_CLICK_BACKEND_PORT_INTERNAL
: [Optional] This is the internal port used during the startup of the server (default: 3010)ARSNOVA_CLICK_BACKEND_ROUTE_PREFIX
: [Optional] The routePrefix is used to prefix the access of the Express routes. E.g if set to 'backend' the access to '/api/v1/myPath' will become '/backend/api/v1/myPath' (default:/
)ARSNOVA_CLICK_BACKEND_REWRITE_ASSET_CACHE_URL
: [Optional] This configuration is used as base endpoint for cached assets (default:http://${hostname()}:${ARSNOVA_CLICK_BACKEND_PORT_INTERNAL}${ARSNOVA_CLICK_BACKEND_ROUTE_PREFIX}
)LEADERBOARD_ALGORITHM [PointBased | TimeBased]
: [Optional] Sets the leaderboard algorithm which should be used (default:TimeBased
)
- mongo.env - Environment variables for bootstrapping the mongodb server
MONGO_INITDB_DATABASE
: Name of the initial database (default:arsnova-click-v2
)MONGO_INITDB_ROOT_USERNAME
: Initial root user nameMONGO_INITDB_ROOT_PASSWORD
: Password of the user provided byMONGO_INITDB_ROOT_USERNAME
- init-mongo.js - Initial MongoDB cli commands for bootstrapping the server (eg. create db user, database, insert default documents, ...)
- rabbitmq.env - Environment variables for bootstrapping the rabbitmq server
- eg: List of some commands someone posted at github
- Note that the default login of the rabbitmq docker image is
user:bitnami
- rabbitmq-plugins.txt - Textfile containing the plugin list for rabbitmq (The dot at the end is mandatory!)
Just running docker-compose up
should be everything required to run the server with its dependencies.
Note that the rabbitmq server is up approx. 1 minute after starting the container. The node app and the mongo db
are likely faster online. The node server tries to connect every 60 seconds to the rabbitmq so be patient if
the connection fails when starting the app.
Enter npm test
in the root directory to run the unit tests.
Note that since is uses a TypeScript runner for Mocha it is not required to build the server app before testing it.
Thus, the server gets started up during the test so the specified port must be available.
Currently the routing and the quiz export is covered by the tests.
The export unit test will generate a random filled Excel export file in the ${rootDir}/test-generated
folder.
For a local code style analysis with docker-compose you'll need docker and docker-compose installed. To run a local code style check with sonarqube, follow these steps:
- switch into the analysis folder
cd analysis
- start the sonarqube server
docker-compose up -d sonarqube
- when sonarqube has started, you may run analysis whenever you want with
docker-compose run --rm analysis
Enter npm run build:DEV
in the root directory to run the dev build.
Enter npm run build:PROD
in the root directory to run the prod build.
Db Migrations are performed when the application starts. However, they can also be triggered manually.
Run npm i -g migrate-mongo
and cd
into the db-migration
folder.
Then run migrate-mongo up
to perform the pending migrations.
Use migrate-mongo create [description]
to add a new migration.
- Required env variables:
MONGODB_DB_MIGRATION_CONN_URL
, egmongodb://user:pass@localhost:27017
MONGODB_DB_NAME
, egarsnova-click-v2
For more information check the migrate-mongo library on npmjs.com