realworld-backend

command module
v0.0.0-...-2c8b9bc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 1 Imported by: 0

README

RealWorld Example App

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

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

We've gone to great lengths to adhere to the Golang community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

Architecture The hexagonal architecture is simply push any external dependency to the edge of the app and keep business logic (service) in the core part. With this architecture we can easily swap external dependencies such as swap restful API to gRPC, mongo to postgres etc.

Getting started

Prerequisite

Simple Mode

Run default app (rest-api, postgres) (see docker-compose.yaml)

$ docker compose --profile restful_postgres up -d

Development Mode

  1. Add environment
    cp env.example .env
    
  2. Run all required external dependency for development (databases)
    $ docker compose up -d
    
  3. Run the app
    $ go run main.go server
    
  4. (optional) See help of application
    $ go run main.go server --help
    
  5. (optional) run app with different dependency
    $ go run main.go server --server grpc --database mongo --log zap
    

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL