GithubHelp home page GithubHelp logo

gordsellar / nationstatesclone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mvassilevsky/nationstatesclone

0.0 1.0 0.0 1.51 MB

A clone of the nation simulation game NationStates.

Ruby 77.11% JavaScript 11.24% CoffeeScript 0.54% CSS 2.90% HTML 8.21%

nationstatesclone's Introduction

NationStatesClone

Heroku link

A clone of the online nation simulator NationStates, built with a Ruby on Rails JSON API and Backbone.js. Users can create nations, address issues facing them, and see how their nation has been affected by their choices.

Implementation

Ruby on Rails

Models

  • Nation - main backend model, stores login information and contains the logic for most of the descriptions
  • Issue - stores the title and body text of an issue, and has IssueOptions
  • IssueOption - stores the effects of an option of an issue
  • NationIssue - links nations to issues
  • NationStat - stores a nation's historical stats

Controllers

  • ApplicationController - handles signing in, logging out, and getting the current nation
  • NationsController - creates a new nation and gets issues for it
  • SessionsController - creates and destroys a user's session
  • API IssuesController - shows, responds to, and dismisses issues
  • API NationsController - shows a nation, renders the index of issues, handles editing settings

Views

  • Application - stores current nation, displays different sidebars depending on whether the user is logged in
  • Login Sidebar - partial, lets the user log in or go to the New Nation page
  • New Nation Sidebar - partial, displayed on New Nation page
  • Errors - displays errors when fields are filled in improperly
  • New Session - user can log in or go to the New Nation page
  • New Nation - has fields for a new nation's motto/currency/etc, and gets questions for the Question partial
  • Question - displays each survey question for nation creation
  • API Issues Index - sends each nation's issue's attributes as JSON for the issue index page
  • API Issues Show - sends an issue's attributes as JSON for the issue show page
  • API Nations Edit - sends a nation's attributes for the edit page
  • API Nations Index - sends each nation's attributes for the World (nation index) page
  • API Nations Show - sends a nation's attributes for the index page

Backbone.js

Collections

  • Nations - overrides parse to extract nations from the response
  • Issues - overrides parse to extract issues from the response

Models

  • Nation
  • Issue

Views

  • IssueIndex - displays a nation's issues
  • IssueShow - displays a specific issue and its options
  • NationsIndex - displays the World page
  • NationShow - displays the nation's stats and description
  • NationEdit - allows editing the logged-in nation's

Router

  • Router - routes to show the View pages

nationstatesclone's People

Contributors

aastudent avatar mvassilevsky avatar

Watchers

 avatar

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.