Skip to content

Commit

Permalink
project folder restructured
Browse files Browse the repository at this point in the history
  • Loading branch information
Olaoluwa402 committed May 7, 2024
1 parent 8a38e9e commit 0f59053
Show file tree
Hide file tree
Showing 113 changed files with 74 additions and 104 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

## Breakdown of Functionality:

- Agent Authentication and Authorization
- XBillpay Agent Wallet
- Bill Payment via Agent Wallet
- Wallet to Wallet Transfer
- Agent Authentication and Authorization
- XBillpay Agent Wallet
- Bill Payment via Agent Wallet
- Wallet to Wallet Transfer

## Design Microservices:

- Auth Service: Responsible for authentication and authorization of agents.
- Wallet Service: Manages agent wallets and wallet transactions.
- Payment Service: Handles bill payments.
- Transfer Service: Facilitates wallet-to-wallet transfers.
- Auth Service: Responsible for authentication and authorization of agents.
- Wallet Service: Manages agent wallets and wallet transactions.
- Payment Service: Handles bill payments.
- Transfer Service: Facilitates wallet-to-wallet transfers.

## start app

- clone repo: git clone git@github.com:Olaoluwa402/xbillpay-nestjs-microservice.git
- cd servers
- npm i
- create .env file in root dir. check env.example for env values
- start containers: docker compose up -d --build -V
- clone repo: git clone git@github.com:Olaoluwa402/xbillpay-nestjs-microservice.git
- cd servers
- npm i
- create .env file in root dir. check env.example for env values
- start containers: docker compose up -d --build -V

## api services url

- localhost/api
- localhost/wallet-api/api
- localhost/payment-api/api
- localhost/transfer-api/api
- localhost/api
- localhost/wallet-api/api
- localhost/payment-api/api
- localhost/transfer-api/api
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { IsEmail, IsNotEmpty, IsString, Length } from "class-validator";
import { ApiProperty } from '@nestjs/swagger';

export class LoginUserDto {
@ApiProperty()
@IsNotEmpty()
@IsString()
@IsEmail()
@ApiProperty()
email: string;

@ApiProperty()
@IsNotEmpty()
@IsString()
@Length(5, 20)
@ApiProperty()
password: string;
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import { IsEmail, IsNotEmpty, IsPhoneNumber, IsString, Length } from "class-validator";
import { IsEmail, IsNotEmpty, IsPhoneNumber, IsString, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class RegisterUserDto {

@ApiProperty()
@IsNotEmpty()
@IsString()
@ApiProperty()
firstName: string
firstName: string;

@ApiProperty()
@IsNotEmpty()
@IsString()
@ApiProperty()
lastName: string
lastName: string;

@ApiProperty()
@IsString()
@IsNotEmpty()
@ApiProperty()
phoneNumber: string;

@ApiProperty()
@IsNotEmpty()
@IsString()
@IsEmail()
@ApiProperty()
email: string;

@ApiProperty()
@IsNotEmpty()
@IsString()
@Length(5, 20)
@ApiProperty()
password: string;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { IsNotEmpty, IsNumber, IsString } from "class-validator";
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class FundWalletDto {
@ApiProperty()
@IsNotEmpty()
@IsNumber()
@ApiProperty()
amount: number
amount: number;
}

export class CompleteWalletFundingDto {
@ApiProperty()
@IsNotEmpty()
@IsString()
@ApiProperty()
paystackReference: string
paystackReference: string;
}

export class WalletToWalletTransferDto {
@ApiProperty()
@IsNotEmpty()
@IsNumber()
@ApiProperty()
amount: number
amount: number;

@ApiProperty()
@IsNotEmpty()
@IsNumber()
@ApiProperty()
receiverId: number
}
receiverId: number;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsNotEmpty, IsNumber, IsString } from "class-validator";
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';

export class CreateWalletDto {
@ApiProperty()
@IsNotEmpty()
@IsNumber()
userId: number;
}

export class FundWalletDto extends CreateWalletDto {
@ApiProperty()
@IsNotEmpty()
@IsNumber()
@ApiProperty()
amount: number;
}

export class WalletToWalletTransferDto {
@ApiProperty()
@IsNotEmpty()
@IsString()
@ApiProperty()
amount: number
amount: number;

@ApiProperty()
@IsNotEmpty()
@IsNumber()
@ApiProperty()
receiverId: number
receiverId: number;

@ApiProperty()
@IsNotEmpty()
@IsNumber()
@ApiProperty()
senderId: number
senderId: number;
}


export class GetWalletDto extends CreateWalletDto {
}
export class GetWalletDto extends CreateWalletDto {}

export class UpdateWalletBalanceDto extends CreateWalletDto {
@ApiProperty()
@IsNotEmpty()
@IsNumber()
@ApiProperty()
amount: number;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions servers/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ services:
- MYSQL_PASSWORD=xbillpay123
- MYSQL_TCP_PORT=3306

migrations:
build:
context: .
dockerfile: ./prisma/Dockerfile
env_file:
- ./.env
depends_on:
- mysql_db

nginx-proxy:
build:
dockerfile: Dockerfile
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions prisma/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:alpine As development

WORKDIR /usr/src/app

COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the Prisma service code into the container
COPY . .

# Command to run Prisma migration
CMD ["npx", "prisma", "migrate", "deploy", "--preview-feature"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 0 additions & 21 deletions servers/LICENSE.md

This file was deleted.

30 changes: 0 additions & 30 deletions servers/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.

0 comments on commit 0f59053

Please sign in to comment.