Coder Social home page Coder Social logo

go-backend's Introduction

iDev Soluções' Engineering Challenge

Contents

Description

Command Description
$ make run Run app (development mode) *
$ make run-native Run app (locally in your machine) *
$ make build Build source code
$ make shutdown Shutdown app (development mode)
$ make test Run tests
$ make doc Generate swagger doc files **
$ make format Format code
$ make lint Run linter
$ make audit Audit dependencies

* runs development image (with environment variables)

** once the server is running locally, the Swagger docs can be seen here

Design Choices

  • Gingonic was used as the HTTP web framework, for its benchmarked performance (avoiding reflection and a small memory footprint, and with an efficient router);
  • A MVC architecture was followed, in which the model defines the entities in the given domain; the controller exposes an interface to deal with the entities, and the view (or services, as they are called here) provide the business rules for the manipulation and presentation/visualization of the entities.
  • This approach keeps the code more modular (with separation of concerns), extensible and decoupled, improving developers' experience.

Project Structure

Folder/File Description
main.go Entry point for the app; starts application.
app/ Defines the HTTP server; maps the URLs.
controllers/ Defines the functions called for each of URLs; they handle HTTP requests and respond to them.
services/ Defines and apply business rules.
domain/ Defines the data models of the domain, some related utilities and CRUD operations.
utils/ Defines utility functions.
logger/ Sets up the logger, defined as a global variable.
docs/ Documentation files generated by Swagger.

Next Steps

  • Use document based database (e.g. MongoDB) to store data.
  • Add performance tests;

Docs

go-backend's People

Contributors

danilochilene avatar

Watchers

 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.