/realworld-gin-sqlc

Real world backend api made with Golang + Gin + PostgreSQL

Primary LanguageGoMIT LicenseMIT

RealWorld Example App

test License: MIT

Golang/Gin codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with Golang/Gin including CRUD operations, authentication, routing, pagination, and more.

How it works

Diagram

Getting started

Running the project locally:

    docker-compose up -d // starts postgres container
    go run main.go

Project starts on port 8085 by default and swagger documentation is available at http://localhost:8085/swagger/index.html.

E2E testing

First, run:

   make test-run 

This will start postgres container and the project itself. Then, run the tests with:

    make e2e-test

Unit testing

    make unit-test

TODO

  • Add unit tests for handlers (... in progress)
  • Improve error handling and logging
  • Improve deployment and testing configuration (Makefile, docker-compose, etc.) ( ... in progress)
  • Add search feature (/search, ...)