A match making game server designed to bring together players based on a weighted set of attributes then offload the rest of the communication to a peer-to-peer communication layer when possible for all the heavy chatter.
- Connects to database and gets a list of online users (unbounded?)
- Stores a vector filled with meta data about previous games and connections
- Offline summations over previous games to cluster players for recommendations (maybe)
- Weighted decision tree of basic checks between players during each connection (svd?)
- Geolocation distance (mercator projection based on lat/lng or lib?)
- Previous plays (might need to store some data in a graph)
- Latency
- Estimated level (could use #3)
Using Node.js primarily for the base server component in this version. It is possible to replace with more tested production systems such as Eventmachine or Twisted.
All Javascript is written in Coffeescript.
For testing Mocha is used as the BDD testing suite of choice.
The storage of user related information is stored in MongoDB in order to take advantage of the aggregation framework. This is an arbitrary choice based on the thinking that the server will not be selecting all players from a partition who are online and instead grabbing player meta data based on the list of those online. A relational database might be found more efficient in which case the data abstraction layer should be interchangeable.
* / #root project directory
-> /test #bdd tests
-> /models #data abstraction layer tests
-> /controllers #business logic
-> /views #response format tests
-> /log #development logs stored here (prod goes to logging service)
-> /config #configuration files
-> /locale #language translations (probably not needed for this)
-> /{en,eu,es,…}
-> /environments #separate configurations for each environment in YAML format (npm config?)
-> /{development,staging,production}.yml
-> /app #base server directory
-> /models #data abstraction layer
-> /controllers #controller for business logic
-> /views #format for the data being returned for each request
-> package.json #npm packages required to run project
In order to run the project the required libraries need to be installed.
Installation of required NPM packages can be installed by running npm install
from the base project directory.
Once the required libraries are installed the server can be run with the command mongod
which will also start MongoDB on your local system.
Tests can be run with the command jasmine-node --autotest --color --coffee spec
.
# install node.js
cd /home/user/projects/match-maker
npm install
mongod
mocha test/*.coffee
coffee app/server.js.coffee