Giter Site home page Giter Site logo

decks-api's Introduction

Decks API

This project provides a REST API for working with card decks.

It provides the following endpoints:

GET /decks/{uuid} - Returns a deck with the given uuid.
POST /decks - Creates a new deck.
PUT /decks/{uuid}/{count} - Draws cards from the deck.

The application use a postgres database to store the decks and cards.

You also need to export some environment variables related to DATABASE:

export DB_USERNAME=postgres
export DB_PASSWORD=postgres
export DB_NAME=decksapi

Possible improvements

I would like to make the code more readable, modular and with a better architecture, but due to my small knowledge in Golang I had to study a lot to learn some patterns, learn the language and understand some good practices. I think that with a little time I can become much more proficient in Golang and I can make better code. I would like for example to better separate some concerns on the application, put persistence code in repositories, create use cases for the entrypoints, etc, but really don't know yet the better way to do this in Golang.

Run Tests

To run tests, run go test -v ./...

Developing

To have the enable live reload while developing, you can use nodemon.

  1. Install nodemon:
npm i -g nodemon
  1. Execute the application with nodemon:
nodemon --watch './**/*.go' --signal SIGTERM --exec 'go' run main.go

TODO

  • Criar Testes
  • Atualizar README

decks-api's People

Contributors

nandooliveira 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.