Skip to content

Commit 18239ab

Browse files
authored
Merge pull request #28 from monstar-lab-oss/yash/minor-update
Minor updates on README
2 parents 6799196 + 283d405 commit 18239ab

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ DB_PORT=
55
DB_NAME=
66
DB_USER=
77
DB_PASS=
8-
JWT_EXPIRES_IN=15m
8+
JWT_EXPIRES_IN_SECONDS=3600
99
JWT_PUBLIC_KEY=
1010
JWT_PRIVATE_KEY=

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ This is a Github Template Repository, so it can be easily [used as a starter tem
1111

1212
To view sample implementations based on this starter-kit, please visit the [nestjs-sample-solutions](https://github.com/monstar-lab-oss/nestjs-sample-solutions) repository.
1313

14+
## Starter-kit Features
15+
16+
| Feature | Info | Progress |
17+
| ------------------------ | --------------- | -------- |
18+
| Authentication | JWT | Done |
19+
| ORM Integration | TypeORM | Done |
20+
| DB Migrations | TypeORM | Done |
21+
| Logging | nestjs-pino | Done |
22+
| Request Validation | class-validator | Done |
23+
| Docker Ready | Dockerfile | Done |
24+
| Auto-generated OpenAPI | - | Done |
25+
| Auto-generated ChangeLog | - | WIP |
26+
1427
## Installation
1528

1629
```bash

docker-compose.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "3.8"
1+
version: '3.8'
22

33
services:
44
app:
@@ -15,16 +15,18 @@ services:
1515
environment:
1616
APP_ENV: ${APP_ENV}
1717
APP_PORT: ${APP_PORT}
18-
DB_HOST: ${DB_HOST}
18+
DB_HOST: mysqldb
1919
DB_PORT: ${DB_PORT}
2020
DB_NAME: ${DB_NAME}
2121
DB_USER: ${DB_USER}
2222
DB_PASS: ${DB_PASS}
23-
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN}
23+
JWT_EXPIRES_IN_SECONDS: ${JWT_EXPIRES_IN_SECONDS}
2424
JWT_PUBLIC_KEY: ${JWT_PUBLIC_KEY}
2525
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
26+
depends_on:
27+
- mysqldb
2628

27-
db:
29+
mysqldb:
2830
image: mysql:8
2931
command: --default-authentication-plugin=mysql_native_password
3032
ports:
@@ -39,6 +41,8 @@ services:
3941
image: adminer
4042
ports:
4143
- 8080:8080
44+
depends_on:
45+
- mysqldb
4246

4347
volumes:
4448
node_modules:

ormconfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
username: process.env.DB_USER,
66
password: process.env.DB_PASS,
77
database: process.env.DB_NAME,
8-
entities: [__dirname + '/**/**/*.entity{.ts,.js}'],
8+
entities: [__dirname + '/src/**/*.entity{.ts,.js}'],
99
migrations: [__dirname + '/migrations/**/*{.ts,.js}'],
1010
migrationsRun: false,
1111
cli: {

src/auth/auth.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { JwtStrategy } from './strategies/jwt.strategy';
2222
publicKey: configService.get<string>('jwt.publicKey'),
2323
privateKey: configService.get<string>('jwt.privateKey'),
2424
signOptions: {
25-
expiresIn: configService.get<number>('jwt.expiresIn'),
25+
expiresIn: configService.get<number>('jwt.expiresInSeconds'),
2626
algorithm: 'RS256',
2727
},
2828
}),

src/shared/config/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export default (): any => ({
1313
jwt: {
1414
publicKey: readFileSync(process.env.JWT_PUBLIC_KEY, 'utf8'),
1515
privateKey: readFileSync(process.env.JWT_PRIVATE_KEY, 'utf8'),
16-
expiresIn: parseInt(process.env.JWT_EXPIRES_IN, 10),
16+
expiresInSeconds: parseInt(process.env.JWT_EXPIRES_IN_SECONDS, 10),
1717
},
1818
});

src/shared/config/module-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ export const configModuleOptions: ConfigModuleOptions = {
1717
DB_PASS: Joi.string().required(),
1818
JWT_PUBLIC_KEY: Joi.string().required(),
1919
JWT_PRIVATE_KEY: Joi.string().required(),
20-
JWT_EXPIRES_IN: Joi.number().required(),
20+
JWT_EXPIRES_IN_SECONDS: Joi.number().required(),
2121
}),
2222
};

0 commit comments

Comments
 (0)