LocChat/README.md

79 lines
1.4 KiB
Markdown
Raw Normal View History

2021-11-03 21:25:40 -04:00
# Nest Starter App
2021-10-29 20:57:24 -04:00
## Description
2021-11-16 21:14:46 -05:00
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.
2021-10-29 20:57:24 -04:00
2021-11-03 21:25:40 -04:00
## Setup
2021-11-16 21:14:46 -05:00
### 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
2021-11-03 21:25:40 -04:00
Create a file in the root called `.env` and copy the contents of `.env.example`
2021-11-16 21:14:46 -05:00
### Dependencies
To install the dependencies run
```bash
$ yarn # this is same thing as `yarn install`
```
2021-11-03 21:25:40 -04:00
2021-11-16 21:14:46 -05:00
### Database
Create the database
2021-11-03 21:25:40 -04:00
```bash
2021-11-16 21:14:46 -05:00
$ pc_ctl start # this starts postgres
$ createdb neststarterappdevelopement # creates a postgres database
2021-11-03 21:25:40 -04:00
```
2021-10-29 20:57:24 -04:00
2021-11-16 21:14:46 -05:00
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 an place them in the root directory
2021-10-29 20:57:24 -04:00
```bash
2021-11-16 21:14:46 -05:00
$ openssl req -x509 -newkey rsa:4096 -keyout private-key.pem -out public-cert.pem -sha256 -nodes
2021-10-29 20:57:24 -04:00
```
2021-11-16 21:14:46 -05:00
Where this key will only be used for development you can leave all of the information blank.
2021-10-29 20:57:24 -04:00
## Running the app
```bash
# development
2021-11-16 21:14:46 -05:00
$ yarn start
2021-10-29 20:57:24 -04:00
# watch mode
2021-11-16 21:14:46 -05:00
$ yarn start:dev
2021-10-29 20:57:24 -04:00
# production mode
2021-11-16 21:14:46 -05:00
$ yarn start:prod
2021-10-29 20:57:24 -04:00
```
## Test
```bash
# unit tests
2021-11-16 21:14:46 -05:00
$ yarn test
2021-10-29 20:57:24 -04:00
# e2e tests
2021-11-16 21:14:46 -05:00
$ yarn test:e2e
2021-10-29 20:57:24 -04:00
# test coverage
2021-11-16 21:14:46 -05:00
$ yarn test:cov
2021-10-29 20:57:24 -04:00
```