Coder Social home page Coder Social logo

echo-gorm-realworld-app's Introduction

RealWorld Example App

workflow

Go/Echo/GORM 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 [YOUR_FRAMEWORK] including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the [YOUR_FRAMEWORK] 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

Simple Architecture

Note: cache layer is not implemented yet.

API Server technology stack is

Getting started

Using docker-compose

// build app-server and start mysql, app-server. 
$ make compose.up
./scripts/compose.sh up
Creating network "echo-gorm-realworld-app_default" with the default driver
Creating db ... done
Creating app-server ... done
...

$ docker ps -a
CONTAINER ID   IMAGE                                COMMAND                  CREATED          STATUS          PORTS                                                    NAMES
01c48db0a1ff   zacscoding/echo-gorm-realworld-app   "app-server --config…"   18 minutes ago   Up 17 minutes   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp                app-server
79db7c93b358   mysql:8.0.17                         "docker-entrypoint.s…"   18 minutes ago   Up 18 minutes   33060/tcp, 0.0.0.0:43306->3306/tcp, :::43306->3306/tcp   db

This server will serve on localhost:8080. Schema also migrated from golang-migrate/migrate and migrations.

More commands

Tests and checks lint, build

// This command includes clean tests cache, unit test, datarace, build, lint.
$ make tests

// also can be run each.

// run unit test
$ make test

// run datarace
$ make test.datarace

// check build
$ make test.build

// check lint
$ make lint

Integration tests

After run servers(e.g: make compose.up), u can run integration tests.

$ make it.postman

+++ dirname integration/postman/run-api-tests.sh
++ cd integration/postman

...

┌─────────────────────────┬───────────────────┬──────────────────┐
│                         │          executed │           failed │
├─────────────────────────┼───────────────────┼──────────────────┤
│              iterations │                 1 │                0 │
├─────────────────────────┼───────────────────┼──────────────────┤
│                requests │                32 │                0 │
├─────────────────────────┼───────────────────┼──────────────────┤
│            test-scripts │                48 │                0 │
├─────────────────────────┼───────────────────┼──────────────────┤
│      prerequest-scripts │                18 │                0 │
├─────────────────────────┼───────────────────┼──────────────────┤
│              assertions │               263 │                0 │
├─────────────────────────┴───────────────────┴──────────────────┤
│ total run duration: 17.8s                                      │
├────────────────────────────────────────────────────────────────┤
│ total data received: 5.46KB (approx)                           │
├────────────────────────────────────────────────────────────────┤
│ average response time: 27ms [min: 7ms, max: 120ms, s.d.: 30ms] │
└────────────────────────────────────────────────────────────────┘

TODO

echo-gorm-realworld-app's People

Contributors

zacscoding avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.