A lightweight backend system built in Go designed to simplify the management and access to data through APIs.
- Database Migrations: Easily create, manage, and rollback database migrations using simple command-line operations.
- ORM: A simple ORM that allows you to interact with the database using Go structs (XORM).
- API Controllers: Facilitate and manage RESTful APIs that enable clients to interact with the backend.
import "time"
type Bober struct {
ID string `xorm:"pk uuid 'id'"`
Name string `xorm:"varchar(255) 'name'"`
Age int `xorm:"int 'age'"`
CreatedAt time.Time `xorm:"created"`
UpdatedAt time.Time `xorm:"updated"`
}
- Go (version 1.22 or higher)
- A PostgreSQL Database
Step 1: Clone the repository
git clone https://github.com/ximmanuel/Gyad.git
Step 2: Rename the .env.example
file to .env
and adjust the values
cp .env.example .env
Step 3: Run the application
go run cmd/main.go
Create Migration
./migration create bober
Run all migrations:
./migration migrate all
Migrations are executed one after the other based on the timestamps.
Run specific migratrion:
./migration migrate bober
Rollback specific migration:
./migration rollback bober