From f6d40b5646bf3555c6aa0674fe964afb75aea1f0 Mon Sep 17 00:00:00 2001 From: Simon Rozsival Date: Thu, 24 Nov 2016 11:01:00 +0100 Subject: [PATCH 1/5] Updated Web application (markdown) --- Web-application.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Web-application.md b/Web-application.md index 0e55771..4d16573 100644 --- a/Web-application.md +++ b/Web-application.md @@ -14,7 +14,7 @@ created by Dan Abramov is used to manage the application state. Both of these fr ### Multiplatform approach -Since the runtime environment of *WebApp* is user's web browser it does not need any installation on enduser's device and does not require any particular platform or non-standard software installed on user's device. +Since the runtime environment of *WebApp* is the user's web browser it does not need any installation on the enduser's device and does not require any particular platform or non-standard software installed on the user's device. This application is designed and implemented in a way which should be suitable for modern web browsers on both desktop and mobile devices. ## Architecture @@ -75,7 +75,7 @@ The implementation of *WebApp* is split across more than a hundred small compone - There is no technical difference between *containers* and *pages*. *Pages* are used as "root" components for different pages and are registered in the app's [router](https://github.com/ReactTraining/react-router). -As was mentioned earlier in the text, there is over a hundred components in the whole application and most of them are very simple. Some of the most important and widely used components and described in the following paragraphs. +As was mentioned earlier in the text, there is over a hundred components in the whole application and most of them are very simple. Some of the most important and widely used components are described in the following paragraphs. #### App @@ -125,7 +125,7 @@ A package [react-bootstrap](https://react-bootstrap.github.io/) is used. Compone ##### Box, FormBox -[Box](https://github.com/ReCodEx/web-app/blob/master/src/components/AdminLTE/Box/Box.js) is a frequently used component for bounding other components like text or tables inside. It is a re-styled `Panel` component from Bootstrap. It can be collapsable and can be displayed in different colors and types. [FormBox](https://github.com/ReCodEx/web-app/blob/master/src/components/AdminLTE/FormBox/FormBox.js) is just o wrapper of `Box` adjusted for holding forms inside of the body. +[Box](https://github.com/ReCodEx/web-app/blob/master/src/components/AdminLTE/Box/Box.js) is a frequently used component for bounding other components like text paragraphs or tables inside. It is in fact a re-styled `Panel` component from Bootstrap. It can be collapsable and can be displayed in different colors and types. [FormBox](https://github.com/ReCodEx/web-app/blob/master/src/components/AdminLTE/FormBox/FormBox.js) is just a wrapper of `Box` adjusted for holding forms inside of the body. ##### CommentThread From 378c59ac60c184a5bbfd8b86d29df74d35d9049d Mon Sep 17 00:00:00 2001 From: Simon Rozsival Date: Thu, 24 Nov 2016 11:09:41 +0100 Subject: [PATCH 2/5] Updated Web API (markdown) --- Web-API.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Web-API.md b/Web-API.md index c4e89da..e36cb4a 100644 --- a/Web-API.md +++ b/Web-API.md @@ -10,7 +10,7 @@ goes as HTTP(S) requests in predefined format, nowadays mostly known as Results from the API are in plain text in JSON format to be easily parsed in various languages (notably JavaScript). -This component must be publicly visible in the internet, so it is important to +This component must be publicly visible on the internet, so it is important to care about security and follow our recommendations. Security and user access restriction are among our primary concerns, so proper roles with permission separation are introduced and maintained. Also some additional checks are made @@ -32,7 +32,7 @@ API architecture consists of several parts: Each presenter method has several annotations. They are used for generating REST API documentation in [Swagger](http://swagger.io/), specifying request type and its parameters and specifying one level of access restrictions. Also, there is simple description of the endpoint. -For specifying the request type (_GET_, _POST_, _DELETE_) are used annotations with exactly these names without parameters. To describe request parameters is used `@Param` annotation with following arguments: +For specifying the request type (_GET_, _POST_, _DELETE_) annotations with exactly these names without any parameters are used. To describe request parameters `@Param` annotation is used with following arguments: - type -- the type of argument, one of _post_ of _query_ - name -- name of the argument (the key) @@ -41,7 +41,7 @@ For specifying the request type (_GET_, _POST_, _DELETE_) are used annotations w - required -- specifies if this option is mandatory (`true`, default) or optional (`false`) - description -- description for documentation of the API -Another annotation is `@LoggedIn` which takes no arguments. It can be placed before whole class or before a method, so requests from unauthorized users are forbidden. Permissions can be granted or prohibitted by `@UserIsAllowed` annotation. This one is only per method and takes one argument in format `key="value"`. The value specifies which action (_value_) of a resource (_key_) user need to be allowed to perform this request. Example how an annotated endpoint can look like: +Another annotation is `@LoggedIn` which takes no arguments. It can be placed before a whole class or before a method, so requests from unauthorized users are forbidden. Permissions can be granted or prohibitted by `@UserIsAllowed` annotation. This one is only per method and takes one argument in `key="value"` format. The value specifies which action (_value_) of a resource (_key_) the user needs to be allowed to perform this request. An example of how an annotated endpoint can look like: ```{.php} /** @@ -70,7 +70,7 @@ columns of database tables including types, indexes and also it is possible to make mapping between entities. For detailed info refer to [official documentation](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/). -The API is capable of sending email messages. They can inform administrator about errors and users about submission evaluation or temporary link to change forgotten password. The [Nette Mail](https://doc.nette.org/en/2.4/mailing) extension provides nice interface for sending messages through external SMTP server (**preferred**) or builtin PHP function `mail`. It is important to set up the mailserver properly to ensure message delivery to the clients. The messages are rendered in HTML format via simple _Latte_ templates. +The API is capable of sending email messages. They can inform an administrator about errors and users about submission evaluation or a temporary link to change forgotten password. The [Nette Mail](https://doc.nette.org/en/2.4/mailing) extension provides nice interface for sending messages through external SMTP server (**preferred**) or builtin PHP function `mail`. It is important to set up the mailserver properly to ensure message delivery to the clients. The messages are rendered in HTML format via simple _Latte_ templates. ### Authentication @@ -90,16 +90,16 @@ completely instead of just receiving session data through a global variable. ## Installation -The web API requires a PHP runtime version at least 7. Which one depends on actual configuration, there is a choice between _mod_php_ inside Apache, _php-fpm_ with Apache or Nginx proxy or running it as standalone uWSGI script. Common thing is, that there are some PHP extensions, that have to be installed on the system. Namely ZeroMQ binding (`php-zmq` package or similar), MySQL module (`php-mysqlnd` package) and ldap extension module for CAS authentication (`php-ldap` package). Make sure that the extensions are loaded in your `php.ini` file (`/etc/php.ini` or files in `/etc/php.d/`). +The web API requires a PHP runtime version at least 7. Which one depends on actual configuration, there is a choice between _mod_php_ inside Apache, _php-fpm_ with Apache or Nginx proxy or running it as standalone uWSGI script. It is common that there are some PHP extensions, that have to be installed on the system. Namely ZeroMQ binding (`php-zmq` package or similar), MySQL module (`php-mysqlnd` package) and ldap extension module for CAS authentication (`php-ldap` package). Make sure that the extensions are loaded in your `php.ini` file (`/etc/php.ini` or files in `/etc/php.d/`). -The API depends on some other projects and libraries. For managing them is used [Composer](https://getcomposer.org/). It can be installed from system repositories or downloaded from the website, where are also detailed instructions. Composer reads `composer.json` file in project root and install dependencies to `vendor/` subdirectory. To do that, run: +The API depends on some other projects and libraries. For managing them [Composer](https://getcomposer.org/) is used. It can be installed from system repositories or downloaded from the website, where detailed instructions are as well. Composer reads `composer.json` file in the project root and installs dependencies to the `vendor/` subdirectory. To do that, run: ``` $ composer install ``` ## Configuration and usage -The API can be configured in `config.neon` and `config.local.neon` files in `app/config` directory. The first file is predefined by authors and should not be modified. The second one is not present and could be created from template `config.local.neon.example` in the config directory. Local configuration have higher precedence, so it will override default values from `config.neon`. +The API can be configured in `config.neon` and `config.local.neon` files in `app/config` directory. The first file is predefined by authors and should not be modified. The second one is not present and could be created from `config.local.neon.example` template in the config directory. Local configuration have higher precedence, so it will override default values from `config.neon`. ### Configurable items From e7a2f297a9b456aef6dc1fb80206b973ce94e117 Mon Sep 17 00:00:00 2001 From: Petr Stefan Date: Thu, 24 Nov 2016 12:12:12 +0100 Subject: [PATCH 3/5] Add database schema --- Database-schema.md | 1 + Home.md | 1 + _Sidebar.md | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 Database-schema.md diff --git a/Database-schema.md b/Database-schema.md new file mode 100644 index 0000000..5a4ad85 --- /dev/null +++ b/Database-schema.md @@ -0,0 +1 @@ +![Database schema](https://raw.githubusercontent.com/ReCodEx/wiki/master/images/recodex-db.svg) diff --git a/Home.md b/Home.md index ff804ff..9f060e0 100644 --- a/Home.md +++ b/Home.md @@ -58,6 +58,7 @@ * [[FAQ]] * [[Logo]] * [[Coding style]] +* [[Database schema]] ## Documentation * [API documentation](http://recodex.github.io/api-doc) diff --git a/_Sidebar.md b/_Sidebar.md index cf14bf8..36062a4 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -20,3 +20,5 @@ * [[FAQ]] * [[Logo]] * [[Coding style]] +* [[Database schema]] + From 688d283156889abc0ba8c7613a78f1cbbf1a8dce Mon Sep 17 00:00:00 2001 From: Petr Stefan Date: Thu, 24 Nov 2016 12:15:52 +0100 Subject: [PATCH 4/5] Fix preview --- Database-schema.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Database-schema.md b/Database-schema.md index 5a4ad85..b26df53 100644 --- a/Database-schema.md +++ b/Database-schema.md @@ -1 +1,3 @@ -![Database schema](https://raw.githubusercontent.com/ReCodEx/wiki/master/images/recodex-db.svg) +# Database schema + +![Database schema](https://rawgit.com/ReCodEx/wiki/master/images/recodex-db.svg) From b3964943f24851cf859ac1e207bcb35a1ad8c5e8 Mon Sep 17 00:00:00 2001 From: Petr Stefan Date: Thu, 24 Nov 2016 12:20:03 +0100 Subject: [PATCH 5/5] Fix to build pdf --- Web-application.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web-application.md b/Web-application.md index 4d16573..b8a2527 100644 --- a/Web-application.md +++ b/Web-application.md @@ -43,7 +43,7 @@ The redux [store](https://github.com/ReCodEx/web-app/blob/master/src/redux/store #### apiMiddleware -The API middleware catches all the `'CALL_API'` actions and turns them into a HTTP request via the [fetch API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API). The middleware deeply converts data in the *body* part of the request to `FormData` and sets correctly the headers and creates endpoints for the API server before each request is sent. The middleware also handle the responses - converts them to the format expected by the reducers and catches requests' failures. +The API middleware catches all the `CALL_API` actions and turns them into a HTTP request via the [fetch API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API). The middleware deeply converts data in the *body* part of the request to `FormData` and sets correctly the headers and creates endpoints for the API server before each request is sent. The middleware also handle the responses - converts them to the format expected by the reducers and catches requests' failures. #### accessTokenMiddleware