-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9fb86f
commit b5ff5a9
Showing
17 changed files
with
148 additions
and
40 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v22.2.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"name": "4-growth", | ||
"version": "1.0.0", | ||
"description": "4-growth mono-repo", | ||
"description": "4-growth platform", | ||
"scripts": { | ||
"start:api:dev": "pnpm --filter api run start:dev", | ||
"start:client:dev": "pnpm --filter client run dev", | ||
"install:client": "pnpm --filter client install", | ||
"install:api": "pnpm --filter api install", | ||
"build:client": "pnpm --filter client run build", | ||
"build:api": "pnpm --filter api run build", | ||
"start:client:prod": "pnpm --filter client run start", | ||
"start:api:prod": "pnpm --filter api run start:prod", | ||
"start:prod": "pnpm run build:client && pnpm run build:api && pnpm run start:client:prod & pnpm run start:api:prod" | ||
} | ||
"api:install": "pnpm --filter api install", | ||
"api:start:dev": "pnpm --filter api run start:dev", | ||
"api:build": "pnpm --filter api run build", | ||
"api:start:prod": "pnpm --filter api run start:prod", | ||
"client:install": "pnpm --filter client install", | ||
"client:start:dev": "pnpm --filter client run dev", | ||
"client:build": "pnpm --filter client run build", | ||
"client:start:prod": "pnpm --filter client run start", | ||
"all:start:prod": "pnpm run build:client && pnpm run build:api && pnpm run start:client:prod & pnpm run start:api:prod" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin'], | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
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', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
import { initContract } from "@ts-rest/core"; | ||
import { User } from "@shared/dto/users/user.entity"; | ||
import { UpdateUserDto } from "@shared/dto/users/update-user.dto"; | ||
import { CreateUserDto } from "@shared/dto/users/create-user.dto"; | ||
import { initContract } from '@ts-rest/core'; | ||
import { User } from '@shared/dto/users/user.entity'; | ||
import { UpdateUserDto } from '@shared/dto/users/update-user.dto'; | ||
import { CreateUserDto } from '@shared/dto/users/create-user.dto'; | ||
|
||
import * as z from 'zod'; | ||
|
||
const contract = initContract(); | ||
export const userContract = contract.router({ | ||
createUser: { | ||
method: "POST", | ||
path: "/users", | ||
method: 'POST', | ||
path: '/users', | ||
responses: { | ||
201: contract.type<CreateUserDto>(), | ||
}, | ||
body: contract.type<User>(), | ||
summary: "Create a new user", | ||
summary: 'Create a new user', | ||
}, | ||
updateUser: { | ||
method: "PUT", | ||
path: "/users/:id", | ||
method: 'PUT', | ||
path: '/users/:id', | ||
responses: { | ||
200: contract.type<User>(), | ||
}, | ||
body: contract.type<UpdateUserDto>(), | ||
summary: "Update an existing user", | ||
summary: 'Update an existing user', | ||
}, | ||
getUsers: { | ||
method: 'GET', | ||
path: '/users', | ||
responses: { | ||
200: contract.type<User[]>(), | ||
}, | ||
query: z.object({ | ||
take: z.string().transform(Number).optional(), | ||
skip: z.string().transform(Number).optional(), | ||
search: z.string().optional(), | ||
}), | ||
summary: 'Get all users', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
{ | ||
"name": "shared", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@ts-rest/core": "^3.45.2", | ||
"@typescript-eslint/eslint-plugin": "7.9.0", | ||
"@typescript-eslint/parser": "7.9.0", | ||
"class-transformer": "^0.5.1", | ||
"class-validator": "^0.14.1", | ||
"config": "^3.3.11", | ||
"eslint": "^8.42.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"typeorm": "^0.3.20", | ||
"zod": "^3.23.8", | ||
"class-transformer": "^0.5.1", | ||
"class-validator": "^0.14.1" | ||
"zod": "^3.23.8" | ||
} | ||
} |