Skip to content

Commit

Permalink
tak się wszystko zaczęło
Browse files Browse the repository at this point in the history
  • Loading branch information
ahanusek committed Feb 6, 2022
1 parent 522ba41 commit a82e8dd
Show file tree
Hide file tree
Showing 100 changed files with 6,630 additions and 114 deletions.
4 changes: 4 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DATABASE_NAME=
DATABASE_PORT=
DATABASE_USERNAME=
DATABASE_PASSWORD=
7 changes: 5 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ module.exports = {
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/explicit-member-accessibility': [
2,
{ overrides: { constructors: 'off' } },
],
},
};
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ lerna-debug.log*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/extensions.json
.env
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn tsc
yarn format
yarn lint
71 changes: 23 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,48 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
### Fork of legacyfighter/cabs-java to Nest.js (TypeScript / Node)
____

# Rozwój kodu

Kod będzie rozwijać się wraz z cotygodniową narracją szkoleniową.
Zarówno pojawiać się w nim będą kolejne poprawki jak i odziedziczone po firmach partnerskich nowe moduły ;-) Jak to w prawdziwym legacy.

# Przeglądanie kodu

Poszczególne kroki refaktoryzacyjne najlepiej przeglądać używająć tagów. Każdy krok szkoleniowy, który opisany jest w odcinku Legacy Fighter posiada na końcu planszę z nazwą odpowiedniego taga. Porównać zmiany można robiąc diffa w stosunku do poprzedniego taga z narracji.


_____________



## Installation

```bash
$ npm install
$ yarn install
```

## Running the app

```bash
# development
$ npm run start
$ yarn start

# watch mode
$ npm run start:dev
$ yarn start:dev

# production mode
$ npm run start:prod
$ yarn start:prod
```

## Test

```bash
# unit tests
$ npm run test
$ yarn test

# e2e tests
$ npm run test:e2e
$ yarn test:e2e

# test coverage
$ npm run test:cov
$ yarn test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,43 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
"test:e2e": "jest --config ./test/jest-e2e.json",
"prepare": "husky install",
"check-types": "tsc"
},
"dependencies": {
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^1.1.6",
"@nestjs/core": "^8.0.0",
"@nestjs/platform-express": "^8.0.0",
"@nestjs/typeorm": "^8.0.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"dayjs": "^1.10.7",
"lodash.orderby": "^4.6.0",
"object-hash": "^2.2.0",
"pg": "^8.7.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0"
"rxjs": "^7.2.0",
"typeorm": "^0.2.41"
},
"devDependencies": {
"@nestjs/cli": "^8.0.0",
"@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^8.0.0",
"@types/express": "^4.17.13",
"@types/jest": "27.0.2",
"@types/lodash.orderby": "^4.6.6",
"@types/node": "^16.0.0",
"@types/object-hash": "^2.2.1",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jest": "^27.2.5",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
Expand Down
22 changes: 0 additions & 22 deletions src/app.controller.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/app.controller.ts

This file was deleted.

118 changes: 113 additions & 5 deletions src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,118 @@
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ConfigModule } from '@nestjs/config';
import { DriverController } from './controllers/driver.controller';
import { DriverService } from './service/driver.service';
import { DriverRepository } from './repository/driver.repository';
import { AppProperties } from './config/app-properties.config';
import { CarTypeRepository } from './repository/car-type.repository';
import { CarTypeController } from './controllers/car-type.controller';
import { CarTypeService } from './service/car-type.service';
import { DistanceCalculator } from './service/distance-calculator.service';
import { InvoiceRepository } from './repository/invoice.repository';
import { InvoiceGenerator } from './service/invoice-generator.service';
import { DriverNotificationService } from './service/driver-notification.service';
import { GeocodingService } from './service/geocoding.service';
import { ClaimNumberGenerator } from './service/claim-number-generator.service';
import { ClaimRepository } from './repository/claim.repository';
import { ClientNotificationService } from './service/client-notification.service';
import { ClientService } from './service/client.service';
import { ClientRepository } from './repository/client.repository';
import { ClientController } from './controllers/client.controller';
import { DriverSessionService } from './service/driver-session.service';
import { DriverSessionRepository } from './repository/driver-session.repository';
import { DriverSessionController } from './controllers/driver-session.controller';
import { DriverFeeRepository } from './repository/driver-fee.repository';
import { TransitRepository } from './repository/transit.repository';
import { DriverFeeService } from './service/driver-fee.service';
import { DriverPositionRepository } from './repository/driver-position.repository';
import { DriverTrackingService } from './service/driver-tracking.service';
import { DriverTrackingController } from './controllers/driver-tracking.controller';
import { ClaimAttachmentRepository } from './repository/claim-attachment.repository';
import { AddressRepository } from './repository/address.repository';
import { DriverAttributeRepository } from './repository/driver-attribute.repository';
import { AwardedMilesRepository } from './repository/awarded-miles.repository';
import { AwardsAccountRepository } from './repository/awards-account.repository';
import { ContractAttachmentRepository } from './repository/contract-attachment.repository';
import { ContractRepository } from './repository/contract.repository';
import { TransitAnalyzerService } from './service/transit-analyzer.service';
import { AwardsService } from './service/awards.service';
import { ClaimService } from './service/claim.service';
import { ContractService } from './service/contract.service';
import { TransitService } from './service/transit.service';
import { TransitAnalyzerController } from './controllers/transit-analyzer.controller';
import { TransitController } from './controllers/transit.controller';
import { AwardsAccountController } from './controllers/awards-account.controller';
import { ClaimController } from './controllers/claim.controller';
import { ContractController } from './controllers/contract.controller';
import { DriverReportController } from './controllers/driver-report.controller';

@Module({
imports: [],
controllers: [AppController],
providers: [AppService],
imports: [
ConfigModule.forRoot(),
TypeOrmModule.forRoot({
type: 'postgres',
host: 'localhost',
port: process.env.DATABASE_PORT
? parseInt(process.env.DATABASE_PORT, 10)
: 3456,
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
autoLoadEntities: true,
synchronize: true,
}),
TypeOrmModule.forFeature([
DriverRepository,
CarTypeRepository,
InvoiceRepository,
ClaimRepository,
ClientRepository,
DriverSessionRepository,
DriverFeeRepository,
TransitRepository,
DriverPositionRepository,
ClaimAttachmentRepository,
AddressRepository,
DriverAttributeRepository,
AwardedMilesRepository,
AwardsAccountRepository,
ContractAttachmentRepository,
ContractRepository,
]),
],
controllers: [
DriverController,
CarTypeController,
ClientController,
DriverSessionController,
DriverTrackingController,
TransitAnalyzerController,
TransitController,
AwardsAccountController,
ClaimController,
ContractController,
DriverReportController,
],
providers: [
AppProperties,
DriverService,
CarTypeService,
DistanceCalculator,
InvoiceGenerator,
DriverNotificationService,
GeocodingService,
ClaimNumberGenerator,
ClientNotificationService,
ClientService,
DriverSessionService,
DriverFeeService,
DriverTrackingService,
TransitAnalyzerService,
AwardsService,
ClaimService,
ContractService,
TransitService,
],
})
export class AppModule {}
8 changes: 0 additions & 8 deletions src/app.service.ts

This file was deleted.

10 changes: 10 additions & 0 deletions src/common/base.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PrimaryGeneratedColumn } from 'typeorm';

export class BaseEntity {
@PrimaryGeneratedColumn('uuid')
protected id: string;

public getId(): string {
return this.id;
}
}
Loading

0 comments on commit a82e8dd

Please sign in to comment.