generated from jackyzha0/quartz
-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
23 changed files
with
1,209 additions
and
228 deletions.
There are no files selected for viewing
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,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.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
content/Projects/GC/API Reference/Authentication, Verification, Sign In.md
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 @@ | ||
|
||
![[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> |
This file was deleted.
Oops, something went wrong.
171 changes: 171 additions & 0 deletions
171
content/Projects/GC/API Reference/Quickstart/Codebase Infrastructure.md
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,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. |
Oops, something went wrong.