Skip to content

azacha/intellisnake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntelliSnake

Frontend

TypeScript project. No 3rd party deps except during development (nodemon, etc), see frontend/package.json.

Backend

Python with Tensorflow.

Communication

FE and BE communicate via WebSocket connection.

Messages

  • are always JSON
  • must contain type (string) and messageId (integer)
  • some types must contain data (object/hashmap/dict) as well

Example:

{
  "messageId": 0,
  "type": "start",
  "data": {}
}

Protocol

FE -> BE:
  {
    messageId: [0..],
    type: generation,
    data: { snakeIds: [a, b, c, ...] }
  }
BE -> FE:
  {
    messageId: [0..],
    type: generation,
    data: { generation: [0..] }
  }
FE -> BE:
  {
    messageId: [0..],
    type: data,
    data: { 0: { id: 0, ... }, 1: { id: 1, ... } }
  }
BE -> FE:
  {
    messageId: [0..],
    type: data,
    data: { prediction: { 0: [a, b], 1: [...] }, progress: [0..1] }
  }
FE -> BE:
  {
    messageId: [0..],
    type: data,
    data: { 0: { id: 0, ... }, 1: { id: 1, ... } }
  }
BE -> FE:
  {
    messageId: [0..],
    type: data,
    data: { prediction: { 0: [a, b], 1: [...] }, progress: [0..1] }
  }
...
BE -> FE:
  {
    messageId: [0..],
    type: generation,
    data: { generation: 1 }
  }
FE -> BE:
  {
    messageId: [0..],
    type: data,
    data: { 0: { id: 0, ... }, 1: { id: 1, ... } }
  }
...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 63.0%
  • Python 27.8%
  • CSS 4.4%
  • JavaScript 4.1%
  • HTML 0.7%