Code Monkey home page Code Monkey logo

interactive-tetris's Introduction

Interactive Tetris

HTML + CSS + JavaScript + Docker + Express.JS + Socket.io

Quick start

# 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

# quick github commit
1. npm commit
2. yarn commit

# sync latest change from GitHub
1. npm refresh
2. yarn refresh

api

# 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

Deploy with Vercel

interactive-tetris's People

Contributors

ansonli23 avatar myworldbox avatar

Watchers

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