Skip to content

Commit

Permalink
vault backup: 2024-12-25 20:35:49
Browse files Browse the repository at this point in the history
  • Loading branch information
majorbruteforce committed Dec 25, 2024
2 parents 1f6363e + bcc74fa commit f5fd585
Show file tree
Hide file tree
Showing 23 changed files with 1,209 additions and 228 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Release

on:
push:
branches:
- v4

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Generate Release Name
id: release_name
run: |
# Get the current date in the desired format
release_date=$(date +"%Y-%m-%d")
release_name="⚡ Release $release_date"
echo "Generated release name: $release_name"
# Set the release name as an output
echo "::set-output name=name::$release_name"
- name: Create a Release
uses: elgohr/Github-Release-Action@v5
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: ${{ steps.release_name.outputs.name }}
tag_name: ${{ steps.release_name.outputs.name }}
Empty file removed General/Best.md
Empty file.
Binary file added content/Assets/Screencast_20241216_145154.webm
Binary file not shown.
Binary file added content/Gateways_POC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/Pasted image 20241216131459.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/Pasted image 20241216131525.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/Pasted image 20241216131541.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/Pasted image 20241216161236.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/Pasted image 20241216161421.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

![[Pasted image 20241216161236.png]]
## Send OTP

This endpoint sends a One-Time Password (OTP) to a specified email address. It is used for email verification and authentication purposes.

<a href="https://hopp.sh/r/L1npJmJkV2an"><img src="https://hopp.sh/badge.svg" alt="Run in Hoppscotch" /></a>
## Create Account

This endpoint is used to create a new user account by providing essential user details like name, email, password, and OTP.

<a href="https://hopp.sh/r/jtSbvtJgF7XL"><img src="https://hopp.sh/badge.svg" alt="Run in Hoppscotch" /></a>

## Verify

This endpoint verifies the OTP sent to the user's email. It ensures that the OTP entered by the user matches the one sent for validation.

<a href="https://hopp.sh/r/eidIMlbg6jYp"><img src="https://hopp.sh/badge.svg" alt="Run in Hoppscotch" /></a>

# Sign In

This endpoint is used for user login. It takes the user's credentials, including email and password, to authenticate the user and generate a session or token.

<a href="https://hopp.sh/r/JGq6M414xGt9"><img src="https://hopp.sh/badge.svg" alt="Run in Hoppscotch" /></a>
1 change: 0 additions & 1 deletion content/Projects/GC/API Reference/Authentication.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
### **Tree Structure of the Repository**

```
.
├── .env
├── .eslintrc.js
├── .gitignore
├── .prettierrc
├── LICENSE
├── README.md
├── nest-cli.json
├── package.json
├── package-lock.json
├── tsconfig.build.json
├── tsconfig.json
├── yarn.lock
├── env/
│ ├── Dockerfile
│ ├── env.development.txt
│ ├── env.production.txt
│ └── index.js
├── generate/
│ ├── controller.js
│ ├── controller.spec.js
│ ├── createFileWithContent.js
│ ├── dto.js
│ ├── index.js
│ ├── module.js
│ ├── schema.js
│ ├── service.js
│ └── service.spec.js
├── src/
│ ├── app.controller.ts
│ ├── app.controller.spec.ts
│ ├── app.module.ts
│ ├── app.service.ts
│ ├── common/
│ │ ├── EnsureObjectId.ts
│ │ ├── featherify.ts
│ │ ├── generate-random-number.ts
│ │ ├── get-class-properties.ts
│ │ ├── global-service.ts
│ │ ├── mailer.ts
│ │ ├── options.ts
│ │ ├── query.utils.ts
│ │ └── soft-delete-schema.ts
│ ├── constants/
│ │ └── roles-enum.ts
│ ├── decorators/
│ │ └── ModifyBody.decorator.ts
│ ├── filters/
│ │ ├── global-exception.filter.ts
│ │ └── mongo-error.filter.ts
│ ├── main.ts
│ ├── services/
│ │ ├── apis/
│ │ │ ├── auth/
│ │ │ ├── mailer/
│ │ │ ├── otp/
│ │ │ ├── redis/
│ │ │ ├── sendOtp/
│ │ │ └── users/
│ │ └── gateways/
│ │ └── presence/
│ ├── types/
│ ├── PaginatedResponse.d.ts
│ ├── QueryOptions.d.ts
│ ├── SocketClient.d.ts
│ └── SocketIOMiddleware.d.ts
└── test/
├── app.e2e-spec.ts
└── jest-e2e.json
```

---

### **Documentation of Folders and Files**

#### **Root Files**

- **`.env`**: Contains environment variable configurations.
- **`.eslintrc.js`**: ESLint configuration file for enforcing code style and linting rules.
- **`.gitignore`**: Specifies files and directories to be ignored by Git.
- **`.prettierrc`**: Configuration file for Prettier, a code formatting tool.
- **`LICENSE`**: Specifies the license under which the project is distributed.
- **`README.md`**: Provides an overview of the project, setup instructions, and usage details.
- **`nest-cli.json`**: Configuration for NestJS CLI tools.
- **`package.json`** and **`yarn.lock`**: Manage project dependencies and scripts.
- **`tsconfig.json`** and **`tsconfig.build.json`**: TypeScript configurations for development and production builds.

---

#### **`env/`**

Contains environment-specific configurations:

- **`Dockerfile`**: Used to containerize the application.
- **`env.development.txt`** and **`env.production.txt`**: Store environment-specific variables.
- **`index.js`**: A utility script for loading environment configurations.

---
#### **`generate/`**

The `generate` folder automates the creation of CRUD APIs in a NestJS project. By running a simple command like:

```bash
yarn generate studentsApi
```

developers can quickly generate essential components such as controllers, services, modules, DTOs, and schemas. This speeds up development, ensures consistency, and reduces boilerplate code, allowing developers to focus on business logic rather than repetitive setup tasks.

**Warning:** Currently, the `generate` script cannot generate gateways or custom APIs.

- **`controller.js`**: Script to generate a new controller file.
- **`controller.spec.js`**: Script to generate test files for controllers.
- **`createFileWithContent.js`**: Helper to create a file with pre-defined content.
- **`dto.js`**: Script to generate a Data Transfer Object (DTO).
- **`index.js`**: Entry point for the generator scripts.
- **`module.js`**: Script to generate a new module file.
- **`schema.js`**: Script to generate schema definitions.
- **`service.js`**: Script to generate service files.
- **`service.spec.js`**: Script to generate test files for services.

![Video](Assets/Screencast_20241216_145154.webm)

---

#### **`src/`**

The main source code directory for the application:

- **`app.controller.ts`**: Handles HTTP requests for the root application route.
- **`app.module.ts`**: Root module of the application.
- **`app.service.ts`**: Core application logic.
- **`main.ts`**: Entry point for the NestJS application.

##### **Subfolders in `src/`**

1. **`common/`**:

- Utility functions, reusable components, and shared services (e.g., `mailer.ts` for sending emails, `soft-delete-schema.ts` for handling soft deletes),etc.
2. **`constants/`**:

- **`roles-enum.ts`**: Enum definitions for user roles.
3. **`decorators/`**:

- **`ModifyBody.decorator.ts`**: Custom decorators for request body modification.
4. **`filters/`**:

- Exception and error-handling filters like `global-exception.filter.ts`.
5. **`services/`**:

- **`apis/`**:
- `auth/`: Handles authentication logic.
- `mailer/`: Email-sending services.
- `otp/`: OTP generation and verification logic.
- `redis/`: Redis adapter services.
- `sendOtp/`: Dedicated OTP sending service.
- `users/`: User management, including schemas, decorators, and guards.
- **`gateways/`**:
- `presence/`: Manages WebSocket-based presence events.
6. **`types/`**:

- TypeScript type definitions (e.g., `SocketClient.d.ts`, `QueryOptions.d.ts`).

---

#### **`test/`**

- **`app.e2e-spec.ts`**: End-to-end test for the application.
- **`jest-e2e.json`**: Jest configuration for E2E tests.
Loading

0 comments on commit f5fd585

Please sign in to comment.