Tech Stack - green-ecolution/backend GitHub Wiki
The backend of this open-source project is built using Go (Golang), a statically typed, compiled language designed for efficiency, concurrency, and scalability. Go is particularly well-suited for backend services due to its lightweight goroutines, strong standard library, and simple deployment model.
Go Version Requirement
To ensure compatibility with the latest features and improvements, the backend requires Go version >=1.24. With the release of Go 1.24, the go tools feature was introduced, providing a standardized way to manage external CLI tools for tasks such as code generation, linting, and other development utilities.
The following external tools are managed using go
- air – Live reload for Go applications.
- golangci-lint – A fast Go linters runner for static code analysis.
- goverter – A code generation tool for type-safe Go struct conversions.
- goose – A database migration tool.
- sqlc – A SQL query compiler that generates Go code from SQL queries.
- swag – A tool for generating Swagger documentation from Go comments.
- mockery – A tool for generating mock implementations of Go interfaces.
Tech Stack Components
The backend architecture consists of the following key components:
- Golang (>=1.24) – Core programming language for backend development.
- Fiber – A high-performance web framework inspired by Express.js, used for handling HTTP requests and defining server routes.
- Swagger – Used for API documentation, allowing easy exploration and testing of the backend's RESTful endpoints.
- sqlc – A SQL query compiler that generates Go code from SQL queries, simplifying database interactions with PostgreSQL.
- gocloak – A Go client for integrating with Keycloak, used for authentication and authorization.
- S3-compatible storage – The backend supports object storage compatible with Amazon S3 for handling file uploads and storage needs.
- Routing Services – The project integrates with either Valhalla or OpenRouteService, combined with VROOM for optimized route planning and vehicle routing.
The backend is containerized with Docker, allowing easy deployment and scalability. Additionally, it integrates seamlessly with NixOS for development and deployment automation.