Giter Site home page Giter Site logo

survey-app's Introduction

Survey App

Requirements

Refer here

Prerequisites

  1. Go 1.16

How To Run

From project root directory run:

$ go build -o survey-platform cmd/main.go
$ ./survey-platform

Alternatively, you can run the application after running tests with a single command if GNU Make is installed

$ make all

API docs

The API docs for this application can be found here as a postman collection. The environment required for the collection is added here

The default value for APP_PORT is 8000. It can be overridden by setting environment variable APP_PORT to the required port.

How to Test

From project root directory run:

$ go test -cover -race ./...

Running with Docker & docker-compose

Prerequisites

  1. docker
  2. docker-compose

Instructions

Run

$ docker-compose up

This will build docker and run application in a docker container. Port mapping is done from 8000:8000 In case need to change the port on host, change the first argument to the required port, like 9000:8000

Swagger Docs

swag init -g cmd/main.go

Run server and go to http://localhost:8080/swagger/index.html from browser

NOTE

No particular database is used for this application. On application exit, the current data is dumped to a json file to persist the data so that it will be loaded in the subsequent app run.

As an extension, if a db needs to be added it can be added easily into the repo layer with minimal changes as another implementation

While running in docker mode, volume mapping needs to considered for persisting the file to host machine

survey-app's People

Contributors

jeffy-mathew 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.