A simple home care service management system built with Vanilla PHP and PostgreSQL. This project allows customers to request home maintenance services, managers to oversee service requests, and workers to be assigned tasks.
- User authentication for Customers, Managers, and Workers.
- CRUD operations for services, requests, and assignments.
- Role-based access control.
- Request tracking with status updates.
- PostgreSQL database for structured data management.
- A simple custom PHP router for handling routes.
- Backend: Vanilla PHP (No frameworks)
- Database: PostgreSQL
- Routing: Custom PHP Router
git clone https://github.com/YakuBrangJa/home_care_server.git
cd home_care_serverMake sure PostgreSQL is installed and running. Then, execute the schema SQL file:
psql -U your_user -d postgres -f database/schema.sqlOr manually:
CREATE DATABASE home_care;
\c home_care;
-- Run the SQL schema from schema.sqlRename .env.example.php to .env.php and configure database credentials:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=home_care
DB_USER=your_user
DB_PASSWORD=your_passwordRun the built-in PHP server:
# php -S localhost:9000 -t public/
php -S localhost:9000Access the API at http://localhost:9000
| Method | Endpoint | Description |
|---|---|---|
| POST | /register |
Customer registration |
| POST | /login |
User authentication |
| Method | Endpoint | Description |
|---|---|---|
| GET | /services |
List available services |
| POST | /request |
Create a new service request |
| GET | /request/:id |
View a request's details |
| PUT | /request/:id |
Update a request's status |
| POST | /assign/:requestId |
Assign a worker to request |