Skip to content

Commit

Permalink
feat: ddd init
Browse files Browse the repository at this point in the history
  • Loading branch information
de-novo committed Jun 16, 2024
1 parent 33ce62e commit 5d37337
Show file tree
Hide file tree
Showing 177 changed files with 10,688 additions and 2,716 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
# npx --no-install commitlint --edit $1
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run test
pnpm run lint-staged
# pnpm run test
# pnpm run lint-staged
166 changes: 95 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,97 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
</p>
```mermaid
classDiagram
class User {
+String id
+String nickname
+String phone
+String countryCode
+DateTime createdAt
+DateTime updatedAt
+DateTime? deletedAt
+Account account
+UserSnapshot[] snapshots
}
class Account {
+String id
+String account
+String password
+DateTime createdAt
+DateTime updatedAt
+DateTime? deletedAt
+User? user
+OAuth[] oAuths
}
class OAuth {
+String id
+String accountId
+OAUT_PROVIDER provider
+String providerId
+DateTime createdAt
+DateTime updatedAt
+Account account
}
class Certification {
+String id
+String certificationCodeId
+String userId
+CERTIFICATION_TARGET_TYPE targetType
+CERTIFICATION_TYPE type
+DateTime createdAt
+DateTime updatedAt
+User user
+CertificationCode certificationCode
}
class CertificationCode {
+String id
+CERTIFICATION_TARGET_TYPE targetType
+CERTIFICATION_TYPE type
+CERTIFICATION_STATUS status
+String code
+String target
+DateTime createdAt
+DateTime updatedAt
+DateTime expiredAt
+Certification? certifications
}
class TermsAgreements {
+String id
+String userId
+TERMS_TYPE type
+Boolean agree
+DateTime createdAt
+DateTime updatedAt
+User user
}
class UserSnapshot {
+String id
+String userId
+String nickname
+String phone
+String countryCode
+DateTime createdAt
+User user
}
%% Domains
%% Auth Domain
Account --|> User : contains
Account --|> OAuth : contains
%% User Domain
User --|> UserSnapshot : contains
%% Certification Domain
User --|> Certification : contains
Certification --|> CertificationCode : contains
%% TermsAgreements Domain
User --|> TermsAgreements : contains
[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.

## Installation

```bash
$ pnpm install
```

## Running the app

```bash
# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod
```

## Test

```bash
# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run 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).
11 changes: 11 additions & 0 deletions bruno/uncar/Auth/isLogin/islogin.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: islogin
type: http
seq: 1
}

get {
url: {{local}}/api/auth
body: none
auth: none
}
38 changes: 38 additions & 0 deletions bruno/uncar/Auth/login/local/local.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
meta {
name: local
type: http
seq: 1
}

post {
url: {{local}}/api/login
body: json
auth: none
}

headers {
x-app: app
}

body:json {
{
"account": "[email protected]",
"password": "test1234",
"type": "LOCAL"
}
}

script:post-response {
const body = res.getBody();

// let token = bru.setEnvVar("access_token", body.data.login.token);

console.log(req.headers)
if(req.headers['x-app']==='app'){

bru.setEnvVar("access_token", body.data.login.token);
}

console.log(body.result.accessToken)

}
16 changes: 16 additions & 0 deletions bruno/uncar/Auth/refresh/local.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: local
type: http
seq: 1
}

get {
url: {{local}}/api/auth
body: none
auth: none
}

headers {
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5Y2I5YjA1My1mODg0LTQxZDgtOWQ0MS0wZGM4ZGQ0NWRhOTMiLCJhY2NvdW50Ijoidm8wdjAwMDBAbmF2ZXIuY29tIiwiaWF0IjoxNzE2OTAzNTI4LCJleHAiOjE3MTgxOTk1Mjh9.NiOU2wk6TqjdjF0d7Lavx84GrTMMd-KC2b9iK121UME
~x-app: app
}
15 changes: 15 additions & 0 deletions bruno/uncar/Car/Create/http.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: http
type: http
seq: 1
}

post {
url: {{local}}/api/car
body: json
auth: bearer
}

auth:bearer {
token: {{access_token}}
}
18 changes: 18 additions & 0 deletions bruno/uncar/Car/RequestRental.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
meta {
name: RequestRental
type: http
seq: 1
}

post {
url: {{local}}/api/car/{{carId}}/rental
body: json
auth: none
}

body:json {
{
"startDate": new Date().toString(),
"endDate": new Date().toString()
}
}
20 changes: 20 additions & 0 deletions bruno/uncar/Certification/certificate-code/local.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: local
type: http
seq: 1
}

patch {
url: {{local}}/api/certification/
body: json
auth: none
}

body:json {
{
"type": "SIGN_UP",
"targetType": "PHONE",
"target": "+8201073616616",
"code": "950864"
}
}
20 changes: 20 additions & 0 deletions bruno/uncar/Certification/certificate-code/server.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: server
type: http
seq: 2
}

patch {
url: {{server}}/api/certification/
body: json
auth: none
}

body:json {
{
"type": "SIGN_UP",
"targetType": "PHONE",
"target": "+8201073616616",
"code": "636841"
}
}
19 changes: 19 additions & 0 deletions bruno/uncar/Certification/request-code/local.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
meta {
name: local
type: http
seq: 1
}

post {
url: {{local}}/api/certification
body: json
auth: none
}

body:json {
{
"type": "SIGN_UP",
"targetType":"PHONE",
"target":"+8201073616616"
}
}
23 changes: 23 additions & 0 deletions bruno/uncar/Certification/request-code/server.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
meta {
name: server
type: http
seq: 2
}

post {
url: {{server}}/api/certification
body: json
auth: none
}

headers {
Content-Type: application/json; charset=utf-8
}

body:json {
{
"type": "SIGN_UP",
"targetType":"PHONE",
"target":""
}
}
15 changes: 15 additions & 0 deletions bruno/uncar/Driving/start/start.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: start
type: http
seq: 1
}

post {
url: {{local}}/api/car/{{carId}}/driving
body: none
auth: bearer
}

auth:bearer {
token: {{access_token}}
}
Loading

0 comments on commit 5d37337

Please sign in to comment.