Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publishing the message after sending to sockets using the message queues #249

Merged
merged 12 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/real-plums-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@paybox/api": patch
"@paybox/backend-common": patch
---

feat: publishing the message after sending to sockets using the message queues and creating new Backend-common module
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,21 @@ jobs:

- name: Push @paybox/chat-zeus Docker image
run: docker push shawakash/paybox-chat-zeus:${{ github.sha }}

backend_common_image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build @paybox/backend-common Docker image
run: docker build -t shawakash/paybox-backend-common:${{ github.sha }} -f ./docker/backend-common/Dockerfile .

- name: Push @paybox/backend-common Docker image
run: docker push shawakash/paybox-backend-common:${{ github.sha }}
Binary file added .idea/copilot/chatSessions/00000000000.xd
Binary file not shown.
Binary file added .idea/copilot/chatSessions/blobs/version
Binary file not shown.
53 changes: 53 additions & 0 deletions .idea/copilot/chatSessions/xd.lck

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 31 additions & 17 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/web/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ node_modules
.build
.next
out
.env
dist
.DS_Store
npm-debug.log
yarn-error.log
2 changes: 2 additions & 0 deletions backend/api/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ node_modules
.build
.next
out
.env
dist
.DS_Store
npm-debug.log
yarn-error.log
1 change: 1 addition & 0 deletions backend/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@paybox/common": "^0.1.3",
"@paybox/kafka": "^2.0.1",
"@paybox/openapi": "^0.1.2",
"@paybox/backend-common": "*",
"@solana/spl-token": "^0.3.11",
"@solana/wallet-adapter-wallets": "^0.19.26",
"@solana/web3.js": "^1.89.0",
Expand Down
4 changes: 2 additions & 2 deletions backend/api/src/auth/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {
responseStatus,
} from "@paybox/common";
import { cache } from "..";
import { getAddressByClient } from "../db/qrcode";
import { getAddressByClient } from "@paybox/backend-common";
import { Address } from "web3";
import { getPassword, queryValid } from "../db/client";
import { getPassword, queryValid } from "@paybox/backend-common";
import { EthOps } from "../sockets/eth";
import { SolOps } from "../sockets/sol";
import rateLimit from "express-rate-limit";
Expand Down
1 change: 0 additions & 1 deletion backend/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import nodemailer from 'nodemailer';
import { S3Client } from '@aws-sdk/client-s3';


export * from "./db";
export * from "./Redis";
export * from "./auth";

Expand Down
8 changes: 4 additions & 4 deletions backend/api/src/routes/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
updateAccountName,
getAccount,
getAccounts,
} from "../db/account";
import { importFromPrivate, addAccountPhrase, getWalletForAccountCreate } from "../db/wallet";
} from "@paybox/backend-common";
import { importFromPrivate, addAccountPhrase, getWalletForAccountCreate } from "@paybox/backend-common";
import { cache } from "..";
import {
generateSeed,
getAccountOnPhrase,
validatePassword,
} from "../auth/util";
import { getPassword } from "../db/client";
import { getPassword } from "@paybox/backend-common";

Check warning

Code scanning / ESLint

disallow unused variables Warning

'getPassword' is defined but never used.
import { accountCreateRateLimit, checkPassword } from "../auth/middleware";
import { getSecretPhase } from "../db/wallet";
import { getSecretPhase } from "@paybox/backend-common";

Check warning

Code scanning / ESLint

disallow unused variables Warning

'getSecretPhase' is defined but never used.
import { SolOps } from "../sockets/sol";
import { EthOps } from "../sockets/eth";
import { INFURA_PROJECT_ID } from "../config";
Expand Down
2 changes: 1 addition & 1 deletion backend/api/src/routes/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createAddress,
getAddressByClientId,
updateAddress,
} from "../db/address";
} from "@paybox/backend-common";
import { dbResStatus } from "../types/client";
import { cache } from "../index";

Expand Down
2 changes: 1 addition & 1 deletion backend/api/src/routes/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
updateMetadata,
updatePassword,
validateClient,
} from "../db/client";
} from "@paybox/backend-common";
import { cache } from "../index";
import {
genOtp,
Expand Down
4 changes: 2 additions & 2 deletions backend/api/src/routes/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
responseStatus,
} from "@paybox/common";
import { Router } from "express";
import { getAllTxn, getTxnByHash, getTxns, insertTxn } from "../db/transaction";
import { getAllTxn, getTxnByHash, getTxns, insertTxn } from "@paybox/backend-common";

Check warning

Code scanning / ESLint

disallow unused variables Warning

'insertTxn' is defined but never used.
import { cache } from "..";
import { txnCheckAddress } from "../auth/middleware";
import { dbResStatus } from "../types/client";
import { publishEthTxn, publishSolTxn } from "../../../../packages/kafka/src";
import { publishEthTxn, publishSolTxn } from "@paybox/kafka";
import { Cluster } from "@solana/web3.js";
import { EthOps } from "../sockets/eth";
import { INFURA_PROJECT_ID } from "../config";
Expand Down
2 changes: 1 addition & 1 deletion backend/api/src/routes/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
dbResStatus,
responseStatus,
} from "@paybox/common";
import { delWallet, getAccountsFromWalletId, getSecretPhase, getWallets } from "../db/wallet";
import { delWallet, getAccountsFromWalletId, getSecretPhase, getWallets } from "@paybox/backend-common";
import { cache } from "..";

export const walletRouter = Router();
Expand Down
9 changes: 9 additions & 0 deletions backend/backend-common/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
.build
.next
out
.env
dist
.DS_Store
npm-debug.log
yarn-error.log
24 changes: 24 additions & 0 deletions backend/backend-common/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
HASURAL_URL=
AUTH_JWT=
AUTH_JWT_PUBLIC_KEY=
AUTH_JWT_PRIVATE_KEY=
REDIS_URL=
GOERLI_URL=
SOLANA_ADDRESS=
ETH_ADDRESS=
INFURA_PROJECT_ID=
SEPOLIA_URL=
SEPOLIA_URL_HTTP=
BTC_ADDRESS=
TWILLO_ACCOUNT_SID=
TWILLO_TOKEN=
TWILLO_NUMBER=
REDIS_SECRET=04eec09f
GMAIL_APP_PASS=
GMAIL=
MAIL_SERVICE=
R2_ACCESS_KEY_ID=
R2_SECRET_ACCESS_KEY=
R2_ACCOUNT_ID=
R2_TOKEN=
PROCESS=
34 changes: 34 additions & 0 deletions backend/backend-common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

build
/dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

# vercel
.vercel
13 changes: 13 additions & 0 deletions backend/backend-common/.yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# backend/ws/.yarnrc

# Use Workspaces (if needed, though it's typically inherited)
workspaces-experimental true

"@paybox:registry" "https://registry.yarnpkg.com/"

# Specify private registry for private packages
# "@paybox:registry" "https://your-private-registry-url/"

# Use selective version resolutions if needed
# For example, to specify a different version of a package for this workspace
# "@paybox/ws" "1.0.0"
Loading
Loading