Skip to content

Mobistudy/MobistudyWeb

Repository files navigation

Mobistudy Web

This repository contains the frontend of the Mobistudy web server. The frontend is developed as a single-page app using the quasar framework.

Pre requisites

You need to install the following on your system:

In order to guarantee that the same version of node is used across developers, it is recommendable to use nvm and run nvm install && nvm use to switch to the node version used in this project.

Install all dependencies with npm install.

Run

To start the interface, run npm run dev or, if you have installed the quasar cli, quasar dev. You will need the MobistudyAPI running in parallel (see MobistudyAPI README).

Test

npm run test:unit

If you want to have quasar and the tests running in parallel and watching for code changes:

npm run concurrently:dev:jest

Develop

The code is written mostly in ES6 and uses ES6 modules, please be consistent. If you use VS Code, follow the recommended settings from Quasar.

Folders follows this structure:

project
└───public                  // static assets, images, icons etc.
└───src                     // application code
│   └───assets              // static assets that need to be included in the source code by webpack
│   └───boot                // Vue plugins
│   └───components          // Vue components
│   │   └───admin           // Vue components for the admin user
│   │   └───researcher      // Vue components for the researcher
│   │   └───usermgmt        // Vue components for general user/account management
│   └───css                 // css used throughout the web interface
│   └───i18n                // internationalised text
│   │   └───en              // English text
│   │   └───sv              // Swedish text
│   │   └───es              // Spanish text
│   └───mixins              // Vue mixins
│   └───router              // Vue router and routes
│   └───shared              // shared functions, objects and services
└───test                    // automatic tests and experiments
    └───jest                // jest tests and config
        └───__tests__       // unit tests specs

Run npm run dev to start a self-served web interface, but first have the API running and exposed at port 3000. To run automatic tests: npm run test and to run tests and develop at the same time: npm run dev:test.

Deploy

Run quasar build. This will generate the material UI interfaces and make it available under ./dist/

Docker

This only explains how to build and run the Docker instance of this project. For the full setup including database and web interface, see the Wiki.

Build the docker instance:

docker build -t mobistudyweb .

Then run it with:

docker run -d -p 80:80 --name mobistudyweb mobistudyweb

This will launch an ngnix instance that serves the static content, but not the API. You will need the API running as well!

Credits

Original idea: Dario Salvi and Carmelo Velardo.

Coordination: Dario Salvi and Carl Magnus Olsson.

Development:

License

See license file