This is a backend application for managing employee payroll data. It provides RESTful API endpoints for CRUD operations on employee records with MySQL database integration.
- Create new employee records
- Retrieve employee data
- Update existing employee information
- Delete employee records
- Validate name fields
- Validate numeric fields
- MySQL database connection
- Prepared statements for security
- Comprehensive error responses
- Input validation
- Node.js (v14 or higher)
- MySQL (v5.7 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/gofaonemotsemme/payroll_backend.git
cd payroll_backend
- Install dependencies:
npm install
- Set up the database:
- Create a MySQL database named
payroll_db
- Run the SQL schema file to create tables:
- Create a MySQL database named
cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
.\mysql -u root -p
Start the development server:
npm start
The API will be available at:
http://localhost:3000
Base URL: http://localhost:3000
GET /employeeData
– Get all employeesGET /employeeData/:employeeID
– Get employee by ID