forms/README.md

84 lines
3.5 KiB
Markdown
Raw Normal View History

2020-02-28 11:34:05 +01:00
# Nextcloud Forms
![Downloads](https://img.shields.io/github/downloads/nextcloud/forms/total.svg?style=flat-square)
[![Code coverage](https://img.shields.io/codecov/c/github/nextcloud/forms.svg?style=flat-square)](https://codecov.io/gh/nextcloud/forms/)
[![Dependabot status](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg?longCache=true&style=flat-square&logo=dependabot)](https://dependabot.com)
2019-05-14 01:15:45 +02:00
2019-05-14 09:52:50 +02:00
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.
2019-05-14 01:15:45 +02:00
## Build the app
2019-05-14 09:52:50 +02:00
``` bash
# set up and build for production
make
2019-05-14 01:15:45 +02:00
# install dependencies
make dev-setup
# build for dev and watch changes
make watch-js
# build for dev
make build-js
# build for production with minification
make build-js-production
2019-05-14 09:52:50 +02:00
```
## Running tests
You can use the provided Makefile to run all tests by using:
_ps: only works if you're using php locally and have forms installed info your apps default folder_
2019-05-14 09:52:50 +02:00
```
make test
2019-05-14 01:15:45 +02:00
```
## :v: Code of conduct
2019-05-14 01:15:45 +02:00
The Nextcloud community has core values that are shared between all members during conferences,
hackweeks and on all interactions in online platforms including [Github](https://github.com/nextcloud) and [Forums](https://help.nextcloud.com).
If you contribute, participate or interact with this community, please respect [our shared values](https://nextcloud.com/code-of-conduct/). :relieved:
2019-05-14 01:15:45 +02:00
## :heart: How to create a pull request
2019-05-14 01:15:45 +02:00
This guide will help you get started:
- :dancer: :smile: [Opening a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request)
2019-05-14 01:15:45 +02:00
## 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
2019-05-14 09:52:50 +02:00
2019-05-14 01:15:45 +02:00
- **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
2019-05-14 09:52:50 +02:00
- **/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
2019-05-14 01:15:45 +02:00
2019-05-14 09:52:50 +02:00
- **/templates/vote.tmpl.php**: File that contains the form template that is dynamically populated by the database
2019-05-14 01:15:45 +02:00