Giter VIP home page Giter VIP logo

trashbet's Introduction

TrashBet

SaltyBet - style betting system but in Kotlin-Ktor

ui demo

Features

  • create bets with a binary outcome
  • place wagers on bets with working odds calculation
  • working payouts
  • REST API
  • session auth
  • admin role

Stack

  • Front end
  • Back end
    • ktor microservice framework
    • exposed orm
    • app/src/main/kotlin/trashbet
  • Ops
    • scripts in bin
    • single Dockerfile for the web tier
    • compose setup for web and postgres db

Deploying

# setup app/web/.env
./bin/set-environment.sh
./bin/docker-build.sh
docker-compose up
# first signup will be an admin

app available on port 8080

Running locally

Configuration

Environment variables

TRASHBET_PORT = 8080
TRASHBET_ENVIRONMENT = testing

API

# boot up a local db
./dev-db-run.sh
./gradlew run

health endpoint

web bundle is also being served on this port at the webroot

api spec ¯\_(ツ)_/¯

Web

create app/web/.env

API_ENDPOINT=http://localhost:8080

then run

# from ./app/web
npm install
npm run dev

available on port 5000

Tests

./gradlew test

Contributors

JoelPagliuca

trashbet's People

Contributors

harveyd avatar joelpagliuca avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

harveyd

trashbet's Issues

paying out bets

when a bet is marked complete, pay out the users with the correct wagers

Signup

Just a toggle on the Login page

wager validation

user should not be able to:

  • place more than one wager
  • place a wager <= 0 amount

odds calculation

either on the Bet object as a calculated field or a separate endpoint

Signup flow is jank

Describe the bug
After signup the user has no session so you have to hit the login endpoint immediately after register

Authorization

need a mechanism to only allow certain types of users to perform certain actions such as mark a Bet as complete

Wager entity

Should be tied to a user and bet with an amount

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.