Skip to content

waiphyo285/ginapi-starter

Repository files navigation

Features

  • Modular Routers: Organized under /api, cleanly separated.
  • GORM Integration: Includes models for Book and AuditLog with advanced features.
  • CRUD APIs: Supports Create, Read, Update, and Delete for Book.
  • Audit Logging: Automatically logs events after inserts using GORM hooks.
  • Environment Configs: All settings configurable via environment variables.
  • Middlewares: Logging, authentication, rate limiting, and response formatting.

Quick Start

Go 1.21.1 or later (If not already installed) in your machine.

1. Clone the Repo

git clone <repo-url>
cd ginapi-starter

2. Setup Environment Variables

Copy the example environment file and configure your settings:

cp .env.example .env

Edit .env file with your actual configuration:

  • Database credentials
  • Authentication credentials
  • JWT secret (use a strong secret in production)

3. Install pkg and Run app

go mod tidy
go run main.go

4. Testing API

go test ./tests/...

About

Repository includes modular routers, jwt, GORM, and audit logging.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages