Categorygithub.com/uptrace/go-realworld-example-app
modulepackage
0.0.0-20201109142917-94fc6d26f320
Repository: https://github.com/uptrace/go-realworld-example-app.git
Documentation: pkg.go.dev

# README

Go Gin + go-pg realworld example application

CircleCI PkgGoDev

:heart: Uptrace.dev - distributed traces, logs, and errors in one place

Introduction

This project implements JSON API as specified in RealWorld spec. It was created to demonstrate how to use:

Project structure

Project consists of the following packages:

  • rwe global package parses configs, establishes DB connections etc.
  • org package manages users and tokens.
  • blog package manages articles and comments.
  • app folder contains application resources such as config.
  • cmd/api runs HTTP server with JSON API.
  • cmd/migrate_db command that runs SQL migrations.

The most interesting part for go-pg users is probably article filter.

Project bootstrap

First of all you need to create a config file changing defaults as needed:

cp app/config/dev.yml.default app/config/dev.yml

Project comes with a Makefile that contains following recipes:

  • make db_reset drops existing database and creates a new one.
  • make test runs unit tests.
  • make api_test runs API tests provided by RealWorld.

After checking that tests are passing you can start API HTTP server:

go run cmd/api/*.go -env=dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author