aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
blob: 46bb4e4075c901cf7858fe45e3acca0f9f582fe7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Contributing to ferdium-server

:tada: First off, thanks for taking the time and your effort to make Ferdium better! :tada:

## Table of contents

<!-- TOC depthFrom:2 depthTo:2 withLinks:1 updateOnSave:1 orderedList:0 -->

- [Contributing to ferdium-server](#contributing-to-ferdium-server)
  - [Table of contents](#table-of-contents)
  - [Code of Conduct](#code-of-conduct)
  - [What should I know before I get started?](#what-should-i-know-before-i-get-started)
  - [How Can I Contribute?](#how-can-i-contribute)
  - [Setting up your Development machine](#setting-up-your-development-machine)
    - [Install System-level dependencies](#install-system-level-dependencies)
      - [Node.js, npm, node-gyp](#nodejs-npm-node-gyp)
      - [Git](#git)
    - [Clone repository with submodule](#clone-repository-with-submodule)
    - [Install dependencies](#install-dependencies)
    - [Start development app](#start-development-app)
    - [Styleguide](#styleguide)
      - [Git Commit Messages format](#git-commit-messages-format)
      - [Javascript Coding style-checker](#javascript-coding-style-checker)

<!-- /TOC -->

## Code of Conduct

This project and everyone participating in it is governed by the [Ferdium Code of Conduct](https://github.com/ferdium/ferdium-app/blob/develop/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [hello@ferdium.org](mailto:hello@ferdium.org).

## What should I know before I get started?

For the moment, Ferdium's development is just getting started but all contributions (code, testing, bug-logging, feature-suggestions) are highly appreciated.

## How Can I Contribute?

As a basic rule, before filing issues, feature requests or anything else, please take a look at the issues and check if this has not already been reported by another user. If so, engage in the already existing discussion.

## Setting up your Development machine

### Install System-level dependencies

#### Node.js, npm, node-gyp

Please make sure you are running the exact node version used by the developers/contributors as specified in the [nvmrc file](./.nvmrc).

Currently, these are the combinations of system dependencies that work on an intel-based machines for MacOS/Linux/Windows (building on an ARM-based machine is still a work-in-progress due to node-sass native dependencies)

```bash
node -v
v14.17.3
npm -v
6.14.12
node-gyp -v
v8.0.0
```

#### Git

The version [2.23.0](https://github.com/git-for-windows/git/releases/tag/v2.23.0.windows.1) for Git is working fine for development. You can then use the console from Git to do the development procedure.

<!-- #### Debian/Ubuntu

```bash
apt install libx11-dev libxext-dev libxss-dev libxkbfile-dev rpm
```

#### Fedora

```bash
dnf install libX11-devel libXext-devel libXScrnSaver-devel libxkbfile-devel rpm
```

#### Windows

Please make sure you run this command as an administrator:

```bash
npm i -g windows-build-tools --vs2015
```
 -->

### Clone repository with submodule

```bash
git clone https://github.com/ferdium/ferdium-server.git
cd ferdium-server
git submodule update --init --recursive --remote --rebase --force
```

It is important you execute the last command to get the required submodules (recipes).

### Install dependencies

- Run the following command to install all dependencies, and link sibling modules with ferdium-server.

```bash
npm i
```

- Copy the `.env.example` file into `.env` and change the values to match your system.

```bash
cp .env.example .env
```

_Note:_

1. Have env DB_SSL=true only if your database is postgres and it is hosted online on platforms like GCP, AWS, etc
2. You will have to provide a value for `API_KEY` that is at least 16 characters long.

- If using sqlite for local development, create the database directory (whatever is set to `DATA` in `.env`)

```bash
mkdir -p data
```

- Run the database migrations with

```bash
node ace migration:refresh
```

- To get the full functionality, you will need to have an SMTP server running for local development.

### Start development app

```bash
npm start --dev
```

### Styleguide

#### Git Commit Messages format

- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
- When only changing documentation, include `[ci skip]` in the commit description

#### Javascript Coding style-checker

- Please use `es-lint` and the defined rules to maintain a consistent style