From 2ac55c3c0b4d4dbdb5e8e79fbd8a913d31716556 Mon Sep 17 00:00:00 2001 From: Malte S Date: Sun, 19 Nov 2023 10:34:44 +0100 Subject: [PATCH 1/4] chenges to the readme --- readme.md | 62 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/readme.md b/readme.md index 765ccf9..0cc1bd8 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ This project contains all dependencies and services required by other nerdgescho ### Auto-Start Mode -To have the environment start automatically when _Docker_ start, execute the following command once. +To have the environment start automatically when _Docker_ starts, execute the following command once. docker compose up -d @@ -34,6 +34,10 @@ You can check your ruby version by typing this in your project folder: If a version is not installed, you can add it by `rbenv install x.x.x`. +## node + +Make sure you have node installed. In order to do that use a version manager of your choice, such as [nvm](https://github.com/nvm-sh/nvm) or [volta](https://volta.sh/). + ## Rails Now let’s install Rails. @@ -54,6 +58,10 @@ Then you will need to run this to install the ruby dependencies. bundle install +Or for short just + + bundle + ### MySQL Troubleshooting During the bundle install you may face an error with mysql, in that case just follow the instructions on the error. @@ -89,12 +97,6 @@ If `bundle install` fails for the GEM `pg`, install `postgresql`: brew install postgresql -## docker-compose - -Now to setup we development environment we use `docker-compose`. - - docker-compose up - ## yarn Now to install the Javascript dependencies we use `yarn`. @@ -111,6 +113,12 @@ To resolve dependencies of a project: Now let’s setup up the database. +For most projects there should be a setup script available. + + bin/setup + +If that does not work, follow these steps: + First we create the database. rails db:create @@ -125,14 +133,44 @@ Then we will seed our database with fake data for testing. If you are interested in finding out what is going on behind the scenes (because it’s doing a lot and you will feel like the process just hanged) you can use `tail log/development.log` to hook into and view the log file. -## Rails Server +## Start the application + +Now that we have everything setup, we can start by running + + bin/dev + +This sets up everything you need such as a rails server, a background worker and a second server for the frontend if needed. +You can connect to the a session in a new terminal tab with + + overmind c web -Now that we have everything setup we can finally start the server. +for the server, and + + overmind c worker + +for the background worker. + +In the background there are these processes running: + +### Rails Server + +This is how to manually start the server. rails s The default app port is `3000`, so if you navigate to [localhost:3000](https://localhost:3000) you should see a page (depending on the project). +### Sidekiq + +We use sidekiq for background jobs. If you start the server manually use a new terminal tab to run: + + sidekiq + +### frontend + +Please refer to the readme of the specific project for information. +In most cases the default port for the frontend will be `8080` ([localhost:8080](https://localhost:8080)). + ## guard With the above setup we will see our code changes when we refresh the page, but to make our development life easier we will also do the following. @@ -141,12 +179,6 @@ Run `guard` to watch for changed files, reload our website on change and re-run guard -Run a `webpack` dev server to make our javascript updates faster. - - bin/webpack-dev-server - -With that in place you can start developing. - # Feature Specific Installations: ## imagemagick From f629155d435a827b8a4ad84bdd269225f5364727 Mon Sep 17 00:00:00 2001 From: Malte S Date: Sun, 19 Nov 2023 10:34:54 +0100 Subject: [PATCH 2/4] changes to the template --- rails-template.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rails-template.rb b/rails-template.rb index abf8d94..4e77a85 100644 --- a/rails-template.rb +++ b/rails-template.rb @@ -5,7 +5,7 @@ ruby File.read(".ruby-version").strip # Core - gem "rails", "7.0.3" + gem "rails", "7.1.2" gem "puma" # Database @@ -61,7 +61,6 @@ gem "rb-fsevent" gem "letter_opener" gem "debug" - gem "pry-rails" gem "guard" gem "guard-rspec" gem "solargraph-standardrb" From d9040ee4de608089372bbb181459c45dc74a4ea8 Mon Sep 17 00:00:00 2001 From: Malte S Date: Tue, 28 Nov 2023 17:23:07 +0100 Subject: [PATCH 3/4] met volta be the one to rule them all --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 0cc1bd8..131cc46 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,7 @@ If a version is not installed, you can add it by `rbenv install x.x.x`. ## node -Make sure you have node installed. In order to do that use a version manager of your choice, such as [nvm](https://github.com/nvm-sh/nvm) or [volta](https://volta.sh/). +Make sure you have node installed. Use volta as your version manager, follow the steps as decribed in the [docs](https://docs.volta.sh/guide/). ## Rails From 9faf5c8fc912ef993bd76e0afa376a2eed7c0026 Mon Sep 17 00:00:00 2001 From: Malte S Date: Tue, 28 Nov 2023 18:57:26 +0100 Subject: [PATCH 4/4] suggest asdf as well --- readme.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 131cc46..2f854da 100644 --- a/readme.md +++ b/readme.md @@ -22,9 +22,13 @@ Here we will go over how to setup rails for the first time on your machine. We will mostly follow Rails [Getting Started Guide](https://guides.rubyonrails.org/getting_started.html) with some changes. -## rbenv +## Manage versions of languages and runtime environment -First thing we need is a version manager for Ruby. We use rbenv at nerdgeschoss. +You can use `asdf` to manage multiple tools. Check out the [guide](https://asdf-vm.com/guide/getting-started.html) for more, or use distinct managers as described below. + +### rbenv + +`rbenv` is a version manager for Ruby. brew install rbenv @@ -34,7 +38,7 @@ You can check your ruby version by typing this in your project folder: If a version is not installed, you can add it by `rbenv install x.x.x`. -## node +### node Make sure you have node installed. Use volta as your version manager, follow the steps as decribed in the [docs](https://docs.volta.sh/guide/).