Skip to content

llan0/go-social

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-social

Using,

Quick setup

  1. Start the DB

    docker-compose up -d
  2. Configure the DB connection

    • Create a .envrc or .env with your DB address. Example (used by Makefile/migrate tools):
      DB_ADDR=postgres://admin:adminpassword@localhost:5432/social?sslmode=disable
      
    • If using direnv, run direnv allow after creating .envrc.
  3. Run migrations

    • Using the migrate CLI:
      migrate -path=./cmd/migrate/migrations -database="${DB_ADDR}" up
    • Or use the Makefile:
      make migrate-up
  4. Build and run the API

    • Build:
      go build -o ./bin/main ./cmd/api/*.go
    • Run:
      ./bin/main
    • OR just air

Useful commands

  • Regenerate docs: make gen-docs (configured to run with Air eveytime atm)
  • Seed DB: make seed
  • Recreate migrations: make migration NAME
  • Run migrations down: make migrate-down NAME (see Makefile)

About

WIP - Personal Blogging Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published