donation-server

module
v0.0.0-...-7b9432f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2025 License: MIT

README

Donation Server

This project provides a simple HTTP API for processing donations. It is written in Go and uses PostgreSQL for persistence. A complete development environment is available via Docker Compose, which also spins up a MinIO instance for file storage.

Getting Started

1. Load environment variables

Copy the sample environment file and adjust values if needed:

cp .env.example .env

The application uses godotenv so variables from the .env file are loaded automatically when the server starts.

2. Build and run with Docker Compose

Make sure Docker and Docker Compose are installed. Run the following command to start the services defined in compose.local.yml (PostgreSQL, migrator, server, pgweb and MinIO):

docker compose -f compose.local.yml up --build

Alternatively you can use compose.dev.yml which behaves similarly but loads variables from .env.

Once the containers are running the API will be available at http://localhost:8000/api/v1.

API Documentation

Interactive Swagger documentation is generated from the docs folder. After the server is up open:

http://localhost:8000/api/v1/swagger/index.html

Use the credentials defined by HTTP_SERVER_SWAGGER_USER and HTTP_SERVER_SWAGGER_PASSWORD if authentication is enabled.

Database Diagram

An Entity–Relationship (ER) diagram of the database schema is included in er.png. It illustrates the tables created by the migrations under the migrations directory.

License

This project is released under the MIT License.

Directories

Path Synopsis
@title Donation API @version 1.0 @description RESTful API to receive donations via pix or credit/debit card.
@title Donation API @version 1.0 @description RESTful API to receive donations via pix or credit/debit card.
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
pkg
str

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL