Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
feat: add code documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwigoric committed Nov 28, 2023
1 parent cfc2033 commit 641c5d7
Show file tree
Hide file tree
Showing 28 changed files with 378 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/c.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE categories
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
<categories>
<category id="wrs" name="Writerside documentation" order="1"/>
</categories>
12 changes: 12 additions & 0 deletions docs/cfg/buildprofiles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<variables></variables>
<build-profile instance="ucwa">
<variables>
<noindex-content>true</noindex-content>
</variables>
</build-profile>

</buildprofiles>
5 changes: 5 additions & 0 deletions docs/cfg/glossary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE terms SYSTEM "https://resources.jetbrains.com/writerside/1.0/glossary.dtd">
<terms>
<term name="es6">ECMAScript 6 or ECMAScript 2015</term>
</terms>
Binary file added docs/images/completion_procedure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/completion_procedure_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/convert_table_to_xml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/convert_table_to_xml_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/new_topic_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/new_topic_options_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions docs/topics/Code-Style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Code Style

> If you are using VS Code or WebStorm,
> you can install the Prettier and ESLint extensions
> to automatically format your code. Both repositories
> contain Prettier and ESLint rules for code style.
> You can find them in the `.prettierrc` and `.eslintrc` files
> respectively.
## Indentation

All indentation must be done using **spaces**.
One indentation level is equal to **4 spaces**.

## Line Length

All lines must not exceed **25 characters**.

## Semicolons

All statements must **NOT** end with a semicolon (`;`).

## Braces

All braces must be placed on the same line as the statement they refer to.

### Example { id="braces-example" }

```javascript
if (true) {
// ...
}
```

## Spacing

### Operators

All operators must be surrounded by **spaces**.

#### Example { id="spacing-operators-example" }

```javascript
const a = 1 + 2;
```

### Keywords

All keywords must be followed by a **space**.

#### Example { id="spacing-keywords-example" }

```javascript
if (true) {
// ...
}
```

### Commas

All commas must be followed by a **space**.

#### Example { id="spacing-commas-example" }

```javascript
const a = [1, 2, 3];
```
10 changes: 10 additions & 0 deletions docs/topics/Coding Standards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Coding Standards

This page contains the coding standards for the %product%.

## General

In developing the product, we must follow the
<tooltip term='es6'>ES6</tooltip> standard.
Both repositories are written in
<tooltip term='es6'>ES6</tooltip>.
45 changes: 45 additions & 0 deletions docs/topics/Comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Comments

As much as possible, the language used for comments must be English.

## Inline Comments

Inline comments must be written in `//` and must be placed above the line they
refer to.

## Block Comments

Block comments must be written in `/* */` and must be placed above the block
they refer to.

## Example { id="comments-example" }

```javascript
// This is an inline comment

/*
* This is a block comment
*/
```

> Some IDEs allow you to create a block comment by selecting a block of code and
> pressing <shortcut>Ctrl</shortcut><shortcut>Shift</shortcut><shortcut>/</shortcut>.
{ style='note' }

### Block Comments for Methods

Block comments for methods must contain at least the following:

* A description of the method
* A description of the parameters
* A description of the return value, if any

```javascript
/**
* This is a block comment for a method
*
* @param {string} param1 This is the first parameter
* @param {string} param2 This is the second parameter
* @returns {string} This is the return value
*/
```
45 changes: 45 additions & 0 deletions docs/topics/Introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Introduction

Welcome to the documentation for the %product%!

In this documentation, you will find information about the %product%
and its underlying quality attributes and design.

## Structure

The product uses separate repositories for the frontend
and the backend. The frontend is written in %lang%
using the %framework% framework.
The backend is written in %lang% as well using the
%backend-framework% framework.

There are two repositories for this project:

* [Frontend](%frontend-repo-url%)
* [Backend](%backend-repo-url%)

Instructions on how to set up the project can be found in the
[README](%frontend-repo-url%/blob/main/README.md) file of the frontend repository.

Running the backend is also required; instructions can be found in the
[README](%backend-repo-url%/blob/main/README.md) file of the backend repository.

## Deployment

The frontend part of the product is deployed on %deployment-platform%.
On the other hand, the backend is deployed on %backend-deployment-platform%.

### Pipeline

The pipeline is configured using GitHub Actions.
The pipeline is triggered on every push to the repository.

The frontend pipeline is configured directly from Cloudflare Pages.

The backend pipeline is configured using GitHub Actions, which you may
find in the [backend repository](%backend-repo-url%/blob/main/.github/workflows/deployment_azure-app-service.yml).

## Feedback and support

Please utilize the GitHub issue feature to report any issues,
usability improvements, or feature requests.
28 changes: 28 additions & 0 deletions docs/topics/Naming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Naming

## Files

All files must be named in lowercase and use the underscore as a separator
(`snake_case`), except for the following files:

* **Mongoose models**, which must be named in `camelCase`.
* **Express routers**, which must be named in `snake_case`.
* **Vue components**, which must be named in `PascalCase`.
* **Assets**, which must be named in `kebab-case`.

## Variables

All variables must be named in `camelCase`.

### Constants

All constants must be named in uppercase and use the underscore as a separator
(`SCREAMING_SNAKE_CASE`).

## Functions/Methods

All functions and methods must be named in `camelCase`.

## Classes

All classes must be named in `PascalCase`.
15 changes: 15 additions & 0 deletions docs/ucwa.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">

<instance-profile id="ucwa"
name="UnboundMNL Cooperatives Web App"
start-page="Introduction.md">

<toc-element topic="Introduction.md"/>
<toc-element topic="Coding Standards.md">
<toc-element topic="Naming.md"/>
<toc-element topic="Comments.md"/>
<toc-element topic="Code-Style.md"/>
</toc-element>
</instance-profile>
12 changes: 12 additions & 0 deletions docs/v.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd">
<vars>
<var name="product" value="UnboundMNL Cooperatives Web App"/>
<var name="lang" value="JavaScript" />
<var name="framework" value="Vue" />
<var name="backend-framework" value="Express" />
<var name="frontend-repo-url" value="https://github.com/Dwigoric/unboundmnl-area-2" />
<var name="backend-repo-url" value="https://github.com/Dwigoric/unboundmnl-area-2-server" />
<var name="deployment-platform" value="Cloudflare Pages" />
<var name="backend-deployment-platform" value="Azure App Service" />
</vars>
8 changes: 8 additions & 0 deletions docs/writerside.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ihp SYSTEM "https://resources.jetbrains.com/writerside/1.0/ihp.dtd">

<ihp version="2.0">
<topics dir="topics" web-path="topics"/>
<images dir="images" web-path="images"/>
<instance src="ucwa.tree" web-path="/ucwa/" version="1.0.0"/>
</ihp>
1 change: 1 addition & 0 deletions public/docs/HelpTOC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"entities":{"pages":{"Introduction":{"id":"Introduction","title":"Introduction","url":"introduction.html","level":0,"tabIndex":0},"Coding Standards":{"id":"Coding Standards","title":"Coding Standards","url":"coding-standards.html","level":0,"pages":["Naming","Comments","Code-Style"],"tabIndex":1},"Naming":{"id":"Naming","title":"Naming","url":"naming.html","level":1,"parentId":"Coding Standards","tabIndex":0},"Comments":{"id":"Comments","title":"Comments","url":"comments.html","level":1,"parentId":"Coding Standards","tabIndex":1},"Code-Style":{"id":"Code-Style","title":"Code Style","url":"code-style.html","level":1,"parentId":"Coding Standards","tabIndex":2}}},"topLevelIds":["Introduction","Coding Standards"]}
1 change: 1 addition & 0 deletions public/docs/Map.jhm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version='1.0' encoding='UTF-8'?><map version="2.0"><mapID target="Introduction.md" url="introduction.html" default="yes"/><mapID target="Introduction" url="introduction.html" default="yes"/><mapID target="Coding+Standards.md" url="coding-standards.html" default="no"/><mapID target="Coding Standards.md" url="coding-standards.html" default="no"/><mapID target="Coding Standards" url="coding-standards.html" default="no"/><mapID target="Coding+Standards" url="coding-standards.html" default="no"/><mapID target="Naming.md" url="naming.html" default="no"/><mapID target="Naming" url="naming.html" default="no"/><mapID target="Comments.md" url="comments.html" default="no"/><mapID target="Comments" url="comments.html" default="no"/><mapID target="Code-Style.md" url="code-style.html" default="no"/><mapID target="Code-Style" url="code-style.html" default="no"/></map>
13 changes: 13 additions & 0 deletions public/docs/code-style.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html SYSTEM "about:legacy-compat"><html lang="en-US" data-colors-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="robots" content="noindex"> <meta name="built-on" content="2023-11-28T21:35:39.2990255"><meta name="build-number" content="${buildNumber}"> <title>Code Style | UnboundMNL Cooperatives Web App</title><script id="virtual-toc-data" type="application/json">[{"id":"indentation","level":0,"title":"Indentation","anchor":"#indentation"},{"id":"line-length","level":0,"title":"Line Length","anchor":"#line-length"},{"id":"semicolons","level":0,"title":"Semicolons","anchor":"#semicolons"},{"id":"braces","level":0,"title":"Braces","anchor":"#braces"},{"id":"spacing","level":0,"title":"Spacing","anchor":"#spacing"}]</script><script id="topic-shortcuts" type="application/json"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.1.5-b176/app.css" rel="stylesheet"> <link rel="apple-touch-icon" sizes="180x180" href="https://jetbrains.com/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://jetbrains.com/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="https://jetbrains.com/favicon-16x16.png"><link rel="manifest" href="https://jetbrains.com/site.webmanifest"><link rel="mask-icon" href="https://jetbrains.com/safari-pinned-tab.svg" color="#000000"><meta name="msapplication-TileColor" content="#000000"/><meta name="msapplication-TileImage" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-144x144.png"/><meta name="msapplication-square70x70logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-70x70.png"/><meta name="msapplication-square150x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-150x150.png"/><meta name="msapplication-wide310x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x150.png"/><meta name="msapplication-square310x310logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x310.png"/> <meta name="image" content=""><!-- Open Graph --><meta property="og:title" content="Code Style | UnboundMNL Cooperatives Web App"/><meta property="og:description" content=""/><meta property="og:image" content=""/><meta property="og:site_name" content="UnboundMNL Cooperatives Web App Help"/><meta property="og:type" content="website"/><meta property="og:locale" content="en_US"/><meta property="og:url" content="/ucwa/1.0.0/code-style.html"/><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content=""><meta name="twitter:title" content="Code Style | UnboundMNL Cooperatives Web App"><meta name="twitter:description" content=""><meta name="twitter:creator" content=""><meta name="twitter:image:src" content=""><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebPage", "@id": "/ucwa/1.0.0/code-style.html#webpage", "url": "/ucwa/1.0.0/code-style.html", "name": "Code Style | UnboundMNL Cooperatives Web App", "description": "", "image": "", "inLanguage":"en-US" }</script><!-- End Schema.org --><!-- Schema.org WebSite --><script type="application/ld+json"> { "@type": "WebSite", "@id": "/ucwa/#website", "url": "/ucwa/", "name": "UnboundMNL Cooperatives Web App Help" }</script><!-- End Schema.org --> <!-- Mermaid light/dark themes --> <link rel="stylesheet" type="text/css" href="mermaid.css"> </head> <body data-id="Code-Style" data-main-title="Code Style" data-article-props="{&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="Coding Standards.md|Coding Standards" > <div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>UnboundMNL Cooperatives Web App 1.0.0 Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Code-Style" id="Code-Style.md" >Code Style</h1> <aside class="prompt" data-type="tip" data-title="" id="15a849f3_151"><p id="15a849f3_152">If you are using VS Code or WebStorm, you can install the Prettier and ESLint extensions to automatically format your code. Both repositories contain Prettier and ESLint rules for code style. You can find them in the <code class="code" id="15a849f3_153">.prettierrc</code> and <code class="code" id="15a849f3_154">.eslintrc</code> files respectively.</p></aside><section class="chapter"><h2 id="indentation" data-toc="indentation">Indentation</h2><p id="15a849f3_155">All indentation must be done using <span class="control" id="15a849f3_156">spaces</span>. One indentation level is equal to <span class="control" id="15a849f3_157">4 spaces</span>.</p></section><section class="chapter"><h2 id="line-length" data-toc="line-length">Line Length</h2><p id="15a849f3_158">All lines must not exceed <span class="control" id="15a849f3_159">25 characters</span>.</p></section><section class="chapter"><h2 id="semicolons" data-toc="semicolons">Semicolons</h2><p id="15a849f3_160">All statements must <span class="control" id="15a849f3_161">NOT</span> end with a semicolon (<code class="code" id="15a849f3_162">;</code>).</p></section><section class="chapter"><h2 id="braces" data-toc="braces">Braces</h2><p id="15a849f3_163">All braces must be placed on the same line as the statement they refer to.</p><section class="chapter"><h3 id="braces-example" data-toc="braces-example">Example</h3><div class="code-block" data-lang="javascript" >
if (true) {
// ...
}
</div></section></section><section class="chapter"><h2 id="spacing" data-toc="spacing">Spacing</h2><section class="chapter"><h3 id="operators" data-toc="operators">Operators</h3><p id="15a849f3_165">All operators must be surrounded by <span class="control" id="15a849f3_166">spaces</span>.</p><section class="chapter"><h4 id="spacing-operators-example" data-toc="spacing-operators-example">Example</h4><div class="code-block" data-lang="javascript" >
const a = 1 + 2;
</div></section></section><section class="chapter"><h3 id="keywords" data-toc="keywords">Keywords</h3><p id="15a849f3_168">All keywords must be followed by a <span class="control" id="15a849f3_169">space</span>.</p><section class="chapter"><h4 id="spacing-keywords-example" data-toc="spacing-keywords-example">Example</h4><div class="code-block" data-lang="javascript" >
if (true) {
// ...
}
</div></section></section><section class="chapter"><h3 id="commas" data-toc="commas">Commas</h3><p id="15a849f3_171">All commas must be followed by a <span class="control" id="15a849f3_172">space</span>.</p><section class="chapter"><h4 id="spacing-commas-example" data-toc="spacing-commas-example">Example</h4><div class="code-block" data-lang="javascript" >
const a = [1, 2, 3];
</div></section></section></section><div class="last-modified"> Last modified: 28 November 2023</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"> <a class="navigation-links__prev" href="comments.html">Comments</a> </div></article><div id="disqus_thread"></div></div></section></main></div> <script src="https://resources.jetbrains.com/writerside/apidoc/6.1.5-b176/app.js"></script></body></html>
Loading

0 comments on commit 641c5d7

Please sign in to comment.