Skip to content

hotaken/go-todo-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API TODO lists

USED

  • Framework gin-gonic/gin
  • Clean Architecture
  • Dependency injection
  • Docker
  • DataBase: Postgres
  • Migration files generation with migrate
  • Logging: logrus
  • JWT: jwt-go
  • ...

Run app with docker-compose

Server will wait for postgres

docker-compose up --build go-todo-app

Stop

docker-compose down

Some my notes

Docker

Run postgres

docker pull postgres
docker run --name=todo-db -e POSTGRES_PASSWORD='postgres' -p 5436:5432 -d --rm postgres
docker ps

Migrate

Installation

irm get.scoop.sh | iex
scoop install migrate

Migration files generation

migrate create -ext sql -dir ./schema -seq init

Apply migration to db

migrate -path ./schema -database 'postgres://postgres:postgres@0.0.0.0:5436/postgres?sslmode=disable' up

Check migration

docker ps
docker exec -it <id> powershell # /bin/bash
    psql -U postgres
        \d

Migrate down

migrate -path ./schema -database 'postgres://postgres:postgres@0.0.0.0:5436/postgres?sslmode=disable' down

About

Simple REST API made for educational purposes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages