The Sci-Fi Robot Game which is written in Rails.
Status |
---|
- Ruby ~> 3.0.4
- PostgreSQL ~> 14.0
- Node.js ~> 16.0
The development environment is based on macOS.
We use Homebrew to manage the packages on macOS.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
We can use brew doctor
to ensure the Homebrew is available after installing it.
To smooth upgrade the Ruby version, we choose rbenv
to manage the Ruby versions.
brew install rbenv
After installation, please follow the message to configure .bashrc
or your shell config.
rbenv install 3.0.4
You may need to install bundler
by yourself if the bundle
command is not found.
# Ensure already switch to correct Ruby version
ruby -v
# => ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-darwin21]
gem install bundler
Before install PostgreSQL, please check the version is pin with correct version.
# Install
brew install postgresql@13
# Start server
brew services start postgresql@13
We will need Node.js to compile JavaScript and CSS.
brew install node
The Rails use yarn
as package manager for Node.js.
brew install yarn
The Node.js version doesn't constraint to specify the version, the latest stable version is suggested.
Use git clone [email protected]:BasalticStudio/new-era.git
to your machine.
# Switch to project folder.
cd new-era
# Install ncessary packages
bundle install
yarn install
# Setup the git hook
bundle exec overcommit --install
Overcommit will check for:
- pre-commit: rubocop for syntax, sorbet for type check
- pre-push: brakeman for security auditing
# Initialize batabase
bundle exec rake db:create
# Update schema to latest version
bundle exec rake db:migrate
./bin/dev
You can see the website at http://localhost:3000
Run db:migrate
again to update the schema
bundle exec rake db:migrate
Our project use Foreman to run Rails server with JavaScript / CSS compiler.
gem install foreman
bundle exec rspec
bundle exec cucumber
bundle exec rubocop
bundle exec brakeman
Create a .env
will allow you change settings in local dev environment.
cp .env.example .env
There are two license for source code and assets.
The source code is released under Apache 2.0 and the assets is under CC BY-NC-SA 4.0.