A companion app for Libre311 that allows the creation and management of work orders from Service Requests.
This application follows a three-tier architecture:
- Frontend: Svelte/SvelteKit application with TypeScript
- Backend: Micronaut application with Java
- Database: MySQL database
- Work order creation and management
- Integration with Libre311 service requests
- RESTful API for work order operations
- Web-based interface for work order management
- Status tracking and assignment capabilities
-
Clone the repository
-
Run the application stack:
docker-compose up -d
-
Access the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8080/api/work-orders
- Database: localhost:3306
- Install MySQL and create the database:
mysql -u root -p < database/schema.sql mysql -u root -p < database/sample_data.sql
-
Navigate to the backend directory:
cd backend
-
Configure the database connection in
src/main/resources/application.yml
-
Run the backend:
./gradlew run
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
GET /api/work-orders
- List all work ordersPOST /api/work-orders
- Create a new work orderGET /api/work-orders/{id}
- Get work order by IDPUT /api/work-orders/{id}
- Update work orderDELETE /api/work-orders/{id}
- Delete work orderGET /api/work-orders/libre311/{serviceRequestId}
- Get work order by Libre311 service request IDGET /api/work-orders/status/{status}
- Get work orders by statusGET /api/work-orders/assigned/{assignedTo}
- Get work orders by assigneePUT /api/work-orders/{id}/assign
- Assign work orderPUT /api/work-orders/{id}/status
- Update work order status
curl -X POST http://localhost:8080/api/work-orders \
-H "Content-Type: application/json" \
-d '{
"libre311ServiceRequestId": "SR-2024-006",
"title": "Fix broken streetlight",
"description": "Streetlight is out on Main Street",
"priority": "HIGH"
}'
The application uses a single work_orders
table with the following fields:
id
- Primary keylibre311_service_request_id
- Reference to Libre311 service requesttitle
- Work order titledescription
- Detailed descriptionstatus
- Current status (PENDING, ASSIGNED, IN_PROGRESS, COMPLETED, CANCELLED)assigned_to
- Email/username of assigned personpriority
- Priority level (LOW, MEDIUM, HIGH, URGENT)created_at
- Creation timestampupdated_at
- Last update timestamp
This application is designed to receive work order creation requests from Libre311 through the REST API. Libre311 can:
- Create work orders by posting to
/api/work-orders
- Check work order status by querying
/api/work-orders/libre311/{serviceRequestId}
- Receive status updates through webhook notifications (to be implemented)
-
Frontend:
- Svelte 5
- SvelteKit
- TypeScript
- Tailwind CSS
- Vite
-
Backend:
- Micronaut 4.2.1
- Java 17
- Hibernate/JPA
- MySQL Connector
- Gradle
-
Database:
- MySQL 8.0
LibreWorkOrder/
├── frontend/ # Svelte frontend application
│ ├── src/
│ │ ├── lib/
│ │ │ ├── components/
│ │ │ ├── api.ts
│ │ │ └── types.ts
│ │ └── routes/
│ └── package.json
├── backend/ # Micronaut backend application
│ ├── src/main/java/com/libre311/workorder/
│ │ ├── controller/
│ │ ├── service/
│ │ ├── repository/
│ │ ├── entity/
│ │ └── dto/
│ └── build.gradle
├── database/ # Database schema and sample data
│ ├── schema.sql
│ └── sample_data.sql
└── docker-compose.yml # Development environment
This project is licensed under the Apache License 2.0.