blob: edb27da72eb9363fb7c14b51f94bda31236d7bd3 (
plain)
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
|
# Nest Starter App
## Description
A starter app with Postgres, NestJS, and React
## Prerequisites
### asdf-vm
Tool versions are managed using `asdf-vm`. You will need to have `asdf-vm` installed first.
## Setup
### Tool versions
Install the tool versions by running
```bash
$ asdf install
```
### Install yarn
We will use `yarn` instead of `npm` for package managment
```bash
$ npm install -g yarn
```
### .env
Create a file in the root called `.env` and copy the contents of `.env.example`
### Dependencies
To install the server dependencies run
```bash
$ yarn # this is same thing as `yarn install`
```
To install the client dependencies run
```bash
$ cd client && yarn && cd ..
```
### Database
Create the database
```bash
$ pg_ctl start # starts postgres
$ createdb neststarterappdevelopment # creates a postgres database
```
Run the migrations
```bash
yarn db:migrate
```
Migrations need to be run again everytime a new migration is created
### SSL
Create a ssl key and certificate and place them in the root directory
```bash
$ openssl req -x509 -newkey rsa:4096 -keyout private-key.pem -out public-cert.pem -sha256 -nodes
```
Enter `US` for the country code. Where this key will only be used for development you can leave all of the rest of information blank.
## Running the app
To start the server run
```bash
# watch mode
$ yarn start:dev
```
To start the client run
```bash
$ yarn client:watch
```
## Test
```bash
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
# test coverage
$ yarn test:cov
```
|