Front end developer here...

I am working with a teammate to create a simulation game. We would like to allow users to create and account (we were going to handle this through local storage or cookies) but are now looking for a solution to handle an actual account.

I figure I could port our scripts over to a Meteor/Rails/CakePHP app fairly easily, but since I don't understand database styled schemas, I'm not sure how to advance on this.

The game essentially stores information about 2 objects player and project, this looks like this:

// project
var players_project = {
            name: "",     //get project name
            category: "", //get category type
            cost: parseInt($('.cost').text(), 10),     //get project cost from office_loc + type
            result: false,     // declared on completion            
            netProfit: 0  // declared on completion

var getPlayerData = function() {
        return {
            name: $("#name").val(),//get name from input
            office_name: $("#office-name").val(), //get name from input
            score: 1000, //players startwith 1k HC
            office_location: "office_loc1", //set Player's office
            office_multiplier: office_loc1, // Set Players office multiplier
            notified: false,
            projects_completed: 0

Apart from this, the basic idea is relatively simple, where upon completion of a task, we update the player variable. The projects that are completed are loaded in through JSON.

My problem exists on, if I were to move to a database system to store logins, would an out of the box rails gem, or MeteorJS app's login be secure? The game doesn't handle personal or private info, but I am looking for a reliable solution.

If this was the solution, how would that schema look? Would I only store the player variable? is there a better solution that maybe deals with a Google sign-on?

Thanks for the help everyone!


Yes, I think you probably ought to move to a web framework. While I'm not familiar with all of the many options out there for OAuth libraries, I think a framework most likely will provide you the most functionality out of the box.

A mature framework like rails will provide robust login and session handling. A database is really the proper place to be storing your user info, whether you use a framework or not. The framework handles this aspect for you really nicely.

The learning curve should not be too great. There are lots of good tutorials out there. And once you know it, you will have this capability in your toolkit for the future.

  • Well the issue is that it isn't on a frame work currently, just a local file being run on a python simple server. I'm wondering if setting up oAuth and caching their session with a google log in might be better / easier? That way I don't have to worry about security or database storage on my end – knocked loose Apr 11 '17 at 15:58
  • @ether, sorry, I misread the question initially. Updated. – user82096 Apr 11 '17 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.