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 rbenvAfter installation, please follow the message to configure .bashrc or your shell config.
rbenv install 3.0.4You 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 bundlerBefore install PostgreSQL, please check the version is pin with correct version.
# Install
brew install postgresql@13
# Start server
brew services start postgresql@13We will need Node.js to compile JavaScript and CSS.
brew install nodeThe Rails use yarn as package manager for Node.js.
brew install yarnThe 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 --installOvercommit 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/devYou can see the website at http://localhost:3000
Run db:migrate again to update the schema
bundle exec rake db:migrateOur project use Foreman to run Rails server with JavaScript / CSS compiler.
gem install foremanbundle exec rspecbundle exec cucumberbundle exec rubocopbundle exec brakemanCreate a .env will allow you change settings in local dev environment.
cp .env.example .envThere 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.