Skip to content

dinobaggio/starter-go-gin

Repository files navigation

Starter Golang with GIN

  • Gin
  • Database SQL
  • Goose
  • Dockerize
  • Migrations
  • Cobra
  • Unit test
  • Login & Registration
  • JWT

How To Run

Run Dev

make dev

this command will be create docker instance main app and mysql database

Migration

How To Create Migration

make create-migration FILENAME=create_table_users

output file will be on database/migrations

How To Run Migration

go run . migrate

How To Down Migration

go run . migrate:down

Endpoint

GET    /api/v1/healthcheck
POST   /api/v1/auth/login
POST   /api/v1/auth/register
GET    /api/v1/users

Credentials

email: [email protected]

password: password123

GET /api/v1/healthcheck

response :

"It's work"

POST /api/v1/auth/login

payload :

{
    "email": "[email protected]",
    "password": "password123",
}

response :

{
    "message": "success",
    "data": {
        "token": "string",
        "user": {
            "id": "number",
            "uuid": "string",
            "name": "string",
            "email": "string",
            "created_at": "string",
            "updated_at": "string",
            "deleted_at": "string",
        }
    },
}

POST /api/v1/auth/register

payload :

{
    "name": "admin",
    "email": "[email protected]",
    "password": "password123",
    "confirm_password": "password123",
}

response :

{
    "message": "success",
    "data": {
        "user": {
            "id": "number",
            "uuid": "string",
            "name": "string",
            "email": "string",
            "created_at": "string",
            "updated_at": "string",
            "deleted_at": "string",
        }
    },
}

GET /api/v1/auth/users

response :

{
    "message": "success",
    "data": [{
        "id": "number",
        "name": "string",
        "email": "string",
        "created_at": "string",
        "updated_at": "string",
    }],
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages