Git Product home page Git Product logo

bowie-backend's Introduction

Bowie Backend

Bowie is a simple casino lobby. I've created this to learn more about frontend and to fill my portfolio with code, I will be working on it while bored finding job/next challenge.

Development

This is an app I've developed from scratch utilizing Lumen (backend), React/NextJS (frontend), Docker/Kubernetes (container).

This repository contains the backend. For frontend check other repository. Get app run in 1 command on Docker.

Demo

You could check if bowie.casinoman.app is up (vercel.com hosted frontend connected to this backend code in middleware), to give impression:

screen recordings:

login/register screen

pre auth screen login/register more images @ me.casinoman.app or at ryan-west-casino/bowie-media

Casino Features

Has 2 inhouse games which really are filler games, external game is an example available (but obviously you would need to build in your api).

By default you start with 100$ balance, you can change this in App\Http\Controllers\AuthController.

Frontend

Frontend is seperately run and is not in this repository, you can run this in vercel.app, check frontend repository for this.

Setup backend: development/staging

The oficial php image from Google Cloud Platform is updated once in a lifetime so I decided to manage my own php images.

  • Set the .env variables, see .env.example that is already configured to point to pgsql and redis services
  • Run the container with docker-compose up. Alternatively, if you have an older laptop, try running remotely with Blimp.
  • Enter into app container with docker exec -it default-structure-app bash
  • Run php composer, something like composer install --no-cache --no-ansi -n -o
  • Run the migrations with php artisan migrate:fresh
  • Run php artisan key:generate to generate secret hash
  • Run php artisan jwt:secret to set JWT auth secret

And it's up and running, set public domain to this api on frontend :)

Setup backend: production

See the contents of the .k8s folder :)

Alternative Images

If you would turn this setup up for production and scale, you should probably be using alpine on most php images, you can find example in Dockerfile.alpine.

Base Lumen API Features

  • 2FA
  • ACL
  • Audit
  • CORS
  • Device authorization
  • Etag
  • Lumen (9x)
  • Login
  • Login history
  • Multiple localizations, preconfigured with en_US and pt_BR
  • Password reset
  • Password must not be in one of the 4 million weak passwords
  • PHPCS PSR2, phpinsights and sonarqube analysis
  • Register
  • Swoole
  • Tests
  • Transactional events: Listen to events and send notifications only if the transaction is commited
  • uuid

Database structure

Screen Shot 2019-05-26 at 17 55 32

Routes

Screen Shot 2019-05-26 at 17 56 41

bowie-backend's People

Contributors

ryan-west-casino avatar

Stargazers

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