Skip to content
codedbyvikashPublic

About

PayLedger is a small monthly payroll app. It has a React UI, an ASP.NET Core API, and a SQL Server database.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayLedger

PayLedger is a small monthly payroll app. It has a React UI, an ASP.NET Core API, and a SQL Server database.

GitHub repository

What you need

  • .NET 8 SDK
  • Node.js 20.19 or newer, with npm
  • SQL Server
  • SQL Server Management Studio (SSMS) to run the database script
  • Git and Visual Studio 2022 with the ASP.NET and web development workload

Run it locally

  1. Clone the project:

    git clone https://github.com/codedbyvikash/PayLedger.git
    cd PayLedger

    Open PayLedger.sln in Visual Studio 2022.

  2. Open SSMS and connect to your SQL Server. In the database dropdown, select master. Open database/PayLedger.sql from the cloned folder and click Execute to run the whole script. The script creates the PayLedger database, tables, payroll procedure, and sample data. You can run it again; it only adds missing sample rows.

  3. In Visual Studio, open src/PayLedger.Api/appsettings.json and set ConnectionStrings:PayLedger for your SQL Server. For Windows authentication, use Server=localhost;Database=PayLedger;Trusted_Connection=True;TrustServerCertificate=True and change localhost if your server has another name.

  4. In the same settings file, check Auth:Username, Auth:Password, and Jwt:Key. Login uses the username and password from this file. The JWT key must be at least 32 bytes.

  5. In Visual Studio's Solution Explorer, right-click PayLedger.Api and choose Set as Startup Project. Select the http launch profile in the toolbar and press F5. The API uses http://localhost:5000; Swagger is at http://localhost:5000/swagger.

  6. Open a terminal in the cloned project folder and run:

    cd ui
    npm install
    npm run dev

    Open http://localhost:5173 and sign in with the username and password from step 4.

The UI calls http://localhost:5000 by default. If your API uses another address, copy ui/.env.example to ui/.env and set VITE_API_URL. If your UI uses another address, also change Frontend:Origin in the API settings.

UI pages

Page What you can check
Sign in Log in with the username and password from the API settings.
Dashboard Pick a month to see employee totals, attendance, and saved payroll amounts.
Employees Search and filter employees, move between pages, and add or edit their details and salary.
Attendance Pick a month, view saved attendance, and add or edit working and present days. Attendance is locked after payroll is run.
Payroll Run payroll for a month, view the results, and open a payslip to print or download it.

How to run payroll

  1. Start the API and UI using the steps above, then sign in.
  2. On a fresh database, the script has already added attendance for the active sample employees for the current month. To use another month, go to Attendance, select that month, and add attendance for every active employee. If you add a new active employee, add their attendance too.
  3. Go to Payroll and select the same month. Click Run payroll, then confirm.
  4. Review the saved results. Use the eye button on an employee row to view, print, or download the payslip. You can also select the month on Dashboard to see its totals.

Payroll can be run only once for a month. If attendance is missing for an active employee, add it before trying again.

Assumptions

  • Payroll is run once per month. Every active employee must have attendance for that month before payroll can run.
  • Attendance cannot be changed after payroll is saved for that month.
  • Gross pay is based on salary and days present. PF is 12% of earned pay. Professional tax is a flat ₹200 for every employee. These are simple rules for this version.
  • The database script adds sample employees and attendance for the current month. It does not replace existing records.

Not finished yet

Due to limited time, authentication and user management are not complete. Login works with credentials set in the API settings file. Professional tax is a flat ₹200 instead of being calculated by state. xUnit testing is also not complete.

For version 1, I would add:

  • Companies as separate tenants.
  • User and role management with role-based permissions.
  • Excel upload for punch machine attendance data.
  • Leave management and tax management with default values and company settings.
  • Audit logs and API logs for monitoring.

About

PayLedger is a small monthly payroll app. It has a React UI, an ASP.NET Core API, and a SQL Server database.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages