Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/platforma-dev/platforma/llms.txt

Use this file to discover all available pages before exploring further.

Welcome to Platforma

Platforma is a modern Go web framework that embraces domain-driven architecture to help you build robust, production-ready web applications. It provides a comprehensive set of tools for HTTP servers, database management, background jobs, scheduled tasks, and structured logging.

Installation

Get started with Platforma in your Go project

Quick Start

Build your first HTTP server in minutes

Core Concepts

Learn about domains, services, and architecture

API Reference

Explore the complete API documentation

Why Platforma?

Platforma is designed around domain-driven design principles, giving you a clear structure for organizing your application logic into bounded contexts. Each domain encapsulates its repository, service layer, HTTP handlers, and middleware—making your codebase maintainable and testable.

Built for Production

Graceful Shutdown

All services handle shutdown signals properly, draining connections before exit

Health Checks

Built-in health check endpoints for monitoring service status

Structured Logging

Context-aware logging with trace IDs for request tracking

Key Features

Application Lifecycle Management

The Application type orchestrates your entire application lifecycle—from startup tasks to graceful shutdown. Register services, databases, and domains, and let Platforma handle the rest.
app := application.New()
app.RegisterService("api", httpServer)
app.RegisterDatabase("main", database)
app.RegisterDomain("auth", "main", authDomain)
app.Run(ctx)

HTTP Server with Middleware

Build RESTful APIs with an intuitive routing system that supports middleware at both server and route group levels. Includes built-in middleware for trace IDs, authentication, panic recovery, and more.
server := httpserver.New("8080", 3*time.Second)
server.Use(log.NewTraceIDMiddleware(nil, ""))
server.HandleFunc("/health", healthHandler)

Database Integration

PostgreSQL integration with sqlx for powerful SQL operations and an embedded migration system. Migrations are versioned SQL files tracked automatically.
Platforma uses the lib/pq PostgreSQL driver, not pgx.

Background Job Processing

Generic queue processor with worker pools for handling background jobs. Supports graceful shutdown with configurable timeouts to drain remaining jobs.
processor := queue.New(handler, queueProvider, workersAmount, shutdownTimeout)
app.RegisterService("queue", processor)

Scheduled Tasks

Cron-based task scheduler for periodic execution. Supports standard cron expressions and interval syntax like @every 5m.
scheduler, _ := scheduler.New("0 2 * * *", cleanupTask)
app.RegisterService("scheduler", scheduler)

Domain-Driven Architecture

Organize your application into domains—bounded contexts that encapsulate all related functionality:
  • Repository: Database operations and migrations
  • Service: Business logic and domain rules
  • Handlers: HTTP endpoint controllers
  • Middleware: Request processing and authentication
See the auth domain as a complete reference implementation.

Framework Philosophy

Platforma enforces strict conventions for code quality:
  • No testify assertions—use standard library
  • No external mocking libraries—hand-roll mocks per test
  • No global state (except log.Logger)
  • No init functions—enforced by gochecknoinits linter
These constraints encourage explicit dependencies, testable code, and predictable behavior.

Next Steps

1

Install Platforma

Add Platforma to your Go project with go get
2

Build Your First Server

Follow the quickstart guide to create a working HTTP server
3

Learn the Architecture

Understand domains, services, and lifecycle management
4

Explore Examples

Check out the demo-app for real-world usage patterns

Ready to build?

Install Platforma and create your first application

Build docs developers (and LLMs) love