Giter VIP home page Giter VIP logo

payroll-smb's Introduction

Payroll SMB

The Payroll SMB application provides a solution for employers and employees to calculate salaries and taxes based on the laws of the chosen country.

Key features

  • UI Responsive Design
  • Multi-tenant architecture
  • Mono-repository, shared types libs between back-end and front-end apps
  • REST API documented in Open API by Swagger
  • Role-based access, JWT authorization
  • Event-driven calculate processing
  • Automatic documents prepared according to the business process schedule
  • Automatic update of data on the client after the completion of the batch calculation on the server

Start the application

Production mode

npm i && npm run build && npm start

In Production mode frontend and backend applications works on the same port:

Development mode

npm i && npm run build && npm run dev

In Development mode frontend and backend applications works on the different ports:

By Docker

# Build and start application
git clone https://github.com/serhii-untilov/Payroll.git
cd Payroll
docker compose build
./start
# Stop application
docker compose down

Configuration

On a production server, copy .env.production file to .env.locale, replace environment variables in the .env.locale file and start the application.

In development mode:

  • copy apps/api/.env to apps/api/.env.locale
  • copy apps/web/.env.development to apps/web/.env.locale

replace environment variables in *.locale files and run the application.

Domain-specific language (DSL)

English Ukrainian Short form Description
Admin Адміністратор admin
User Користувач user
Owner Власник owner
Employer Роботодавець employer
Supervisor Керівник supervisor
Accountant Бухгалтер accountant
Collaborator Співробітник collaborator Помічник, асистент (assistant)
Employee Працівник employee Штатний працівник підприємства, співробітник
Contractor Підрядник contractor Позаштатний працівник, тимчасовий, не постійний, на разову роботу
Advisor Консультант advisor
Observer Спостерігач observer
Guest Гість guest
Company Підприємство company
Tax ID Податковий номер taxId
Law Законодавство law
Accounting type Вид обліку accounting
Payment schedule Розклад виплат paymentSchedule Every 15th and last day of month, Last day of month, First day of the next month
Accounting period Обліковий період accPeriod Період за який нараховано (1С)
Payment period Розрахунковий період payPeriod Період в якому розраховано (1С)
Check date Дата виплати checkDate
Position Штатна одиниця position
Placement Призначення placement Призначення на посаду, окладу, і т.і.
Card Number Табельний номер cardNumber Номер картки у зовнішніх системах (кадровий облік, тощо) зберігати окремо
Sequence Number Порядковий номер sequenceNumber The sequence number in payroll reports to place managers on top
Department Підрозділ department
Job Посада job
Vacancy Вакансія vacancy
Working time norm Норма робочого часу workNorm
Working time calendar Виробничий календар workCalendar
Work Schedule Розклад роботи workSchedule
Work Sheet Табель робочого часу workSheet
Work Sheet Табель робочого часу workSheet
Incoming balance Вхідний залишок inBalance
Accrual Нарахування accrual
Deduction Утримання deduction
Tax Податок tax
Net pay До виплати netPay
Payment Виплата payment
Outgoing balance Вихідний залишок outBalance
Compensation Основна зарплата compensation
Additional Earnings Додаткова зарплата additionalEarnings
Bonus Премія bonus
Commission Винагорода commission Винагорода по завершенню робіт
Payment Type Вид оплати paymentType
Calculate Method Метод розрахунку calcMethod
Payment Method Метод виплати paymentMethod Direct Deposit (Банк)
Recurring Reimbursement Періодичне відшкодування reimbursement Компенсація податку, мобільного зв'язку, проживання, тощо.
Garnishment Штраф, арешт на зарплату garnishment Обов'язкове відшкодування за рішенням суду, тощо.
Custom deduction Відрахування customDeduction Відрахування із заробітної плати за бажанням працівника
Withholding Утримання withholding Утримання із зарплати за рішенням або за умовами роботодавця, додатковий податок
Additional Earnings Додатковий заробіток additionalEarnings Надбавки, премії, доплати, приробіток
Job & Pay Робота і оплата jobAndPay
Start Date Дата прийому на роботу dateFrom
Dismissal Date Дата звільнення dateTo
Assignment Призначення assignment Призначення працівника на посаду, призначення окладу, тощо.
Assignments History Історія призначень assignmentsHistory
Additional Earning Додаткове нарахування additionalEarning
Additional Deduction Додаткове утримання additionalDeduction
Tax exemption Податкова пільга taxExemption
Deferred income Доходи майбутніх періодів deferredIncome
Account Number Розрахунковий рахунок accountNumber Розрахунковий рахунок у банку
Routing Number Код банку routingNumber Код банку
Account Type Тип розрахункового рахунку accountType Поточний
Checking account Поточний рахунок checkingAccount Поточний розрахунковий рахунок
Total Earned Разом нараховано totalEarned
Total Deducted Разом утримано totalDeducted
Unified Social Contribution Єдиний соціальний внесок fundECB
Cancel Сторно cancel, cancelId Cancelled - сторновано, скасовано
Company Debt Борг підприємства companyDebt
Employee Debt Борг працівника employeeDebt
USC ЄСВ ECB Unified Social Contribution - Єдиний соціальний внесок
Min Wage Мінімальна зарплата minWage Мінімальна зарплата
USC to the minimum wage ЄСВ доплата до мін ЗП minWageECB Supplement to the minimum wage - Доплата до мінімальної зарплати
Max base USC Максимальна баз ЄСВ maxBaseECB Максимальна сума оподаткування ЄСВ
Advance Payment Виплата авансу advancePayment
Regular Payment Виплата зарплати regularPayment
Fast Payment Виплата у міжрозрахунок fastPayment Виплата у міжрозрахунковий період: оплата відпустки, розрахунок при звільненні
Overdue Tasks Прострочені задачі overdueTasks

Development

Initial script

# Create project
mkdir nest-react
cd nest-react
npm install -D turbo
npm i -g @nestjs/cli@latest
cd apps
nest new api
npm create vite@latest web
cd ..
npm install
npm run dev
npm run build

# Init "api" application for back-end
npm i --workspace @repo/api --save @nestjs/serve-static
npm i --workspace @repo/api --save-dev bcrypt
npm i --workspace @repo/api --save @nestjs/passport @nestjs/jwt passport-jwt
npm i --workspace @repo/api --save-dev @types/passport-jwt
npm i --workspace @repo/api --save dotenv
npm i --workspace @repo/api --save-dev typescript jest ts-jest @types/jest
npm i --workspace @repo/api --save date-fns
npm i --workspace @repo/api --save-dev @golevelup/ts-jest
npm i --workspace @repo/api --save-dev webpack-node-externals run-script-webpack-plugin webpack
npm i --workspace @repo/api --save-dev webpack webpack-cli
npm i --workspace @repo/api --save @nestjs/event-emitter
npm i --workspace @repo/api --save-dev tsconfig-paths

# Init "web" application for front-end
#npm i --workspace @repo/web --save react-query
npm --workspace @repo/web i @tanstack/react-query
npm i --workspace @repo/web --save axios
npm i --workspace @repo/web --save react-router-dom
npm i --workspace @repo/web --save react-hook-form
npm i --workspace @repo/web --save @mui/material @emotion/react @emotion/styled
npm i --workspace @repo/web --save @fontsource/roboto
npm i --workspace @repo/web --save @mui/icons-material
npm i --workspace @repo/web --save @mui/x-data-grid
# npm i --workspace @repo/web --save @mui/x-date-pickers
# npm i --workspace @repo/web --save moment
npm i --workspace @repo/web --save notistack
npm i --workspace @repo/web --save-dev typescript jest ts-jest @types/jest
npm i --workspace @repo/web --save avvvatars-react
npm i --workspace @repo/web --save react-i18next i18next
npm i --workspace @repo/web --save i18next-browser-languagedetector
npm i --workspace @repo/web --save @hookform/resolvers yup
npm i --workspace @repo/web --save material-ui-popup-state
npm i --workspace @repo/web --save i18next-http-backend
npm i --workspace @repo/web --save-dev rollup-plugin-visualizer
npm i --workspace @repo/web --save react-error-boundary
npm i --workspace @repo/web --save date-fns
npm i --workspace @repo/web --save react-number-format
// npm i --workspace @repo/web --save module-alias

# Init "shared" library for common types and interfaces
mkdir packages/shared
npm i --workspace @repo/shared --save sqlite3 ts-loader typeorm
npm i --workspace @repo/shared --save-dev ts-node typescript
npm i --workspace @repo/shared --save date-fns

# Init "utils" shared library for common functions
mkdir packages/utils
npm i --workspace @repo/shared --save ts-loader
npm i --workspace @repo/shared --save-dev ts-node typescript jest

Nest JS

# Create resources
npx --workspace @repo/api nest generate resource users resources
npx --workspace @repo/api nest generate resource laws resources
npx --workspace @repo/api nest generate resource accounting resources
npx --workspace @repo/api nest generate resource companies resources
npx --workspace @repo/api nest generate resource locales resources
npx --workspace @repo/api nest g module auth
npx --workspace @repo/api nest g controller auth
npx --workspace @repo/api nest g service auth
npx --workspace @repo/api nest generate resource departments resources
npx --workspace @repo/api nest generate resource jobs resources
npx --workspace @repo/api nest generate resource paymentTypes resources
npx --workspace @repo/api nest generate resource workNorms resources
npx --workspace @repo/api nest generate resource workNormPeriods resources
npx --workspace @repo/api nest generate resource payPeriods resources
npx --workspace @repo/api nest generate resource persons resources
npx --workspace @repo/api nest generate resource positions resources
npx --workspace @repo/api nest generate resource positionHistory resources
npx --workspace @repo/api nest generate resource access resources
npx --workspace @repo/api nest generate resource payroll resources
npx --workspace @repo/api nest generate resource processor
npx --workspace @repo/api nest generate service summaryCalculation processor
npx --workspace @repo/api nest generate service balanceCalculation processor
npx --workspace @repo/api nest generate service positionListener processor/listeners
npx --workspace @repo/api nest generate resource fundTypes resources
npx --workspace @repo/api nest generate resource funds resources
npx --workspace @repo/api nest generate resource minWage resources
npx --workspace @repo/api nest generate resource maxBaseECB resources
npx --workspace @repo/api nest generate service payFundCalculation processor
npx --workspace @repo/api nest generate service companyListener processor/listeners
npx --workspace @repo/api nest generate resource tasks resources
npx --workspace @repo/api nest generate service taskList processor
npx --workspace @repo/api nest generate service payPeriodCalculation processor
npx --workspace @repo/api nest generate controller serverEvent processor
npx --workspace @repo/api nest generate service serverEvent processor/serverEvent

TypeORM

# Create an empty migration
npm run m:crt
# Generate a migration
npm run m:gen
# Run a migration
npm run m:run
# Revert a recent migration
npm run m:revert

JWT

# Generate JWT secret key
openssl rand -base64 60

References

payroll-smb's People

Contributors

serhii-untilov avatar

Watchers

 avatar

payroll-smb's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.