This repository contains the code for a server implementation of the online game dixit. The game is for 3-6 players. Players can add their own decks from Flickr alblums.
Download or clone the respository.
- Get NodeJS from: https://nodejs.org/en/download
- In respository directory run
npm install
- Create a text file in the same folder as
server.js
and call it ".env" (with the . at the front and no file extension). - In that file add theses lines without the brackets (sets up the environment variables for Node):
NODE_ENV=[development or production]
API_KEY=[our flicker api key]
MONGO_DB_URL=[mongoDB cluster url]
Note: Name & Password aren't needed for development while runing with a local Mongo DB on your machine
- Install MongoDB: https://docs.mongodb.com/manual/administration/install-community/
- In a new terminal/cmd prompt run the comands (on windows, file paths use \ instead of / (so use \ in the below cmds):
mkdir data
mkdir data/db
After installation, run npm run dev
in a new terminal/cmd prompt. Then open your browser to the address the server gives you in the terminal (something like http://localhost:5001). The first player that connects creates the lobby, which generates a roomcode. All subsequent players connect to the room code.
Deployed to https://peaceful-dusk-06372.herokuapp.com/ for test usage.
See https://www.flickr.com/services/api/ for flicker API Documentation
run the test script in the json package. npm run test
.
This tests specifically the Game.js object and how it handles game calls.
- npm production packages:
- node-fetch
- socket.io
- mongoose
- express
- npm development packages: