Skip to content

Commit f3018a0

Browse files
committed
feat(app): Error Handling WP
1 parent 077e368 commit f3018a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1364
-253
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ JWT_SECRET_KEY=my-secret
1010
API_SECRET_KEY=x-api-key
1111

1212
# WEBAPP
13-
AUTH_SECRET=auth-secret-key
13+
AUTH_SECRET=Z9y2X#mN7vB4cF6hJ1kL8pR3tQ5wS$aE
1414
WEBAPP_PROTOCOL=http
1515
WEBAPP_HOST=localhost
1616
WEBAPP_PORT=3000
@@ -31,3 +31,4 @@ POSTGRES_PASSWORD=admin123
3131
#DB_USER
3232
POSTGRES_MULTIPLE_DATABASES=users_db,tasks_db
3333
POSTGRES_USER_DATABASE=users_db
34+
POSTGRES_TASK_DATABASE=tasks_db

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ Work especially great to quickly kick off after creating a new branch.
1717
`mv .env.example .env.development` (development) </br>
1818
update that .env variables </br>
1919
`.env.development` -> `NODE_ENV=development` </br>
20-
`API_KEY`</br>
21-
`SUPABASE_DB_URL` </br>
22-
`SUPABASE_URL` </br>
23-
`SUPABASE_KEY` </br>
24-
AUTH_SECRET
20+
### Base setup for app
21+
```make setup```
2522

26-
### Base
2723

28-
```make setup```
24+
### RUN API
25+
26+
```pnpm run dev:api```
27+

apps/api-gateway/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"@app/constants": "workspace:*",
6464
"@app/eslint-config-nest": "workspace:*",
6565
"@app/tsconfig": "workspace:*",
66+
"@app/validators": "workspace:*",
6667
"@nestjs/cache-manager": "catalog:nestjs",
6768
"@nestjs/cli": "catalog:nestjs",
6869
"@nestjs/schematics": "catalog:nestjs",

apps/api-gateway/src/app.controller.spec.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

apps/api-gateway/src/app.controller.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/api-gateway/src/app.module.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ import { Module } from "@nestjs/common";
22

33
import { APICoreModule } from "@app/api-core";
44

5-
import { AppController } from "./app.controller";
6-
import { AppService } from "./app.service";
5+
import { AuthController } from "./controllers/auth.controller";
76

87
@Module({
98
imports: [APICoreModule],
10-
controllers: [AppController],
11-
providers: [AppService],
9+
controllers: [AuthController],
1210
})
1311
export class AppModule {}

apps/api-gateway/src/app.service.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Body, Controller, Post, UsePipes } from "@nestjs/common";
2+
3+
import {
4+
CustomNatsClient,
5+
NATS_MESSAGES,
6+
ZodValidationPipe,
7+
} from "@app/api-core";
8+
import { CreateUserDTO, createUserDtoSchema } from "@app/validators";
9+
10+
@Controller("auth")
11+
export class AuthController {
12+
constructor(private natsClient: CustomNatsClient) {}
13+
14+
@Post("signup")
15+
@UsePipes(new ZodValidationPipe(createUserDtoSchema))
16+
async signUp(@Body() createUserDTO: CreateUserDTO) {
17+
return await this.natsClient.send(
18+
{ cmd: NATS_MESSAGES.AUTH.SIGN_UP },
19+
createUserDTO,
20+
);
21+
}
22+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const nestConfig = require('@app/eslint-config-nest');
2+
3+
module.exports = {
4+
...nestConfig,
5+
parserOptions: {
6+
...nestConfig.parserOptions,
7+
project: './tsconfig.json',
8+
},
9+
};

apps/auth-microservice/.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

0 commit comments

Comments
 (0)