Golang + Revel 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 + Revel including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the Golang + Revel community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
Below is the recommended layout of a Revel application, supplemented with domain entities and services.
my_gocode/ - GOPATH root
src/ - GOPATH src/ directory
github.com/revel/revel/ - Revel source code
bitbucket.org/me/sample/ - Sample app root
entities/ - domain entities
app/ - app sources
controllers/ - app controllers
init.go - interceptor registration
models/ - app domain models
jobs/ - app domain jobs
services/ - app domain services
routes/ - reverse routes (generated code)
views/ - templates
tmp/ - app main file, generated code
tests/ - test suites
conf/ - configuration files
app.conf - main configuration file
routes - routes definition file
messages/ - i18n message files
public/ - static/public assets
css/ - stylesheet files
js/ - javascript files
images/ - image files
- Install docker and docker-compose to your system
- Add
127.0.0.1 api.realworld.wip
to your/etc/hosts
file - Copy
.env.docker
to.env
in the project root - Start nginx-proxy
- Generate a Docker bundle from the Compose file
docker-compose build
- Create and start containers
docker-compose up
- To start the nginx-proxy, type the following command:
docker run -d -p 80:80 -p 443:443 --name nginx-proxy --net reverse-proxy -v $HOME/certs:/etc/nginx/certs:ro -v /etc/nginx/vhost.d -v /usr/share/nginx/html -v /var/run/docker.sock:/tmp/docker.sock:ro --label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true jwilder/nginx-proxy