Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vbrazhnik/red-tetris
School 42 project // Multiplayer Tetris [Node.js, Socket.io, React, Redux]
https://github.com/vbrazhnik/red-tetris
42 42projects 42school born2code ecmascript2015 ecmascript6 javascript js node-js react red-tetris redux socket-io tetris tetris-game unitfactory
Last synced: about 1 month ago
JSON representation
School 42 project // Multiplayer Tetris [Node.js, Socket.io, React, Redux]
- Host: GitHub
- URL: https://github.com/vbrazhnik/red-tetris
- Owner: VBrazhnik
- Created: 2020-02-04T23:40:44.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-07T19:54:14.000Z (about 5 years ago)
- Last Synced: 2024-11-12T20:14:26.237Z (3 months ago)
- Topics: 42, 42projects, 42school, born2code, ecmascript2015, ecmascript6, javascript, js, node-js, react, red-tetris, redux, socket-io, tetris, tetris-game, unitfactory
- Language: JavaScript
- Homepage:
- Size: 3.45 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Red Tetris
![Loading screen](/images/loading-screen.png)
**Red Tetris** is a School 42 project. The purpose of this project is to create multiplayer Tetris.
[`red_tetris.en.pdf`](/red_tetris.en.pdf) is the task file.
## Requirements
It is a Full-Stack JavaScript project. So installed [Node.js](https://nodejs.org) and [npm](https://www.npmjs.com/get-npm) are required:
* Node.js >= 8.0.0 (`node --version`)
* npm >= 5.0.0 (`npm --version`)> Note: npm is installed with Node.js.
## How to install?
Clone repository:
```
git clone
```Then go into the created directory and install `node_modules`:
```
npm install
```## How to start?
To start the server run the following command:
```
npm start
```The server will start on [http://127.0.0.1:3000](http://127.0.0.1:3000).
> Note: Configuration (host and port) can be changed in [`.env`](/.env) file.
## How to join the room?
To join the room use the URL with the following structure:
`http://127.0.0.1:3000/#[]`
* `` is a placeholder of the name of the room
* `` is a placeholder of the name of the playerFor example, to join room **“42”** under the name **“vbrazhni”** use [http://127.0.0.1:3000/#42[vbrazhni]](http://127.0.0.1:3000/#42[vbrazhni]).
> Note: Also, the URL can be encoded — [http://127.0.0.1:3000/#42%5Bvbrazhni%5D](http://127.0.0.1:3000/#42%5Bvbrazhni%5D)
![Pending single game](/images/pending-single-game.png)
![Running single game](/images/running-single-game.png)
## How to test?
To run unit tests use:
```
npm test
```Also, Red Tetris project has the following requirements of the code coverage:
* Statements — 70+%
* Branches — 50+%
* Functions — 70+%
* Lines — 70+%To get the detailed report about the code coverage of each file run:
```
npm run test:coverage
```To get the summary report use:
```
npm run test:coverage:summary
```## How to make available on another computer?
You can use [ngrok](https://ngrok.com/) to make Red Tetris available worldwide.
After setup, run the following command:
```
./ngrok http 3000
```ngrok will provide the URL which can be shared with anyone:
![ngrok](/images/ngrok.png)
With that URL other people will be able to play Red Tetris via the Internet.
![Running multiplayer game](/images/running-multiplayer-game.png)
![Completed multiplayer game](/images/completed-multiplayer-game.png)