A social networking site for gamers to find and connect with other people to play with.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need Ruby installed on your computer. Ruby version 2.4.1 was used during development.
You will also need PostgreSQL installed - http://postgresapp.com (Mac).
# Clone source
$ git clone https://github.com/Greg-Rose/LFGamer.git LFGamer
$ cd LFGamer
# Install bundler
$ gem install bundler
# Bundle install dependencies
$ bundle install
# Create and migrate database
$ rake db:create
$ rake db:migrate
- Create a .env file in project root directory
- Add to .env file:
- RACK_ENV=development
- PORT=3000
- Create a free account at https://api.igdb.com/signup
- Get your API Credentials User Key from your account
- Add user key to .env file:
- IGDB_API_KEY=YOUR_USER_KEY_HERE
- Create an AWS account at https://aws.amazon.com/
- Add your AWS credentials to .env file:
- AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_HERE
- AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY_HERE
- Create an S3 bucket
- Add your S3 bucket name to .env file:
- S3_DEV_BUCKET=YOUR_BUCKET_NAME_HERE
If deploying to production, set bucket environment variable as S3_PRODUCTION_BUCKET=YOUR_PRODUCTION_BUCKET_NAME_HERE
# Run application, by default starts at localhost:3000
$ rails s
Visit the site in your browser at localhost:3000.
To seed the database with games and consoles:
# Run rails console
$ rails c
# Run initial seed
$ PropagateDatabase.initial_seed
To give a user admin status and/or try out admin functionality:
# Run rails console
$ rails c
# Get the user you want to give admin status, for example:
$ new_admin = User.last
# Set admin status
$ new_admin.update_attributes(admin: true)
Tests include both JavaScript and non-JavaScript enabled tests.
# To run non-JavaScript tests:
$ rspec . -t ~js:true
To run the JavaScript enabled tests you will need to install PhantomJS
# Install node and npm
$ brew install node
# Install PhantomJS
$ npm install -g phantomjs-prebuilt
# Run JS tests
$ rspec . -t js:true
# Run all tests
$ rspec