Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dispatchz Backend

Dispatchz is a Field Service Management (FSM) and ticketing backend. It provides APIs for managing service tickets, technicians, dispatchers, and leads.

Project Architecture

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.

Tech Stack

  • Language: Go
  • Router: Chi
  • Database: PostgreSQL
  • SQL Generator: SQLC
  • Documentation: Swagger/OpenAPI

Prerequisites

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)

Installation and Setup

  1. 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
  1. 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

API Documentation

Once the server is running, you can access the interactive Swagger UI at: http://localhost:8080/swagger/index.html

About

FSM backend featuring real-time dispatching, lead management, and technician tracking, powered by Go. [Go, Chi, SQLC, PostgreSQL]

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages