Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

aitorfernandez/roshambo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Roshambo

An overengineering Rock, Paper, Scissors for fun.

Roshambo Features

  • GraphQL
  • Dataloader and Cache
  • Passwordless with magic link
  • JWT
  • Own React UI components
  • Own gRPC microservices architecture (gateway, account, profile, stats, mail)

Roshambo Tech Tools

Frontend

  • React
  • Apollo GraphQL
  • Jest
  • Storybook
  • Styled Components
  • Webpack

Backend

  • Golang
  • gorilla/mux
  • GraphQL
  • Postgres
  • Redis
  • gRPC and protocol buffers
  • Docker

Installation, Dependencies and Running Roshambo

Clone this repo to your local machine using:

git clone git@github.com:aitorfernandez/roshambo.git
cd roshambo

Docker containers

Databases

One database per microservice

make docker-up SRV=roshambo_account_postgres
make docker-up SRV=roshambo_profile_postgres
make docker-up SRV=roshambo_stat_postgres

Database migrations

make migrate-account ACTION=up
make migrate-profile ACTION=up
make migrate-stat ACTION=up

Config

Roshambo use Redis for handle secrets and config variables

docker-up SRV=roshambo_redis

Populate environment variables

make env

make env command will look for a file .env.dev.redis in the root project. An example for a config file is:

HSET app env "dev"
HSET app secret "123456"

HSET gateway addr ":4040"

HSET account addr ":5010"
HSET account psql "postgres://postgres:postgres@0.0.0.0:5410/roshambo"

HSET mail addr ":5020"

HSET profile addr ":5030"
HSET profile psql "postgres://postgres:postgres@0.0.0.0:5430/roshambo"

HSET stat addr ":5040"
HSET stat psql "postgres://postgres:postgres@0.0.0.0:5440/roshambo"

HSET gmail addr "smtp.gmail.com:587"
HSET gmail host "smtp.gmail.com"
HSET gmail identity ""
HSET gmail password "123456"
HSET gmail username "rosambo@gmail.com"

HSET jwt secret "123456"
HSET jwt expires "3650"

Running services

Open a new terminal per service to see output logs

make run-account
make run-profile
make run-stat
make run-gateway

Frontend

Install dependencies using yarn

cd app
yarn install

Run the frontend using yarn inside the app folder or in the root project using make

yarn dev
make run-app

Screenshots

Get Started

GetStarted Screen

Game

Game Screen