Code Monkey home page Code Monkey logo

playfab-es6-webpack's Introduction

PlayFab ES6/Webpack Boilerplate

This is a boilerplate for Javascript based PlayFab projects, which includes the following features:

  • ES6 compatible syntax. You can use multiple files to modularise your code and relate them through import syntax.
  • A build script that combine your code into PlayFab compatible bundle
  • A deploy script that deploy your code to multiple PlayFab projects
  • A data synchronisation tool to make sure Catalogs, Currencies and Statistics are identical across multiple projects.

Initial Setup

This project is meant to be a starting point of a PlayFab project. You can simply download or fork the project and change package.json to your needs.

Installation

npm install

This will install all the required library.

Configuration

This project make use of the excellent node-config library.

You can simply define settings for multiple PlayFab projects using the usual development / test / production notation.

The project uses YAML format for configuration by default, but you can change it to whatever suits the task.

Change config/development.yaml to include your PlayFab App ID and Secret key.

IMPORTANT Since the Secret key is meant to be keep secret, make sure not to push to a public repository. You can instead create development-local.yaml and add it to .gitignore.

Building and Publishing

# Create bundle under `dist/app.js`
npm run build

# Create and deploy to PlayFab (but not making it the live version)
npm run deploy

# Create bundle and publish (make it the live version)
npm run publish

# Publish to production (NOTE: proceed with caution)
NODE_ENV=production npm run publish

Title Data Synchronisation

Title data can be defined under title/. You can update your PlayFab environment as follow:

# Update development environment
npm run sync

# Update production environment (NOTE: proceed with caution)
NODE_ENV=production npm run sync

Title data are expected to be in JSON format since this is the format PlayFab used for importing/exporting data.

Catalog

Catalog data can be defined with file names with catalog-[CATALOG_NAME].json pattern (e.g. catalog-items.json)

The format should be the same as if you download a JSON file from PlayFab's admin panel.

Multiple catalogs can be defined as long as the file pattern matches.

Currency

Currency information can be defined with currencies.json.

Again, the format is identical to what PlayFab exports.

Statistics

Statistics information can be defined with statistics.json.

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.