Skip to content

Commit

Permalink
Merge pull request #213 from softrams/208-master
Browse files Browse the repository at this point in the history
Seed User Fix
  • Loading branch information
Whamo12 committed Aug 17, 2020
2 parents 53ce904 + afba021 commit 9d53a49
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 199 deletions.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please keep in mind, this project is very early in the development phase.
```
$ git clone (url)
$ cd bulwark
$ npm i
$ npm install
```

Run in development mode:
Expand Down Expand Up @@ -133,18 +133,29 @@ FROM_EMAIL_PASSWORD=""
COMPANY_NAME=""
```

## Seed Initial User
## Create Initial Database Migration

On initial startup, Bulwark will not have any users. Therefore, it is necessary to seed the **first** user.
1. Create the initial database migration

<!-- Afterwords, subsequent users should be invited. -->
```
$ npm run migration:init
```

2. Run the initial database migration

```
$ npm run migration:run
```

## Insert First User

1. Insert the first user by running the following command with the required arguments. Example:

```
$ node dist/init/seed-user.js --firstName=John --lastName=OneOneSeven --email=spartan117@unsc.com --title='Master Chief Petty Officer' --password=blueTeam
```

1. `$ npm install`
2. `$ npm run start:dev`
3. Navigate to [seed-user.ts](https://github.com/softrams/bulwark/blob/develop/src/temp/seed-user.ts)
4. Update the `userConfig` object with user credentials, save, and wait for the JS to compile
5. `$ node ./dist/temp/seed-user.js`
6. Log into Bulwark with credentials used in step 4
2. Login to Bulwark with the newly created user

## Built With

Expand Down
2 changes: 1 addition & 1 deletion ormconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
entities: [__dirname + '/dist/entity/*.js'],
migrations: ['migration/*.ts'],
migrations: ['/dist/migration/*.js'],
cli: {
migrationsDir: 'migration'
},
Expand Down
Loading

0 comments on commit 9d53a49

Please sign in to comment.