<commit_before># Biphub Core

# Pre-reqs
- Node verison 7.0.0 or higher
- NPM version 4.0.0 or higher

# Getting started
- 1. Clone the repository
```
git clone https://gitlab.com/biphub/biphub.git
```
- 2. Install dependencies
```
cd <project_name>
npm install
```

- 3. Build and run the project
```
npm start
```
Navigate to `http://localhost:3000`

# TypeScript + Node 
The main purpose of this repository is to show a good end-to-end project setup and workflow for writing Node code in TypeScript.
I will try to keep this as up-to-date as possible, but community contributions and recommendations for improvements are encouraged and will be most welcome. 

In the next few sections I will call out everything that changes when adding TypeScript to an Express project.
Note that all of this has already been setup for this project, but feel free to use this as a reference for converting other Node.js project to TypeScript.

> **Note on editors!** - TypeScript has great support in [every editor](http://www.typescriptlang.org/index.html#download-links), but this project has been pre-configured for use with [VS Code](https://code.visualstudio.com/). 
Throughout the README I'll try to call out specific places where VS code really shines or where this project has been setup to take advantage of specific features.

## Getting TypeScript
TypeScript itself is simple to add to any project with `npm`.
```
npm install -D typescript
```
If you're using VS Code then you're good to go!
VS Code will detect and use the TypeScript version you have installed in your `node_modules` folder. 
For other editors, make sure you have the corresponding [TypeScript plugin](http://www.typescriptlang.org/index.html#download-links). 

## Project Structure
The most obvious difference in a TypeScript + Node project is the folder structure.
In a TypeScript project, it's best to have separate _source_  and _distributable_ files.
TypeScript (`.ts`) files live in your `src` folder and after compilation are output as JavaScript (`.js`) in the `dist` folder.
The `test` and `views` folders remain top level as expected. 

The full folder structure of this app is explained below:

> **Note!** Make sure you have already built the app using `npm run build`<commit_msg>#0: readme updated with how to get started for development<commit_after># Biphub Core

# Pre-reqs
- Node verison 7.0.0 or higher
- NPM version 4.0.0 or higher

# Getting started
- 1. Clone the repository
```
git clone https://gitlab.com/biphub/biphub.git
```
- 2. Install dependencies
```
cd <project_name>
npm install
```

- 3. Build and run the project
```
npm start
```
Navigate to `http://localhost:3000`

# Getting started for development

- Do step 1 ~ 2 from ``` Getting started ```

- Copy ``` ./.env.example ``` as ``` ./.env ```. It is going to be used by dotenv.
 Example env assumes that you will be using SQLite as database so it does not have
 username or password but DATABASE_TYPE is set to ``` sqlite ```

- Run development environment as watch mode

```
npm run watch
```

Navgiate to `http://localhost:3000`

# TypeScript + Node 
The main purpose of this repository is to show a good end-to-end project setup and workflow for writing Node code in TypeScript.
I will try to keep this as up-to-date as possible, but community contributions and recommendations for improvements are encouraged and will be most welcome. 

In the next few sections I will call out everything that changes when adding TypeScript to an Express project.
Note that all of this has already been setup for this project, but feel free to use this as a reference for converting other Node.js project to TypeScript.

> **Note on editors!** - TypeScript has great support in [every editor](http://www.typescriptlang.org/index.html#download-links), but this project has been pre-configured for use with [VS Code](https://code.visualstudio.com/). 
Throughout the README I'll try to call out specific places where VS code really shines or where this project has been setup to take advantage of specific features.

## Getting TypeScript
TypeScript itself is simple to add to any project with `npm`.
```
npm install -D typescript
```
If you're using VS Code then you're good to go!
VS Code will detect and use the TypeScript version you have installed in your `node_modules` folder. 
For other editors, make sure you have the corresponding [TypeScript plugin](http://www.typescriptlang.org/index.html#download-links). 

## Project Structure
The most obvious difference in a TypeScript + Node project is the folder structure.
In a TypeScript project, it's best to have separate _source_  and _distributable_ files.
TypeScript (`.ts`) files live in your `src` folder and after compilation are output as JavaScript (`.js`) in the `dist` folder.
The `test` and `views` folders remain top level as expected. 

The full folder structure of this app is explained below:

> **Note!** Make sure you have already built the app using `npm run build`
{'fraction_non_alphanumeric': 0.07836045810729356, 'fraction_numerical': 0.006630500301386378, 'mean_word_length': 4.234490010515247, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4749320', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1305, 'n_words': 708}