go-forge-api

module
v0.0.0-...-f47ae94 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: MIT

README ΒΆ

go-forge-api

Go Report Card License


A powerful and flexible toolkit for building production-ready REST APIs in Go.


Features

  • πŸš€ Production-Ready: Built with best practices and real-world usage in mind

  • πŸ”’ Secure: Built-in authentication and middleware support

  • πŸ“ Clean Architecture: Following SOLID principles and clean architecture patterns

  • πŸ”Œ Extensible: Easy to add new features and customize existing ones

  • πŸ“Š Database Support: PostgreSQL support with migrations included

  • πŸ” Logging: Structured logging with logrus

  • ⚑ Performance: Optimized for high performance

  • πŸ§ͺ Testing: Comprehensive testing utilities included


Quick Start

Prerequisites
  • Go 1.24

  • PostgreSQL

  • Make (optional, for using Makefile commands)

Installation

# Clone the repository

git clone https://github.com/bambutcha/go-forge-api.git

# Navigate to the project

cd go-forge-api

# Install dependencies

go mod download

Running

# Using make

make run

# Or directly

go run cmd/api-server/main.go


Project Structure

go-forge-api/
β”œβ”€β”€ cmd/                   # Application entry points
β”œβ”€β”€ configs/               # Configuration files
β”œβ”€β”€ internal/              # Private application code
β”‚   β”œβ”€β”€ app/               # Application core
β”‚   β”‚   β”œβ”€β”€ api-server/    # HTTP server implementation
β”‚   β”‚   β”œβ”€β”€ model/         # Domain models
β”‚   β”‚   └── store/         # Data access layer
└── migrations/            # Database migrations

API Endpoints

Method Path Description
POST /users Create a new user
POST /sessions Create a new session
GET /private/whoami Get current user info

Development

Running Tests

# Run all tests make test # Run specific tests go test ./internal/app/...

Database Migrations

# Create a new migration make migrate-create name=add_users_table # Apply migrations make migrate-up # Rollback migrations make migrate-down


Contributing

We welcome contributions! Please see ourΒ Contributing GuidelinesΒ for details.

Development Process
  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see theΒ LICENSEΒ file for details.


Acknowledgments

Directories ΒΆ

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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