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=IPallows connections from outside the VM). - Go to
http://localhost:3000in your browser to view the page.
ruby --versionEnsure Ruby v2.7.2 using rbenv or RVMsqlite3 --versionEnsure SQLite3 database installationnode --version; yarn -vEnsure Node.js and Yarn installationbundle -vEnsure Bundler installation (withgem install bundler)bundle config set without 'production' && bundle installInstall gem dependencies fromGemfileyarn install --check-filesInstall JS dependencies frompackage.jsonrails db:migrateSetup the database, run migrationsrails db:seedInitialize database with default values (e.g. global chat)rake devise:create_demo_userCreate a demo user (note email & password)rails sStart the Rails development server (default: localhost:3000) and log in using the demo credentialsbundle exec rspecRun the tests (using the RSpec test framework)
bundle exec rails db:migrate RAILS_ENV=development && bundle exec rails db:migrate RAILS_ENV=testMigrate both test and development databasesbundle exec rails assets:clobber && bundle exec rails assets:precompileRedo asset generation
bundle exec rspecRun the full test suite-f docMore 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>.rbSpecify a folder or test file to runbundle exec rspec --profileExamine run time of tests
rake factory_bot:lintCreate each factory and catch any exceptions raised during the creation process (defined inlib/tasks/factory_bot.rake)bundle exec rubocopUse the static code analyzer RuboCop to find possible issues (based on the community Ruby style guide).--auto-correctto fix what can be fixed automatically.- RuboCop's behavior can be controlled using
.rubocop.yml
save_and_open_pagewithin a test to inspect the state of a webpage in a browserrails c --sandboxTest out some code in the Rails console without changing any datarails dbconsoleStarts the CLI of the database you're usingbundle exec rails routesShow all the routes (and their names) of the applicationbundle exec rails aboutShow stats on current Rails installation, including version numbers
rails g migration DoSomethingCreate migration _db/migrate/*DoSomething.rbrails generatetakes a--pretend/-poption 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.
