Git Product home page Git Product logo

game-room's Introduction

Game Room

Description

A place to centralize your games

Motivation

Creation a core microservice application analogue to frameworks.

  • Premises
    • Handle with two server framework implementation
      • Choose gRPC and fastify
    • Handle with two database implementation
      • Choose in memory to testing and prisma
    • Use value objects with self validation

Entities

  • User
  • Provider

Methods

  • User Register
  • User Login
  • Add Provider
  • Active Provider

gRPC

  • User Register

    • payload:

      {
          "email": string,
          "username": string,
          "password": string,
          "passwordConfirmation": string
      }
  • User Login

    • payload:

      {
          "username": string,
          "password": string
      }
      
  • Add Provider

    • payload:

      {
          "token": string,
          "provider": string,
          "nick": string
      }
  • Active Provider

    • payload:

      {
          "userId": string,
          "provider": string
      }

http (fastify)

  • User Register

    • payload:

      {
          "email": string,
          "username": string,
          "password": string,
          "passwordConfirmation": string
      }
  • User Login

    • payload:

      {
          "username": string,
          "password": string
      }
      
  • Add Provider

    • payload:

      {
          "provider": string,
          "nick": string
      }
    • headers:

      {
          "token": string,
      }

      Secure note: Active Provider method don't exist for http, should create one topic with a subscribe for security reasons, for gRPC one BFF api will not implement this method, gRPC should not have internet network access only direct access to BFF.
      

ENVS

BCRYPT_SALT= salt to bcrypt
JWT_PRIVATE_KEY= jwt private key
JWT_ISSUER= jwt issuer
TOKEN_MAX_AGE= token max age
DATABASE_URL= db url
SERVER_GRPC_PORT=50051
SERVER_HTTP_PORT=3000
SERVER_ADDRESS=0.0.0.0

Running

To run this project, clone it in your machine

  • Go to project folder cd game-room

  • Instal packages pnpm install (if you don't have pnpm in your machine install with npm i -g pnpm)

  • Copy .env.example to .env and edit values

  • Run project with pnpm dev

game-room's People

Contributors

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