-
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 6ed8bb6
Showing
20 changed files
with
160 additions
and
55 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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v22.2.0 |
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 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:deps": "pnpm --filter api install", | ||
"api:dev": "pnpm --filter api run start:dev", | ||
"api:build": "pnpm --filter api run build", | ||
"api:prod": "pnpm --filter api run start:prod", | ||
"client:deps": "pnpm --filter client install", | ||
"client:dev": "pnpm --filter client run dev", | ||
"client:build": "pnpm --filter client run build", | ||
"client:prod": "pnpm --filter client run start", | ||
"all: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
Oops, something went wrong.