Skip to content

samber/do-template-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

API boilerplate showcasing github.com/samber/do

Go Version Build Status Go report License

โš™๏ธ A comprehensive API template demonstrating the github.com/samber/do dependency injection library.

A comprehensive API template project demonstrating the full power of the github.com/samber/do dependency injection library. This project implements a complete REST API with PostgreSQL integration, showcasing type-safe dependency injection, modular architecture, and real-world web application concerns.

Perfect as a starting point for new Go web projects or as a learning resource for understanding dependency injection patterns in API applications.

See also:

๐Ÿš€ Install

Clone the repo and install dependencies:

git clone --depth 1 --branch main https://github.com/samber/do-template-api.git your-project-name
cd your-project-name

docker compose up -d
make deps
make deps-tools

๐Ÿ’ก Features

  • Type-safe dependency injection - Service registration and resolution using samber/do
  • Modular architecture - Clean separation of concerns with dependency tree visualization
  • REST API framework - Built with Gin for robust HTTP web services
  • Configuration management - Environment-based configuration with dependency injection
  • PostgreSQL integration - Complete database setup with connection pooling and migrations
  • Repository pattern - Data access layer with injected dependencies
  • Service layer - Business logic with proper dependency management
  • Application lifecycle - Health checks and graceful shutdown handling
  • Comprehensive error handling - Structured logging and error management
  • Production-ready - Ready to fork and customize for your next API project
  • Extensive documentation - Inline comments explaining every do library feature

๐Ÿš€ Contributing

# install deps
make deps
make deps-tools

# compile
make build

# build with hot-reload
make watch-run

# test with hot-reload
make watch-test

๐Ÿค  do documentation

๐Ÿ’ซ Show your support

Give a โญ๏ธ if this project helped you!

GitHub Sponsors

๐Ÿ“ License

Copyright ยฉ 2025 Samuel Berthe.

This project is MIT licensed.

Releases

No releases published