<commit_before># [Samfundet.no](http://samfundet.no)

![samfundet-screenshot](http://i.imgur.com/8n5hDoC.png)

[![Build Status](https://travis-ci.org/Samfundet/Samfundet.svg?branch=master)](https://travis-ci.org/Samfundet/Samfundet)

## Installation

Follow the steps below in order to setup our project locally.

> For macOS users: You can try running `make setup-mac` in the root directory. That command will essentially do everything that this `README` tells you do to, but we can't guarantee that it works.

### Clone

Clone our main [repository](https://github.com/Samfundet/Samfundet):

```bash
git clone https://github.com/Samfundet/Samfundet.git
```

We also use two other repositories, [SamfundetAuth](https://github.com/Samfundet/SamfundetAuth) and [SamfundetDomain](https://github.com/Samfundet/SamfundetDomain). These can be cloned with the following commands:

```bash
# SamfundetAuth
git clone https://github.com/Samfundet/SamfundetAuth.git

# SamfundetDomain
git clone https://github.com/Samfundet/SamfundetDomain.git
```

### Dependencies

There are several dependencies needed to get Samfundet up and running. Note that RVM is a Ruby version manager used for handling different Ruby versions, but you can use others as well (like [rbenv](https://github.com/rbenv/rbenv)).

#### macOS

1. [Homebrew](https://brew.sh/): `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`
2. [imagemagick](https://formulae.brew.sh/formula/imagemagick): `brew install imagemagick`
3. [graphviz](https://graphviz.org/): `brew install graphviz`
4. [RVM](https://rvm.io/)

#### Linux

##### Option 1 (Automatic)

1. Go to your terminal preferences, and select your terminal profile. Go to the "Commands" tab and check "Run command as a login shell".
2. Run the following commands:

```bash
chmod +x setup-linux.sh
./setup-linux.sh
```

This will make a script run, that will install a few dependencies for you. A restart is however required after running this script, so restart your computer before proceeding to step 3.

3. After restart, run the following commands:

```bash
chmod +x setup-linux2.sh
./setup-linux2.sh
```

After the script has completed, the project should be up and running!

##### Option 2 (Manual)

1. [graphviz](https://graphviz.org/): `sudo apt-get install graphviz`
2. [imagemagick](https://imagemagick.org/): `sudo apt-get install imagemagick`
3. [nodejs](https://nodejs.org/): `sudo apt-get install nodejs`
4. [ubuntu_rvm](https://github.com/rvm/ubuntu_rvm)
5. Source RVM: `source ~/.rvm/scripts/rvm`

We now have all dependencies installed, including RVM, so let's install Ruby 2.5.5. Run these two commands in succession:

```bash
rvm install 2.5.5 --movable
rvm use 2.5.5 --default
```

### Setup database

We use PostgreSQL as our database. There are several ways it can be installed depending on your operating system.

#### Linux
<commit_msg>fix typo<commit_after># [Samfundet.no](http://samfundet.no)

![samfundet-screenshot](http://i.imgur.com/8n5hDoC.png)

[![Build Status](https://travis-ci.org/Samfundet/Samfundet.svg?branch=master)](https://travis-ci.org/Samfundet/Samfundet)

## Installation

Follow the steps below in order to setup our project locally.

> For macOS users: You can try running `make setup-mac` in the root directory. That command will essentially do everything that this `README` tells you do to, but we can't guarantee that it works.

### Clone

Clone our main [repository](https://github.com/Samfundet/Samfundet):

```bash
git clone https://github.com/Samfundet/Samfundet.git
```

We also use two other repositories, [SamfundetAuth](https://github.com/Samfundet/SamfundetAuth) and [SamfundetDomain](https://github.com/Samfundet/SamfundetDomain). These can be cloned with the following commands:

```bash
# SamfundetAuth
git clone https://github.com/Samfundet/SamfundetAuth.git

# SamfundetDomain
git clone https://github.com/Samfundet/SamfundetDomain.git
```

### Dependencies

There are several dependencies needed to get Samfundet up and running. Note that RVM is a Ruby version manager used for handling different Ruby versions, but you can use others as well (like [rbenv](https://github.com/rbenv/rbenv)).

#### macOS

1. [Homebrew](https://brew.sh/): `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`
2. [imagemagick](https://formulae.brew.sh/formula/imagemagick): `brew install imagemagick`
3. [graphviz](https://graphviz.org/): `brew install graphviz`
4. [RVM](https://rvm.io/)

#### Linux

##### Option 1 (Automatic)

1. Go to your terminal preferences, and select your terminal profile. Go to the "Commands" tab and check "Run command as a login shell".
2. Run the following commands:

```bash
chmod +x setup-linux.sh
./setup-linux.sh
```

This will make a script run, that will install a few dependencies for you. A restart is however required after running this script, so restart your computer before proceeding to step 3.

3. After restart, run the following commands:

```bash
chmod +x setup-linux-2.sh
./setup-linux-2.sh
```

After the script has completed, the project should be up and running!

##### Option 2 (Manual)

1. [graphviz](https://graphviz.org/): `sudo apt-get install graphviz`
2. [imagemagick](https://imagemagick.org/): `sudo apt-get install imagemagick`
3. [nodejs](https://nodejs.org/): `sudo apt-get install nodejs`
4. [ubuntu_rvm](https://github.com/rvm/ubuntu_rvm)
5. Source RVM: `source ~/.rvm/scripts/rvm`

We now have all dependencies installed, including RVM, so let's install Ruby 2.5.5. Run these two commands in succession:

```bash
rvm install 2.5.5 --movable
rvm use 2.5.5 --default
```

### Setup database

We use PostgreSQL as our database. There are several ways it can be installed depending on your operating system.

#### Linux

{'fraction_non_alphanumeric': 0.13235042002400138, 'fraction_numerical': 0.0096005486027773, 'mean_word_length': 4.5456273764258555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 36, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1230059', 'n_tokens_mistral': 1937, 'n_tokens_neox': 1858, 'n_words': 625}