Skip to content

inglemr/Gamification

Repository files navigation

Version Data

  • Ruby: 2.3.0
  • Rails: 4.2.4
  • Database: postgresql

#Application Test Environments

Setup Locally

  • Install Postgres
    • Install PgAdmin (Optional) - Helpful with Database manipulation
  • Install Ruby
  • Install Rails
  • Install ImageMagick for images
  • Clone this repository locally using git clone git@github.com:inglemr/Gamification.git
    • Navigate inside the capstone directory cd capstone
    • Install all the gems from the gemfile using bundle install
    • Run database migrations rake db:migrate
    • Run database seed rake db:seed (This will add all permissions into the database and the admin role)
    • Run the local development server using rails server
    • Navigate to the app at localhost:3000
    • The app has been succesffuly installed

Manage User Accounts

Adding admin to a user

  • User roles can be added through the rails console by navigating to the root directory of the app and using the command rails console
  • Once the console has started run the follow command to find your user in the database user = User.find_by(:email => "your_email")
  • To add a role to this user simply use user.add_role :Admin(Case is important) to add the admin role

App Documentation

Documentation was generated using YARD

The application source code also includes 2 ERD documents to help visulize the relationships in the database

  • Generate Documentation and Viewing it
    • Documentation can be generated in a development environment by running yard doc this only needs to be done as code changes are made
    • The documentation can then be viewed by running yard server which runs a local server that host the HTML documenation and can be viewed by going to localhost:8808(Default port)
    • This server can run alongside the application server since they utilize different ports

Deploying application to production environment

Deployment Information

Gamification has been setup to use Passenger/Nginx as its application server

Deployment Steps

  • Deployment has been simplified and simply requires that your machine has ssh access into the production server
  • Deployments can be made by simply typing cap production deploy this command should be run on your local development machine. NOTE: The deployment pulls data from github so ensure that the repo is updated with the commits you are intending to deploy
  • All deployment task are automated by using capistrano

Development Roadmap

Future Development Ideas

  • Utilize a backend job/worker scheduler Resque/Redis to handle long running jobs that would otherwise slow down the web facing interface. For example the worker would preform the operation and the web interface should be informed on its complition. A good example of an operation that could use this functionality is when a user creates recurring events or when a user updates there records from RAIN
  • Add hard coded site settings to the database that stores settings in key value pairs ( each setting being a diffrent record) this would allow an admin to change settings in the web interface such as the range of points available or the colors of the website. This would make the application more dynamic and allow for administration to make large scale changes without needing to change the application source code