Skip to content

Developers

This chapter provides comprehensive guidance for developers who want to contribute to pgagroal, understand its architecture, or extend its functionality.

Documentation Guide

pgagroal documentation is organized to serve different audiences and use cases. Use this guide to quickly find the information you need.

Note: This manual contains the core documentation chapters. Additional standalone documentation files are located in the doc/ directory, project root, and contrib/ directory of the source repository. File paths shown below are relative to the project root directory.

Quick Reference

Navigation Note: Each entry has two links separated by |:

  • First link (Chapter): Use when reading the PDF manual (jumps to page)
  • Second link (File): Use when browsing individual markdown files
  • File links will not work in PDF format
What you want to doWhere to look
Get started quicklyGetting started | 03-gettingstarted.md
Install pgagroalInstallation | 02-installation.md
Configure pgagroalConfiguration | 04-configuration.md
Set up development environmentBuilding pgagroal | 74-building.md
Understand the architectureArchitecture | 72-architecture.md
Write testsTest Suite | 78-test.md
Use Git workflowGit guide | 71-git.md
Build RPM packagesRPM | 73-rpm.md
Analyze code coverageCode Coverage | 75-codecoverage.md
Work with core APIsCore API | 77-core_api.md
Understand event loopEvent Loop | 76-eventloop.md
Configure security/TLSTransport Level Security (TLS) | 08-tls.md
Use command-line toolsCommand Line Tools | 13-cli-tools.md
Set up monitoringPrometheus | 11-prometheus.md
Optimize performancePerformance | 14-performance.md
Configure failoverFailover | 15-failover.md
Choose pipeline typePipelines | 16-pipelines.md
Harden securitySecurity | 17-security.md
Deploy with DockerDocker | 12-docker.md
Configure database aliasesDatabase Aliases | 09-database_alias.md
Manage user credentialsVault | 10-vault.md
Contribute to projectGit guide | 71-git.md, see also CONTRIBUTING.md in project root
Report issues or get helpGitHub Issues: https://github.com/pgagroal/pgagroal/issues

User Documentation

Manual Chapters (Comprehensive Guide)

Navigation Note: Each table entry has two links - a Chapter link and a File link:

  • If reading the PDF manual: Use the Chapter links (first column) to navigate within the PDF
  • If reading individual markdown files: Use the File links (second column) to open specific files
  • The File links will not work in PDF format, and Chapter links may not work when browsing individual files

User-Focused Chapters (01-17):

ChapterFileDescription
Introduction01-introduction.mdOverview of pgagroal features and manual structure
Installation02-installation.mdStep-by-step setup for Rocky Linux, PostgreSQL 17, and pgagroal
Getting Started03-gettingstarted.mdQuick introduction to basic pgagroal usage and configuration
Configuration04-configuration.mdComprehensive guide to all configuration files and options
Prefill05-prefill.mdHow to configure and use connection prefill for performance
Remote Management06-remote_management.mdSetting up and using remote management features
Security Model07-split_security.mdImplementing split security models for authentication
Transport Level Security08-tls.mdConfiguring TLS for secure connections
Database Aliases09-database_alias.mdUsing database aliases for flexible client connections
Vault10-vault.mdManaging user credentials and secrets with pgagroal vault
Prometheus11-prometheus.mdIntegrating Prometheus metrics and monitoring
Docker12-docker.mdRunning pgagroal in Docker containers
Command Line Tools13-cli-tools.mdComprehensive CLI tools reference (pgagroal-cli, pgagroal-admin)
Performance14-performance.mdPerformance benchmarks, tuning, and optimization
Failover15-failover.mdFailover configuration and scripting
Pipelines16-pipelines.mdPipeline types and configuration
Security17-security.mdComprehensive security hardening guide

Developer-Focused Chapters (70-79):

ChapterFileDescription
Developers70-dev.mdDevelopment environment setup and contribution guidelines (this chapter)
Git Guide71-git.mdGit workflow and version control practices for the project
Architecture72-architecture.mdHigh-level architecture and design of pgagroal
RPM73-rpm.mdBuilding and using RPM packages
Building pgagroal74-building.mdCompiling pgagroal from source
Code Coverage75-codecoverage.mdCode coverage analysis and testing practices
Event Loop76-eventloop.mdUnderstanding the event loop implementation
Core API77-core_api.mdReference for core API functions
Test Suite78-test.mdTesting frameworks and procedures
Distribution Installation79-distributions.mdPlatform-specific installation notes

Reference Chapters (97-99):

ChapterFileDescription
Acknowledgements97-acknowledgement.mdCredits and contributors
Licenses98-licenses.mdLicense information
References99-references.mdAdditional resources and references

Additional User Resources

The manual chapters above provide comprehensive coverage. Additional standalone files in doc/ directory provide supplementary information:

Administrator Documentation

All administration topics are covered in this manual:

Navigation Note: Use Chapter links when reading the PDF manual, File links when browsing individual markdown files.

ChapterFileDescription
Configuration04-configuration.mdComplete configuration reference
Remote Management06-remote_management.mdRemote management setup
Transport Level Security08-tls.mdTLS configuration
Vault10-vault.mdUser credential management
Command Line Tools13-cli-tools.mdComplete CLI reference (pgagroal-cli, pgagroal-admin)
Performance14-performance.mdPerformance tuning and benchmarks
Failover15-failover.mdFailover configuration and procedures
Pipelines16-pipelines.mdPipeline configuration and usage
Security17-security.mdSecurity hardening and best practices
Prometheus11-prometheus.mdMonitoring and metrics
Docker12-docker.mdContainer deployment

Legacy standalone documentation files (now superseded by manual chapters):

Legacy FileSuperseded ByChapter
doc/CLI.mdCommand Line Tools13-cli-tools.md
doc/ADMIN.mdCommand Line Tools13-cli-tools.md
doc/PERFORMANCE.mdPerformance14-performance.md
doc/FAILOVER.mdFailover15-failover.md
doc/PIPELINES.mdPipelines16-pipelines.md
doc/SECURITY.mdSecurity17-security.md
doc/DISTRIBUTIONS.mdDistribution Installation79-distributions.md

Developer Documentation

Essential reading for contributors and developers:

Navigation Note: Use Chapter links when reading the PDF manual, File links when browsing individual markdown files.

ChapterFileDescription
Architecture72-architecture.mdHigh-level architecture and design of pgagroal
Building pgagroal74-building.mdCompiling pgagroal from source with development options
Git Guide71-git.mdGit workflow and version control practices for the project
Test Suite78-test.mdTesting frameworks and procedures
Code Coverage75-codecoverage.mdCode coverage analysis and testing practices
Event Loop76-eventloop.mdUnderstanding the event loop implementation
Core API77-core_api.mdReference for core API functions
RPM73-rpm.mdBuilding and using RPM packages

Additional developer resources (supplements manual chapters):

FileSupplementsDescription
doc/DEVELOPERS.mdBuilding pgagroal | 74-building.mdDetailed development environment setup
doc/ARCHITECTURE.mdArchitecture | 72-architecture.mdExtended architecture documentation
doc/TEST.mdTest Suite | 78-test.mdExtended testing documentation

Project Management & Planning

Files in the project root directory:

FileDescription
CONTRIBUTING.mdContribution guidelines and legal information
README.mdProject overview and quick start
AUTHORSList of project contributors
LICENSEProject license information
CODE_OF_CONDUCT.mdCommunity guidelines and conduct policies

Security & Certificate Documentation

Security topics covered in this manual:

Navigation Note: Use Chapter links when reading the PDF manual, File links when browsing individual markdown files.

ChapterFileDescription
Transport Level Security (TLS)08-tls.mdComplete TLS configuration and certificate setup
Security Model07-split_security.mdAdvanced security models

Testing & Development Scripts

Testing covered in this manual:

Navigation Note: Use Chapter links when reading the PDF manual, File links when browsing individual markdown files.

ChapterFileDescription
Test Suite78-test.mdComplete testing procedures and frameworks
Code Coverage75-codecoverage.mdCode coverage analysis

Additional testing documentation in project root:

FileDescription
TEST.mdRoot-level testing documentation

Configuration Examples & Templates

Configuration file templates and examples in doc/etc/:

FileDescription
doc/etc/pgagroal.confMain configuration file template
doc/etc/pgagroal_hba.confHost-based authentication template
doc/etc/pgagroal_vault.confVault configuration template
doc/etc/pgagroal.serviceSystemd service file
doc/etc/pgagroal.socketSystemd socket file

Contrib Directory (Additional Tools & Examples)

Community contributions and additional tools in contrib/:

PathDescription
contrib/docker/Docker configuration examples and Dockerfiles
contrib/grafana/README.mdGrafana dashboard setup and configuration
contrib/prometheus_scrape/README.mdPrometheus metrics documentation generator
contrib/valgrind/README.mdValgrind memory debugging configuration
contrib/shell_comp/Shell completion scripts for bash and zsh

Man Pages (Reference Documentation)

Complete command-line and configuration reference in doc/man/:

FileDescription
doc/man/pgagroal.1.rstMain pgagroal command reference
doc/man/pgagroal-cli.1.rstCLI tool reference
doc/man/pgagroal-admin.1.rstAdmin tool reference
doc/man/pgagroal-vault.1.rstVault tool reference
doc/man/pgagroal.conf.5.rstMain configuration file reference
doc/man/pgagroal_hba.conf.5.rstHBA configuration reference
doc/man/pgagroal_databases.conf.5.rstDatabase limits configuration reference
doc/man/pgagroal_vault.conf.5.rstVault configuration reference

Reference Materials

Navigation Note: Use Chapter links when reading the PDF manual, File links when browsing individual markdown files.

ChapterFileDescription
Acknowledgements97-acknowledgement.mdCredits and contributors
Licenses98-licenses.mdLicense information
References99-references.mdAdditional resources and references

Development Environment Setup

For detailed development environment setup, see Building pgagroal | 74-building.md. Here's a quick overview:

Prerequisites

For Fedora-based systems:

bash
dnf install git gcc cmake make liburing liburing-devel openssl openssl-devel systemd systemd-devel python3-docutils libatomic zlib zlib-devel libzstd libzstd-devel lz4 lz4-devel bzip2 bzip2-devel libasan libasan-static binutils clang clang-analyzer clang-tools-extra

Quick Build

bash
git clone https://github.com/pgagroal/pgagroal.git
cd pgagroal
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ..
make
make install

Contributing Workflow

  1. Fork the repository on GitHub
  2. Clone your fork locally
  3. Create a feature branch from main
  4. Make your changes following the coding guidelines
  5. Test your changes thoroughly
  6. Submit a pull request with a clear description

For detailed Git workflow, see Git guide | 71-git.md.

Key Development Principles

  • Security First: Always consider security implications
  • Performance Matters: pgagroal is a high-performance connection pool
  • Code Quality: Follow established patterns and write tests
  • Documentation: Update documentation with your changes
  • Community: Engage with the community for feedback

Getting Help