Main branch: , deployed version: Heroku link
Dev branch: , deployed version: Heroku link
A web application for organizing and arranging networks, relationships and human connections, written in Ruby on Rails. Created in the Software Engineering II course at the HPI in Potsdam.
- To create the VM, run
vagrant up
(based on theVagrantfile
). - Enter the machine using
vagrant ssh
. - Go to the project directory
cd hpi-swt2
. - Start the dev server
rails s -b 0.0.0.0
(-b
/--binding=IP
allows connections from outside the VM). - Go to
http://localhost:3000
in your browser to view the page.
ruby --version
Ensure Ruby v2.7.2 using rbenv or RVMsqlite3 --version
Ensure SQLite3 database installationnode --version; yarn -v
Ensure Node.js and Yarn installationbundle -v
Ensure Bundler installation (withgem install bundler
)bundle config set without 'production' && bundle install
Install gem dependencies fromGemfile
yarn install --check-files
Install JS dependencies frompackage.json
rails db:migrate
Setup the database, run migrationsrails db:seed
Initialize database with default values (e.g. global chat)rake devise:create_demo_user
Create a demo user (note email & password)rails s
Start the Rails development server (default: localhost:3000) and log in using the demo credentialsbundle exec rspec
Run the tests (using the RSpec test framework)
bundle exec rails db:migrate RAILS_ENV=development && bundle exec rails db:migrate RAILS_ENV=test
Migrate both test and development databasesbundle exec rails assets:clobber && bundle exec rails assets:precompile
Redo asset generation
bundle exec rspec
Run the full test suite-f doc
More detailed test output-e 'search keyword in test name'
Specify what tests to run dynamically--exclude-pattern "spec/features/**/*.rb"
Exclude feature tests (which are typically fairly slow)
bundle exec rspec spec/<rest_of_file_path>.rb
Specify a folder or test file to runbundle exec rspec --profile
Examine run time of tests
rake factory_bot:lint
Create each factory and catch any exceptions raised during the creation process (defined inlib/tasks/factory_bot.rake
)bundle exec rubocop
Use the static code analyzer RuboCop to find possible issues (based on the community Ruby style guide).--auto-correct
to fix what can be fixed automatically.- RuboCop's behavior can be controlled using
.rubocop.yml
save_and_open_page
within a test to inspect the state of a webpage in a browserrails c --sandbox
Test out some code in the Rails console without changing any datarails dbconsole
Starts the CLI of the database you're usingbundle exec rails routes
Show all the routes (and their names) of the applicationbundle exec rails about
Show stats on current Rails installation, including version numbers
rails g migration DoSomething
Create migration _db/migrate/*DoSomething.rbrails generate
takes a--pretend
/-p
option that shows what will be generated without changing anything
RubyMine, an IntelliJ-IDE designed for ruby projects supports generating an uml class diagram from the database scheme. An Instruction can be found here: https://www.jetbrains.com/help/ruby/creating-diagrams.html#creating-explain-query-plan.
Currently, a file named class-diagram.png
in the projects root folder is linked in this README. So by overwriting this file, or adding a new one to the README, the current model dependencies can be updated.