Go to file
Roeland Jago Douma c59cfeb18a
Make sure to render as public if the user is not logged in
Else we will render the apps, contacts menu etc. Which is undesireable.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-06-27 19:20:28 +02:00
.tx initial commit 2019-05-13 19:15:45 -04:00
appinfo fix typo 2019-05-28 21:13:54 -04:00
css Version 1.0.3 2019-05-14 03:03:59 -04:00
img Add new app icon, fix #13 2019-06-12 17:58:47 +02:00
js Version 1.0.3 2019-05-14 03:03:59 -04:00
l10n deleted *.json localization files 2019-05-28 22:13:17 -04:00
lib Make sure to render as public if the user is not logged in 2019-06-27 19:20:28 +02:00
screenshots Added screenshots for app 2019-05-28 21:12:54 -04:00
src/js Version 1.0.3 2019-05-14 03:03:59 -04:00
templates Version 1.0.3 2019-05-14 03:03:59 -04:00
tests Version 1.0.3 2019-05-14 03:03:59 -04:00
.babelrc.js initial commit 2019-05-13 19:15:45 -04:00
.editorconfig initial commit 2019-05-13 19:15:45 -04:00
.eslintrc.js initial commit 2019-05-13 19:15:45 -04:00
.gitignore initial commit 2019-05-13 19:15:45 -04:00
.l10nignore Version 1.0.3 2019-05-14 03:03:59 -04:00
.scrutinizer.yml initial commit 2019-05-13 19:15:45 -04:00
.travis.yml initial commit 2019-05-13 19:15:45 -04:00
_config.yml initial commit 2019-05-13 19:15:45 -04:00
CHANGELOG.md initial commit 2019-05-13 19:15:45 -04:00
composer.json initial commit 2019-05-13 19:15:45 -04:00
COPYING initial commit 2019-05-13 19:15:45 -04:00
Forms_Support.md update forms_support 2019-05-14 03:18:20 -04:00
ISSUE_TEMPLATE.md initial commit 2019-05-13 19:15:45 -04:00
LICENSE Initial commit 2019-05-13 01:53:28 -04:00
Makefile Version 1.0.3 2019-05-14 03:03:59 -04:00
package.json Version 1.0.3 2019-05-14 03:03:59 -04:00
phpunit.integration.xml initial commit 2019-05-13 19:15:45 -04:00
phpunit.xml initial commit 2019-05-13 19:15:45 -04:00
README.md Update README.md 2019-05-14 03:52:50 -04:00
webpack.common.js initial commit 2019-05-13 19:15:45 -04:00
webpack.dev.js initial commit 2019-05-13 19:15:45 -04:00
webpack.prod.js initial commit 2019-05-13 19:15:45 -04:00

Forms

Forms allows the creation of shareable forms, with multiple question types and privacy settings.

Note: This app is tested with Apache2 webserver, MySQL database, and apt-get package manager. To use alternatives, replace the relevant commands with those of your technology. This document assumes that a working NextCloud development environment has been installed. See https://docs.nextcloud.com/server/stable/developer_manual/general/devenv.html for help with this.

Installation

Download the Forms Codebase

$ cd /var/www/html/nextcloud/apps
$ git clone https://github.com/affan98/forms.git

Note: This will be moved to https://github.com/nextcloud/forms.git once the app has been accepted to the NextCloud app store

Install Prerequisites and Dependencies

Install NPM

$ apt-get npm

Install Yarn

$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
$ apt update
$ apt install yarn

Update NodeJS

$ npm install -g n
$ n stable

Build the App

$ cd /var/www/html/nextcloud/apps/forms
$ make all

Start Webserver / Database

$ service apache2 start
$ service mysql start

Enable the App

  • Open NextCloud in your browser of choice
  • Click on the user icon in the top right of the screen, and select Apps from the drop down menu
  • Find the Forms app in the list and click enable
  • The app will now be fully functional! The forms icon will appear on the top toolbar of NextCloud after it has been enabled

To Rebuild

$ cd /var/www/html/nextcloud/apps/forms
$ npm run build
$ service Apache2 restart
$ service mysql restart

Refresh the page in your browser to reflect the changes.

Code Overview

The following are the most important code files for development of the Forms App. Note: all paths are relative to nextcloud/apps/forms/

  • lib/Controller/apiController.php: The main API of the application. The functions defined in this file are called from http requests, and interface with the database

  • lib/Controller/pageController.php: Passes objects between screens

  • lib/Db/: All the files where database entities are defined and SQL queries are written. Mapper files define functions that retrieve data from the database

  • src/js/

    • Main.js: where Vue app is created
    • App.vue: The root component for the vue app
    • Router.js: Defines URLs that can be navigated to from the Vue app
  • src/js/components/

    • formsListItem.vue: Defines the list items (created surveys) within the forms app home page
    • quizFormItem.vue: Questions (for any survey) are defined as a quizFormItem here
  • src/js/views/

    • Create.vue: File where survey creation page is handled

    • List.vue: File where list of created surveys is handled (located on the forms app home page)

    • Results.vue: File where page that displays survey results is handled

    • appinfo/routes.php: Defines server endpoints that can be accessed by the client

  • /js/vote.js: File that contains the logic for the response page and responding to a form

  • /css/vote.scss: File that contains CSS formatting for the response page

  • /templates/vote.tmpl.php: File that contains the form template that is dynamically populated by the database