This commit is contained in:
Joseph Ditton 2021-12-03 17:00:23 -07:00
parent 95961c5a14
commit edbbed2050
4 changed files with 20 additions and 10 deletions

View File

@ -23,6 +23,8 @@ $ npm install -g yarn
### .env ### .env
Create a file in the root called `.env` and copy the contents of `.env.example` Create a file in the root called `.env` and copy the contents of `.env.example`
In your new `.env` file update the values for each key as you would like
### Dependencies ### Dependencies
To install the server dependencies run To install the server dependencies run
```bash ```bash
@ -43,11 +45,18 @@ $ createdb neststarterappdevelopment # creates a postgres database
Run the migrations Run the migrations
```bash ```bash
yarn db:migrate $ yarn db:migrate
``` ```
Migrations need to be run again everytime a new migration is created Migrations need to be run again everytime a new migration is created
Run the seeds
```bash
$ yarn db:seed
```
This should create roles and your admin level user in your database.
### SSL ### SSL
Create a ssl key and certificate and place them in the root directory Create a ssl key and certificate and place them in the root directory

View File

@ -12,7 +12,7 @@
"db:migration:create": "cd server/database/migrations && typeorm migration:create -n ", "db:migration:create": "cd server/database/migrations && typeorm migration:create -n ",
"db:migrate": "yarn db:start && yarn typeorm migration:run", "db:migrate": "yarn db:start && yarn typeorm migration:run",
"db:migrate:undo": "yarn db:start && yarn typeorm migration:revert", "db:migrate:undo": "yarn db:start && yarn typeorm migration:revert",
"db:seed": "ts-node ./node_modules/typeorm-seeding/dist/cli.js seed -n cli_config.ts -r $(pwd)/server/database", "db:seed": "yarn db:start && ts-node ./node_modules/typeorm-seeding/dist/cli.js seed -n cli_config.ts -r $(pwd)/server/database",
"prebuild": "rimraf dist", "prebuild": "rimraf dist",
"build": "nest build && yarn client:build", "build": "nest build && yarn client:build",
"format": "prettier --write \"server/**/*.ts\" \"test/**/*.ts\"", "format": "prettier --write \"server/**/*.ts\" \"test/**/*.ts\"",
@ -82,7 +82,8 @@
"json", "json",
"ts" "ts"
], ],
"rootDir": "server", "moduleDirectories": ["node_modules", "./"],
"rootDir": "./server",
"testRegex": ".*\\.spec\\.ts$", "testRegex": ".*\\.spec\\.ts$",
"transform": { "transform": {
"^.+\\.(t|j)s$": "ts-jest" "^.+\\.(t|j)s$": "ts-jest"

View File

@ -1,5 +1,5 @@
import { Test, TestingModule } from '@nestjs/testing'; import { Test, TestingModule } from '@nestjs/testing';
import { AppController } from './app.controller'; import { AppController } from 'server/app.controller';
describe('AppController', () => { describe('AppController', () => {
let appController: AppController; let appController: AppController;
@ -13,9 +13,9 @@ describe('AppController', () => {
appController = app.get<AppController>(AppController); appController = app.get<AppController>(AppController);
}); });
// describe('root', () => { describe('root', () => {
// it('should return "Hello World!"', () => { it('should return "Hello World!"', () => {
// expect(appController.getHello()).toBe('Hello World!'); expect(appController.index()).toBe('Hello World!');
// }); });
// }); });
}); });

View File

@ -1,4 +1,4 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"] "exclude": ["node_modules", "test", "dist", "**/*spec.ts", "client"]
} }