# Vkusvill Generator

## First run

This project requires node >=v14.4.0

I recommend to use nvm (Node Version Manager) for installing and switching Node versions
Follow the installation guide from the official repository https://github.com/nvm-sh/nvm#installing-and-updating

If there is Node LTS version >=16 - use it instead of 14

After nvm installation - close and reopen terminal and run:
```shell script
nvm install 14
nvm use 14
nvm alias default 14
```

Node would be installed and configured properly. Read the output, some OS requires adding variables (just follow instructions in output).

### Package manager
```shell script
npm install -g yarn
```

### Dependencies
Install all dependencies by running
```shell script
yarn
```

### Configuration
Create .env file and fill it with your config
```dotenv
KUS_GENERATOR_BACKEND=https://api.vkusvill.flexlab.pro
KUS_GENERATOR_PORT=7890
```

Where KUS_GENERATOR_BACKEND is the URI of backend

### Finally

That's it! Everything is ready for starting backend.

For local start just run

```shell script
yarn api
```

After Generator API is started - you can see it's methods exposed on 
http://localhost:7890/api (set the port same as in .env)

For production run I usually use process-forever

# TODO: write process-forever production manual
