Skip to content

Commit 9473d98

Browse files
committed
Refactor: rename project from MotorPH to Sweldox
- refactored all code, configuration, and documentation to rename the project from 'motorph' to 'sweldox'. - includes package names, artifact IDs, Docker image names, database names, and references in the README and configuration files.
1 parent 44cf909 commit 9473d98

115 files changed

Lines changed: 303 additions & 423 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
SPRING_PROFILES_ACTIVE=local
22
PORT=8001
33

4-
LOCAL_DB=motorph
4+
LOCAL_DB=sweldox
55
LOCAL_DB_HOST=localhost
66
LOCAL_DB_PORT=5432
77
LOCAL_DB_USER=postgres
88
LOCAL_DB_PASSWORD=
99

10-
CLOUD_DB=motorph
10+
CLOUD_DB=sweldox
1111
CLOUD_DB_HOST=
1212
CLOUD_DB_PORT=
1313
CLOUD_DB_USER=

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
run: ./mvnw clean package -DskipTests
4747

4848
- name: Build Docker image
49-
run: docker build -t ghcr.io/${{ github.repository_owner }}/motorph-api:latest .
49+
run: docker build -t ghcr.io/${{ github.repository_owner }}/sweldox-api:latest .
5050

5151
- name: Log in to GHCR
5252
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u iodsky --password-stdin
5353

5454
- name: Push image
55-
run: docker push ghcr.io/${{ github.repository_owner }}/motorph-api:latest
55+
run: docker push ghcr.io/${{ github.repository_owner }}/sweldox-api:latest

compose.db.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
postgresql:
3-
container_name: mph-db
3+
container_name: sweldox-db
44
image: "postgres:latest"
55
restart: unless-stopped
66
environment:

compose.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
services:
22
spring:
3-
container_name: mph-server
4-
image: ghcr.io/iodsky/motorph-api:latest
3+
container_name: sweldox-server
4+
image: ghcr.io/iodsky/sweldox-api:latest
55
restart: always
66
ports:
77
- 8001:8001
88
env_file:
99
- .env
1010
labels:
1111
- "traefik.enable=true"
12-
- "traefik.http.routers.motorph.rule=Host(`motorph.iodsky.com`)"
13-
- "traefik.http.routers.motorph.entrypoints=websecure"
14-
- "traefik.http.routers.motorph.tls.certresolver=myresolver"
15-
- "traefik.http.services.orderly.loadbalancer.server.port=8001"
12+
- "traefik.http.routers.sweldox.rule=Host(`sweldox.iodsky.com`)"
13+
- "traefik.http.routers.sweldox.entrypoints=websecure"
14+
- "traefik.http.routers.sweldox.tls.certresolver=myresolver"
15+
- "traefik.http.services.sweldox.loadbalancer.server.port=8001"
1616
networks:
17-
- mph-network
17+
- sweldox-network
1818
- traefik
19+
1920
watchtower:
2021
image: containrrr/watchtower
2122
restart: always
@@ -27,12 +28,12 @@ services:
2728
WATCHTOWER_INCLUDE_RESTARTING: "true"
2829
command: --cleanup spring
2930
networks:
30-
- mph-network
31+
- sweldox-network
3132

3233
volumes:
3334
postgres-data:
3435

3536
networks:
36-
mph-network:
37+
sweldox-network:
3738
traefik:
3839
external: true

db-init/init.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CREATE DATABASE motorph;
1+
CREATE DATABASE sweldox;

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.iodsky</groupId>
12-
<artifactId>motorph</artifactId>
12+
<artifactId>sweldox</artifactId>
1313
<version>0.0.1-SNAPSHOT</version>
14-
<name>motorph</name>
15-
<description>Demo project for Spring Boot</description>
14+
<name>Sweldox</name>
15+
<description>Sweldox - HRIS RESTful API for employee, attendance, leave, and payroll management</description>
1616
<url/>
1717
<licenses>
1818
<license/>

readme.md

Lines changed: 9 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# MotorPH API
1+
# Sweldox: HRIS 👥 RESTful API
22

33
![Java](https://img.shields.io/badge/Java-21-orange?style=flat-square&logo=openjdk)
44
![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.5.6-brightgreen?style=flat-square&logo=spring-boot)
55
![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14+-blue?style=flat-square&logo=postgresql)
66
![Maven](https://img.shields.io/badge/Maven-3.8+-C71A36?style=flat-square&logo=apache-maven)
77
![Status](https://img.shields.io/badge/Status-In%20Development-blue?style=flat-square)
88

9-
A comprehensive employee management and payroll system REST API built with Spring Boot. This project demonstrates backend development best practices and serves as preparation for software engineering internships.
10-
119
## 🎯 Project Overview
1210

13-
MotorPH API is a full-featured Human Resources Information System (HRIS) that manages employee data, attendance tracking, and payroll processing. The system implements role-based access control, JWT authentication, and follows clean architecture principles.
11+
Sweldox API is a full-featured Human Resources Information System (HRIS) that manages employee data, attendance tracking, and payroll processing. The system implements role-based access control, JWT authentication, and follows clean architecture principles.
1412

1513
## 🏗️ Architecture & Technology Stack
1614

@@ -33,11 +31,10 @@ MotorPH API is a full-featured Human Resources Information System (HRIS) that ma
3331
## 📁 Project Structure
3432

3533
```
36-
motorph_api/
3734
├── src/
3835
│ ├── main/
39-
│ │ ├── java/com/iodsky/motorph/
40-
│ │ │ ├── MotorphApplication.java # Application entry point
36+
│ │ ├── java/com/iodsky/sweldox/
37+
│ │ │ ├── Application.java # Application entry point
4138
│ │ │ ├── attendance/ # Attendance management module
4239
│ │ │ ├── common/ # Shared utilities and DTOs
4340
│ │ │ ├── csvimport/ # CSV import functionality
@@ -59,49 +56,7 @@ motorph_api/
5956

6057
## 🗄️ Database Entity-Relationship Diagram
6158

62-
![MotorPH](docs/images/motorph.png)
63-
64-
The database schema follows a normalized relational design with the following key entities and relationships:
65-
66-
### Core Entities
67-
68-
**Employee** (Central Entity)
69-
- Primary entity containing personal information
70-
- Has one-to-one relationships with:
71-
- `GovernmentId` - SSS, PhilHealth, TIN, Pag-IBIG numbers
72-
- `EmploymentDetails` - Department, position, supervisor, status
73-
- `Compensation` - Salary and allowances
74-
75-
**Attendance**
76-
- Tracks employee clock in/out records
77-
- Many-to-one relationship with Employee
78-
- Fields: date, time in, time out, total hours, overtime
79-
80-
**Payroll**
81-
- Generated payroll records for employees
82-
- Many-to-one relationship with Employee
83-
- Calculated from attendance and compensation data
84-
- Fields: period dates, gross pay, deductions, net pay
85-
86-
**Department** & **Position**
87-
- Organizational structure entities
88-
- Referenced by EmploymentDetails
89-
90-
**User** (Security)
91-
- Authentication and authorization
92-
- One-to-one with Employee
93-
- Contains username, password (encrypted), and roles
94-
95-
**Leave Management**
96-
- **LeaveRequest** - Employee leave applications
97-
- Many-to-one relationship with Employee
98-
- Fields: leave type, request date, start/end dates, status, notes
99-
- Status: PENDING, APPROVED, REJECTED
100-
- Types: Vacation, Sick, Maternity, Paternity, Solo Parent, Bereavement
101-
- **LeaveCredit** - Employee leave balances
102-
- Many-to-one relationship with Employee
103-
- Tracks available leave credits by type and fiscal year
104-
- Fields: leave type, credits (days), fiscal year
59+
![](docs/images/erd.png)
10560

10661
## 🔑 Key Features
10762

@@ -209,74 +164,6 @@ The system implements a role-based access control system with the following role
209164
- **IT** - Access to employee information for system administration
210165
- **EMPLOYEE** - Basic access to personal information, attendance, and payroll records
211166

212-
## 📡 API Endpoints
213-
214-
### Authentication
215-
```
216-
POST /api/auth/login # User authentication (returns JWT token)
217-
```
218-
219-
### Employee Management
220-
```
221-
POST /api/employees # Create new employee (HR only)
222-
GET /api/employees # List all employees with pagination & filters (HR, IT, PAYROLL)
223-
# Query params: page, limit, department, supervisor, status
224-
GET /api/employees/me # Get authenticated employee's profile
225-
GET /api/employees/{id} # Get employee by ID (HR only)
226-
PUT /api/employees/{id} # Update employee (HR only)
227-
DELETE /api/employees/{id} # Delete employee (HR only)
228-
POST /api/employees/import # Bulk import employees from CSV (HR, IT)
229-
```
230-
231-
### Attendance
232-
```
233-
POST /api/attendances # Clock in/out (creates attendance record)
234-
GET /api/attendances # Get all attendance records with pagination (HR only)
235-
# Query params: page, limit, startDate, endDate
236-
GET /api/attendances/me # Get my attendance records with pagination
237-
# Query params: page, limit, startDate, endDate
238-
GET /api/attendances/employee/{id} # Get employee attendance (HR only)
239-
# Query params: page, limit, startDate, endDate
240-
PATCH /api/attendances/{id} # Update attendance record (clock out)
241-
```
242-
243-
### Payroll
244-
```
245-
POST /api/payroll # Generate payroll (PAYROLL role)
246-
# Batch: omit employeeId to process all employees
247-
# Single: include employeeId for specific employee
248-
GET /api/payroll # Get all payroll records with pagination (PAYROLL role)
249-
# Query params: page, limit, periodStartDate, periodEndDate
250-
GET /api/payroll/me # Get my payroll records with pagination
251-
# Query params: page, limit, periodStartDate, periodEndDate
252-
GET /api/payroll/{id} # Get payroll by ID
253-
```
254-
255-
### Leave Management
256-
```
257-
POST /api/leaves # Create leave request
258-
GET /api/leaves # Get leave requests with pagination
259-
# Employees see own requests, HR sees all
260-
# Query params: pageNum, limit
261-
GET /api/leaves/{id} # Get leave request by ID
262-
PUT /api/leaves/{id} # Update leave request (own requests only)
263-
PATCH /api/leaves/{id} # Update leave status - approve/reject (HR only)
264-
DELETE /api/leaves/{id} # Delete leave request
265-
266-
POST /api/leaves/credits # Initialize employee leave credits (HR only)
267-
# Supports JSON body or CSV upload (multipart/form-data)
268-
GET /api/leaves/credits # Get my leave credit balances
269-
DELETE /api/leaves/credits/employees/{employeeId} # Delete employee leave credits
270-
```
271-
272-
### User Management
273-
```
274-
POST /api/users # Create new user account (IT only)
275-
GET /api/users # List all users with pagination (IT only)
276-
# Query params: page, limit, role
277-
POST /api/users/import # Bulk import users from CSV (IT only)
278-
```
279-
280167
## 🚀 Getting Started
281168

282169
### Prerequisites
@@ -297,14 +184,14 @@ SPRING_PROFILES_ACTIVE=local # Use 'local' for development, 'prod' for producti
297184
PORT=8001
298185
299186
# Local Database Configuration (for local profile)
300-
LOCAL_DB=motorph
187+
LOCAL_DB=sweldox
301188
LOCAL_DB_HOST=localhost
302189
LOCAL_DB_PORT=5432
303190
LOCAL_DB_USER=postgres
304191
LOCAL_DB_PASSWORD=your-password
305192
306193
# Cloud Database Configuration (for prod profile - AWS RDS)
307-
CLOUD_DB=motorph
194+
CLOUD_DB=sweldox
308195
CLOUD_DB_HOST=your-rds-endpoint.amazonaws.com
309196
CLOUD_DB_PORT=5432
310197
CLOUD_DB_USER=postgres
@@ -322,7 +209,7 @@ JWT_EXPIRATION=86400000 # 24 hours in milliseconds
322209
1. **Clone the repository**
323210
```powershell
324211
git clone <repository-url>
325-
cd motorph_api
212+
cd sweldox
326213
```
327214

328215
2. **Create .env file**
@@ -386,7 +273,7 @@ The project includes two Docker Compose configurations:
386273

387274
### Build Docker Image
388275
```powershell
389-
docker build -t motorph-api .
276+
docker build -t sweldox-api .
390277
```
391278

392279
### Run with Docker Compose (Full Stack)
@@ -451,5 +338,3 @@ Run tests with:
451338
### Phase 4: Documentation & Enhancement 🔮
452339
- [ ] OpenAPI/Swagger documentation
453340
---
454-
455-
**Note**: This project is actively being developed as part of backend development practice for internship preparation. The focus is on implementing industry-standard practices, clean code, and scalable architecture.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package com.iodsky.motorph;
1+
package com.iodsky.sweldox;
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
55

66
@SpringBootApplication
7-
public class MotorphApplication {
7+
public class Application {
88

99
public static void main(String[] args) {
10-
SpringApplication.run(MotorphApplication.class, args);
10+
SpringApplication.run(Application.class, args);
1111
}
1212

1313
}

src/main/java/com/iodsky/motorph/attendance/Attendance.java renamed to src/main/java/com/iodsky/sweldox/attendance/Attendance.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.iodsky.motorph.attendance;
1+
package com.iodsky.sweldox.attendance;
22

33
import com.fasterxml.jackson.annotation.JsonIgnore;
4-
import com.iodsky.motorph.common.BaseModel;
5-
import com.iodsky.motorph.employee.Employee;
4+
import com.iodsky.sweldox.common.BaseModel;
5+
import com.iodsky.sweldox.employee.Employee;
66
import jakarta.persistence.*;
77
import lombok.*;
88

0 commit comments

Comments
 (0)