Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthew-nguyen-20032023/salary-hero-backend
Salary Payment Project
https://github.com/matthew-nguyen-20032023/salary-hero-backend
docker-compose kafkajs nestjs nodejs pm2 postgresql salary-calculator swagger task-scheduler typeorm
Last synced: about 2 months ago
JSON representation
Salary Payment Project
- Host: GitHub
- URL: https://github.com/matthew-nguyen-20032023/salary-hero-backend
- Owner: matthew-nguyen-20032023
- License: mit
- Created: 2024-03-19T18:06:46.000Z (9 months ago)
- Default Branch: prod
- Last Pushed: 2024-03-27T15:37:03.000Z (9 months ago)
- Last Synced: 2024-03-27T16:52:37.724Z (9 months ago)
- Topics: docker-compose, kafkajs, nestjs, nodejs, pm2, postgresql, salary-calculator, swagger, task-scheduler, typeorm
- Language: TypeScript
- Homepage:
- Size: 307 KB
- Stars: 18
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest# Salary Hero Backend
## Description
Salary payment project support partner register, config and manage their worker account,
their worker salary and formula. From that, worker salary will be calculated
automatically every day, every month and worker can manage
their money.## Design
### Basic High Level Design Overview
![alt text](https://github.com/matthew-nguyen-20032023/salary-hero-backend/blob/dev/docs/images/overview-system/high-level-design.png?raw=true)
### Low Level Design With AWS Cloud
![alt text](https://github.com/matthew-nguyen-20032023/salary-hero-backend/blob/dev/docs/images/overview-system/low-level-design-with-aws-cloud.png?raw=true)## Required
Node version v16.20.1
Yarn version 1.22.19
Docker version 20.10.21, build 20.10.21-0ubuntu1~22.04.3
docker-compose version 1.29.2, build unknown
PM2 version 5.3.0 => Only for Quick Start
## Quick Start Or Manual Setup Guide Below
```bash
# Make sure you have full required above
# Important: make sure that list port here available on your machine
# List port: 9092, 6379, 5432, 2181, 3000, 3001
# Or you can change value from .env.example for another port
$ sudo chmod -R 777 ./quick_start.sh
$ ./quick_start.sh
```## Manual Setup
### Setup components
```bash
# Preparing
$ yarn # install lib dependencies
$ cp .env.example .env # init .env file (change information if you want to)
$ docker-compose up -d # init services component (depend on .env file, noted new docker version run docker compose up -d)
$ yarn build # build migration file to migrate
$ npm run typeorm:run # migrate database schema
$ npm run typeorm:test # migrate testing database schema
$ yarn console:dev seeding-data # seeding data for develop
```
### Run Backend
```bash
# For development run
$ yarn start:dev
#-----------------------------#
# Or for production run
$ yarn build
$ yarn start:prod
```
### Background Job Handle worker salary calculation
```bash
# For development run
$ yarn console:dev calculate-worker-salary
#-----------------------------#
# For production run
$ node dist/src/console.js calculate-worker-salary
```### Note
After full setup and seeding data, we have some account seeded
AdminAccount: [email protected]
PartnerAccount: [email protected]
WorkerAccount: [email protected]
Password for all: admin@123
API Swagger: http://localhost:3000/api/docs/### Testing
```bash
$ yarn test
```## Some Feature Can Implement In The Future
- OTP to withdraw or transfer money for worker## Repository Activity
![Alt](https://repobeats.axiom.co/api/embed/1929095ae8b4fb2d5d5dbc561ad4e906db6dd2b7.svg "Repobeats analytics image")
## LicenseNest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).