Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

The objective of this project is to develop a networked multiplayer tetris game from a stack of software exclusively Full Stack Javascript

Notifications You must be signed in to change notification settings

louchebem06/red-tetris-42-project

Repository files navigation

Red-tetris-42-project

Test

Branch naming

✨ Feature ✨

  • feat/*
  • feature/*

🐛 Bug fix 🐛

  • fix/*
  • hotfix/*

♻️ Refactorisation du code ♻️

  • facto/*
  • refactorisation/*

Frontend

Framework

Commandes

Developpement and build

  • npm run install
  • npm run dev
  • npm run build

Format, Linter and Syntax

  • npm run format
  • npm run lint
  • npm run check

Test

  • npm run test

BackEnd Documentation

Stack

Static Badge Static Badge Static Badge Static Badge Static Badge

In a new terminal instance, do:

cd backend

Production environment

Install and run the server:

npm install
npm run start

Development environment

Install and run the server with nodemon watching:

npm install
npm run dev

Format & Lint

Run prettier
npm run format
Run eslint
npm run lint

or

npm run lint:fix
Run both
npm run indent

Transpiler

Run babel
npm run build

Units Tests with jest

Run and watch changes
npm run testDev
Run tests
npm run test
Get Coverage
npm run check

ou

npm run test:open

Indent + Build + Test

npm run ibt

.env file

The mandatory environment variables needed to be set are (prod mode):

HOST=localhost
PORT=8080
PROTOCOL=ws
DESTROY_TIMER=15
DISCO_TIMER=15
START_GAME_TIMER=10

The timers variables are set in seconds. Then, into codebase, it will be converted into milliseconds.

DEV

If the DEV variable is set to 1 the server will run in development mode. The timers are decreased to:

  • 10s for DESTROY_TIMER
  • 10s for DISCO_TIMER
  • 10s for START_GAME_TIMER The .env file is automatically created.

UNITSTESTS

If the UNITSTESTS variable is set to 1 the server will run in unit tests mode The timers are decreased to:

  • 1s for DESTROY_TIMER
  • 1s for DISCO_TIMER
  • 5s for START_GAME_TIMER The .env file is automatically created.

PROD

If the DEV and the UNITSTESTS variables are unset, we are in production mode. The timers are decreased to:

  • 15s for DESTROY_TIMER
  • 15s for DISCO_TIMER
  • 10s for START_GAME_TIMER The .env file should be handled by the provider.

Application

cp .env.example .env
docker-compose up

or

make start

About

The objective of this project is to develop a networked multiplayer tetris game from a stack of software exclusively Full Stack Javascript

Topics

Resources

Stars

Watchers

Forks