Giter VIP home page Giter VIP logo

aladin's Introduction

ALADIN:

„Generator für Aufgaben und Lösung(shilf)en aus der Informatik und angrenzenden Disziplinen“

Aladin aims to be a progressive web app, which offers a platform to students of various disciplines of study, on that exam-relevant tasks can be generated in a choosen degree of difficulty and can be solved with additional help and instruction without the need of a physically present professor/research assistant.

Also the randomly generated tasks provide a discharge on the professors in terms of preparing exams.

The current state of the app is hosted here

The swagger api documentation can be found here

Prerequisites:

(optional but recommended)

Install/Setup

on local machine (requires a linux environment for the full featureset)

After installing all the prerequisites clone the repository into a local folder of your choice.

To install the dependencies for the backend and the frontend run the command npm install --save in the server and the frontend directory.

The server references a couple environment-variables that need to be setup as well. In order to do so, a .env-File has to be created in the server folder of the repository.

  • Example .env-File:
mongooseConnection=mongodb://<USER>:<PASSWORD>@<LOCATION>
sqlFlavour=sqlite
publicVapidKey=<PUBLIC_KEY>
privateVapidKey=<PRIVATE_KEY>
NODE_ENV=development
jwtSecret=<RANDOM_LONG_PASSWORD>

A JWT-secret can be generated via:

A vapid-key-pair signed to your email can be generated via:

The connection string for your local MongoDB-Instance should look similar to mongodb://127.0.0.1:27017/<NAME_OF_YOUR_DATABASE>

The standard SQL-Flavour used is SQLite3 which is why the existing databases are not version controlled in this repository due to size limitations. They can be downloaded here. Unpack the zip-archive into ./server/exercises/sql/database to provide data for the SQL-exercise.

If you would rather use another SQL-dialect/database you would need to expand the SQL-Adapter with an object providing the necessary functions and information, install the driver-package for node.js, as well as changing the sqlFlavour in the .env-File to the corresponding key you used. It would also be a good idea to extend the .env-File with a field for your SQL-connection-string and your password-string, which you can then access in your provided connection function.

via docker/docker-compose

This is the recommended way, since it eliminates unexpected behaviour due to different environments and OS. As of right now only the mongodb and the webserver are containerized, as the frontend is not susceptible to differing environments and comes already shipped with a development server due to being a vue application. To spin up the mongodb and webserver simply run docker-compose up in the root directory of the repository. The vue development server can be started by executing npm run serve in the frontend directory.
Injecting the environment variables still works via the .env file in the server directory. If the mongodb docker container is used the name of the container functions as the hostname that has to be used in the connection string.
E.g. mongodb://mongo_container

Running the app for development

In order to run the app for development purposes you would need two command line instances.

Backend

To run the server enter the server directory and execute npm run dev. This also hot-reloads the server on change. You could also run npm run start if you would like to disable this option or run the server.js in debug mode in the IDE of your choice. When using the docker option you can either use docker-compose or docker to build and start the backend container.
E.g. docker-compose up or docker run -p 3000:3000 server.

Frontend

In order to run the frontend for development navigate your command line to /frontend and execute npm run serve. In development CORS is allowed due to the applications running on different ports and the requests are being automatically proxied from the frontends :8080 port to the servers :3000 port. For adjustments check the vue.config.js in the /frontend directory and the server.js-file in the root directory.

Deployment

In order to deploy your changes on the frontend run the npm run build command in a terminal opened in the /frontend directory. This automatically deploys the compiled code to the /server/public folder. To adjust that referr to the outputDir-option in the /frontend/vue.config.js-file.

Since the current version is hosted on Heroku, which automatically serves a secure connection, there is no https-Server being deployed in the code. To provide a secure connection refer to this tutorial: https://flaviocopes.com/express-https-self-signed-certificate/

There also is a semi-automatic deployment-process, which is triggered by pushing changes to the deploy-branch of this repository.

Online Editor (for Code Reviews/Pair Programming)

Gitpod ready-to-code

Requires a free gitpod account and the setup of user-specific env variables to build and run the repository. See env-variables configuration on how to achieve that. The required variables are identical to the example in the readme.

aladin's People

Contributors

plc-dev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.