Skip to content

Backend implementation of Realworld Application (Medium Clone)

License

Notifications You must be signed in to change notification settings

labasubagia/realworld-backend

Repository files navigation

RealWorld Example App

Golang Hexagonal Architecture 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 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

About

Backend implementation of Realworld Application (Medium Clone)

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages