Git Product home page Git Product logo

guts-theater's Introduction

Guts Theater

Project description

This project is an api created using go-chi and couchdb, to provide a way to seat multiple customer groups inside a theater hall. The project is written in Go and uses Docker for deployment.

Usage

As the project doesn't require any explicit configuration, you can start a couchdb instance on port 5984 and build and run the project. For client access another repository has been provided which is written in React.

In order to ease the deployment process, a docker-compose.yml configuration has been provided in guts-theater-combined which can be run using:

docker-compose up --build

This docker-compose will run the api project (current repository), the client ( granted that the client project is stored in the same directory as this repo), a couchdb instance, and Prometheus and Grafana to provide instrumentation.

After starting the docker-compose, you can visit the client : http://localhost:4005 or visit the api: http://localhost:4000.

To make sure the API is online, please visit healthz.

In order to test the functionality of the application, please:

  1. Create at least one section
  2. Create at least one row
  3. Create at least one seat
  4. Create at least one group
  5. Call the trigger seating API

API

The API is written using go-chi router and is located in the /api directory. The API follows the rest pattern, providing CRUD operations for all the models ( some operations have been omitted to prevent breaking the flow of the application).

Get     /seats
Get     /seats/{section}

Get     /section
Post    /section
Put     /section/{section}
Delete  /section/{section}

Get     /section/{section}/rows
Post    /section/{section}/row
Delete  /section/{section}/row/{row}

Get     /section/{section}/seats
Post    /section/{section}/row/{row}/seat
Put     /section/{section}/row/{row}/seat/{seat}
Delete  /section/{section}/row/{row}/seat/{seat}

Get     /groups
Post    /groups

Get     /ticket
Get     /ticket/{groupId}

Post    /trigger-seating

Environment variables

  • SENTRY_DSN

    type: string

    default: empty string

  • ADDRESS

    type: string

    default: empty string

  • PORT

    type: string

    default: 4000

  • DB_HOST

    type: string

    default: localhost

  • DB_USER

    type: string

    default: admin

  • DB_PASSWORD

    type: string

    default: password

  • DB_NAME

    type: string

    default: guts

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.