Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seed User Fix #213

Merged
merged 3 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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