Dispatchz is a Field Service Management (FSM) and ticketing backend. It provides APIs for managing service tickets, technicians, dispatchers, and leads.
The project is built with Go and follows a modular internal structure:
- Auth: JWT-based authentication and registration.
- Users: Profile management and role-based access.
- Tickets: Core ticketing lifecycle, including assignments and status tracking.
- Leads: Public entry points for potential customer capture.
- Shared: Common utilities for JSON responses and configuration.
- Language: Go
- Router: Chi
- Database: PostgreSQL
- SQL Generator: SQLC
- Documentation: Swagger/OpenAPI
Ensure you have the following installed on your system:
- Go 1.22+
- PostgreSQL
- SQLC CLI (go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest)
- Swag CLI (go install github.com/swaggo/swag/cmd/swag@latest)
- Configure Environment
- Create a .env file in the root directory:
- PORT=8080
- DATABASE_URL=postgres://postgres:pass123@localhost:5432/dispatchz-db?sslmode=disable
- JWT_SECRET=your_jwt_secret_key
- ENV=development
- Initialize Database Schema
- Run the following commands to create the required tables:
- psql "postgres://postgres:pass123@localhost:5432/dispatchz-db?sslmode=disable" -f internal/users/store/schema.sql
- psql "postgres://postgres:pass123@localhost:5432/dispatchz-db?sslmode=disable" -f internal/leads/store/schema.sql
- psql "postgres://postgres:pass123@localhost:5432/dispatchz-db?sslmode=disable" -f internal/tickets/store/schema.sql
Once the server is running, you can access the interactive Swagger UI at: http://localhost:8080/swagger/index.html