https://github.com/myworldbox/interactive-tetris
Interactive Tetris
https://github.com/myworldbox/interactive-tetris
comp4021 css docker express-js hkust html jquery js socket-io
Last synced: 3 months ago
JSON representation
Interactive Tetris
- Host: GitHub
- URL: https://github.com/myworldbox/interactive-tetris
- Owner: myworldbox
- Created: 2023-04-24T06:21:35.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-09T14:39:33.000Z (about 3 years ago)
- Last Synced: 2026-01-03T13:19:54.238Z (6 months ago)
- Topics: comp4021, css, docker, express-js, hkust, html, jquery, js, socket-io
- Language: JavaScript
- Homepage:
- Size: 55.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Interactive Tetris
HTML + CSS + JavaScript + Docker + Express.JS + Socket.io
## Quick start
```bash
# clone repo
git clone https://github.com/myworldbox/interactive-tetris.git
# download module
1. npm install
2. yarn
3. docker build . -t interactive-tetris
# start development
1. npm start
2. yarn start
3. docker run -d -p 8000:8000 interactive-tetris
```
## useful command
```bash
# quick github commit
1. npm commit
2. yarn commit
# sync latest change from GitHub
1. npm refresh
2. yarn refresh
```
## api
```bash
# function can be triggered by both POST request
# [ POST ] - req.body
# root
/
# register function
/register
`{
"username": "victor",
"name": "Victor",
"password": "password"
}`
Response:
1. Username is empty:
`{ status: "error", error: "username is empty" }`
2. Username contains special characters (using lab 5 regex):
`{ status: "error", error: "username should contains only underscores, letters or numbers" }`
3. Username already exists:
`{ status: "error", error: "username already exists" }`
4. Name is empty:
`{ status: "error", error: "name is empty" }`
5. Password is empty:
`{ status: "error", error: "password is empty" }`
6. Success:
`{ status: "success", message: "users has been created" }`
# sign in function
/signIn
`{
"username": "victor",
"password": "password"
}`
Response:
1. Username does not exists:
`{ status: "error", error: "user does not exists" }`
2. Password is incorrect:
`{ status: "error", error: "password is incorrect" }`
3. Success:
`{ status: "success", message: "successfully logged in", user: { name: "Victor", username: "victor"} }`
```
## vercel deployment
[](https://vercel.com/new/project?template=https://github.com/myworldbox/interactive-tetris)