Skip to content
Open
Show file tree
Hide file tree
Changes from 140 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
0217722
create a rails receipe app
cherelemma Sep 4, 2023
436af83
add github workflows
cherelemma Sep 4, 2023
e684d96
add ruby and CSS linter config files
cherelemma Sep 4, 2023
1ceaaec
add RSpec config file
cherelemma Sep 4, 2023
4ddd976
Create draft README contents
cherelemma Sep 4, 2023
de7a508
create the modle as per the given ERD
cherelemma Sep 4, 2023
346a7ac
update the database config
cherelemma Sep 4, 2023
b296bb7
update tables associations
cherelemma Sep 4, 2023
0598faa
create the DB and tables using rails db:migrate
cherelemma Sep 4, 2023
bf44a4e
debug and fix rubocop linter
cherelemma Sep 4, 2023
e31275b
Implement remaining models associations
Enning94 Sep 4, 2023
433eb8b
Merge pull request #17 from Microverse-Fullstack-Program/set-up-project
cherelemma Sep 5, 2023
a9ecfab
install devise gem
cherelemma Sep 5, 2023
4e8da8f
generate devise and install
cherelemma Sep 5, 2023
1a4402e
create devise views
cherelemma Sep 5, 2023
1dad455
create a User model for the devise
cherelemma Sep 5, 2023
ddab70d
update the schema
cherelemma Sep 5, 2023
78a6ff6
create HomeController for the User model
cherelemma Sep 5, 2023
d90257e
add configure_permitted_parameters method to ApplicationController
cherelemma Sep 5, 2023
4c83eda
add name field to registration page
cherelemma Sep 5, 2023
6c108b4
install bootstrap 5 gem
cherelemma Sep 5, 2023
62bc062
add bootstrab and rename aplication.css to .scss
cherelemma Sep 5, 2023
ae9deb9
add style to the devise views
cherelemma Sep 5, 2023
735a906
fix stylelint error
cherelemma Sep 5, 2023
86cfb38
debug and fix rubocop lint error
cherelemma Sep 5, 2023
c142581
debug and fix rubocop lint error
cherelemma Sep 5, 2023
773c183
Merge branch 'login-and-registration-pages' of github.com:Microverse-…
cherelemma Sep 5, 2023
313eba3
create routes
cherelemma Sep 5, 2023
2aa3d5c
create header with navbar
cherelemma Sep 5, 2023
f074248
create all controllers
cherelemma Sep 5, 2023
edfee07
create the index view for all controller
cherelemma Sep 5, 2023
433c140
fix rubocop linter errors
cherelemma Sep 5, 2023
a5aca3e
Merge pull request #18 from Microverse-Fullstack-Program/login-and-re…
cherelemma Sep 5, 2023
854b46a
Merge pull request #19 from Microverse-Fullstack-Program/Create-navig…
cherelemma Sep 5, 2023
44fa517
define all the action method of Inventory controller
cherelemma Sep 5, 2023
13c488b
add description column to Inventory model
cherelemma Sep 5, 2023
c89189a
Create custome devise error messages
cherelemma Sep 5, 2023
a4a6c39
Merge branch 'dev' of github.com:Microverse-Fullstack-Program/rails-r…
cherelemma Sep 5, 2023
4b0c1e8
create custom error message for Inventory model
cherelemma Sep 5, 2023
3c0cc57
validate Inventory model
cherelemma Sep 5, 2023
ed89346
install cancancan gem for authorization
cherelemma Sep 5, 2023
864cbe8
generate the cancan ability model
cherelemma Sep 5, 2023
bb8d83d
define roles for the users
cherelemma Sep 5, 2023
0ea3881
update migration and schema
cherelemma Sep 5, 2023
bac6e10
add style for h1 element
cherelemma Sep 6, 2023
7b95f8f
update the Inventory controller
cherelemma Sep 6, 2023
a853e5a
update the Inventory model
cherelemma Sep 6, 2023
406f99f
create a form for new inventory
cherelemma Sep 6, 2023
ba52d01
update the navbar look and feel
cherelemma Sep 6, 2023
654719c
debug and fix linters error
cherelemma Sep 6, 2023
1c9e7fd
add validation to Recipe model
cherelemma Sep 6, 2023
4c6fbe8
Update schema and make the recipe public by default
cherelemma Sep 6, 2023
a53534c
Add-Food-Controller
Odongo006 Sep 6, 2023
f434a41
Add food model
Odongo006 Sep 6, 2023
8c5d3b3
define action methods for recipe controller
Enning94 Sep 6, 2023
3e3fe44
update recipe controller
Enning94 Sep 6, 2023
d6685f3
update migration and schema
Enning94 Sep 6, 2023
22e2f61
Add basic styling
Enning94 Sep 6, 2023
654d00e
Update Recipe view to display a list of recipes created by the logged…
Enning94 Sep 6, 2023
5e315f3
re-generate recipe_foods model and update the schema
cherelemma Sep 6, 2023
9ce6676
created a form to add new recipe
Enning94 Sep 6, 2023
108356b
Add a link to display each recipe detail
Enning94 Sep 6, 2023
6772d1e
Update route
Enning94 Sep 6, 2023
365e8e2
Add gitignore to Ignor unwanted files
Enning94 Sep 6, 2023
af365ff
create proper flash message display
cherelemma Sep 6, 2023
1decad9
create recipes_controller and add action methods
cherelemma Sep 6, 2023
655369b
render recipes list
cherelemma Sep 6, 2023
f17b91b
create a form to add new recipe
cherelemma Sep 6, 2023
94bb657
create custom validation for Recipe form
cherelemma Sep 6, 2023
711bfff
render details of a Recipe
cherelemma Sep 6, 2023
7047e8f
update the custom style sheet
cherelemma Sep 6, 2023
b83130d
Merge pull request #20 from Microverse-Fullstack-Program/inventory-list
cherelemma Sep 6, 2023
7a89241
resolve conflict
Enning94 Sep 7, 2023
0ff2c32
Fix Linter error
Enning94 Sep 7, 2023
a1362bd
Add node modules to gitignore
Enning94 Sep 7, 2023
3476e6d
Remove node modules
Enning94 Sep 7, 2023
1aabc76
Merge pull request #25 from Microverse-Fullstack-Program/recipes-list
cherelemma Sep 7, 2023
4c4231c
Resolve merging conflict
Enning94 Sep 7, 2023
d17ad83
Add generate shopping list modal
Enning94 Sep 7, 2023
b7aae08
Merge pull request #24 from Microverse-Fullstack-Program/feature/reci…
Enning94 Sep 7, 2023
e545e36
Resolve merge conflict
Enning94 Sep 7, 2023
a794134
Resolve conflict
Enning94 Sep 7, 2023
9a2aa5e
Merge pull request #23 from Microverse-Fullstack-Program/food-model
cherelemma Sep 7, 2023
b33f390
Merge pull request #22 from Microverse-Fullstack-Program/food-controller
cherelemma Sep 7, 2023
2a90101
update recipe_foods_controller to create new recipe ingredient
Enning94 Sep 7, 2023
4eecd02
create form to add new ingredient
Enning94 Sep 7, 2023
713dbc3
display added ingredient
Enning94 Sep 7, 2023
a0b0a83
Fix linter error
Enning94 Sep 7, 2023
73f2f18
Add foods views
Odongo006 Sep 7, 2023
30d2a26
update the Generate shopping list modal
cherelemma Sep 7, 2023
ffadbb6
create controller action for shopping list
cherelemma Sep 7, 2023
5e3589b
Merge branch 'dev' of github.com:Microverse-Fullstack-Program/rails-r…
cherelemma Sep 7, 2023
336c98c
update h1 styling
cherelemma Sep 7, 2023
34078c4
view changes on modal pop up
Enning94 Sep 7, 2023
8ef0694
update database.yml file
Enning94 Sep 7, 2023
3220c5a
update the recipe and food views
cherelemma Sep 8, 2023
eb0dfa8
add notice message helper
cherelemma Sep 8, 2023
860afa4
modify models validation
cherelemma Sep 8, 2023
060bacc
create inventory_foods controller
cherelemma Sep 8, 2023
5d65c14
update the routes
cherelemma Sep 8, 2023
b0e6b43
add custome error message for recipes and foods
cherelemma Sep 8, 2023
f33bb8e
fix rubocop linter errors
cherelemma Sep 8, 2023
31c933e
fix linter errors in controller
cherelemma Sep 8, 2023
23b1a63
fix linter errors in controller
cherelemma Sep 8, 2023
15d1d46
Merge branch 'Add_books_views'
cherelemma Sep 8, 2023
8966f03
remove whitespace
cherelemma Sep 8, 2023
cba12c5
update branch with origin
Enning94 Sep 8, 2023
9adfe83
Merge pull request #27 from Microverse-Fullstack-Program/Add_books_views
Odongo006 Sep 8, 2023
824f666
add remove/modify functionalities
Enning94 Sep 8, 2023
2f0c1a7
fix linter error
Enning94 Sep 8, 2023
73f0789
Merge pull request #26 from Microverse-Fullstack-Program/feature/reci…
Enning94 Sep 8, 2023
b09af3f
update model validation
cherelemma Sep 8, 2023
918dbf6
update RecipeFood controller action methods
cherelemma Sep 8, 2023
8e812a0
update InventoryFood controller destroy action methods
cherelemma Sep 8, 2023
4db436d
update recipes view
cherelemma Sep 8, 2023
0f9db34
update Inventories view
cherelemma Sep 8, 2023
a775542
change the foods and recipe-foods views
cherelemma Sep 8, 2023
364aab9
add customi validation for recipe-foods model
cherelemma Sep 8, 2023
d950028
Merge pull request #28 from Microverse-Fullstack-Program/features/upd…
cherelemma Sep 8, 2023
e4e87e3
add notice_message helper for controllers
cherelemma Sep 9, 2023
809cc2e
add and install rspec-rails gem
cherelemma Sep 9, 2023
5003d7b
modify recipe controller to have the general_shopping_list action
Enning94 Sep 9, 2023
55d560c
create generate shopping list view to display shopping list
Enning94 Sep 9, 2023
ce6fa36
update route
Enning94 Sep 9, 2023
1b9f370
Solve merge conflict
Enning94 Sep 9, 2023
6a2c155
Update readme
Enning94 Sep 9, 2023
39ccbe5
update models validation
cherelemma Sep 9, 2023
ce432b8
create unit test for models
cherelemma Sep 9, 2023
8d96887
add more models unit test
cherelemma Sep 9, 2023
7b4806f
add controllers unit test
cherelemma Sep 9, 2023
305055b
install testing gem
cherelemma Sep 9, 2023
be4eb25
add event listner to public togle checkbox
cherelemma Sep 9, 2023
187e87e
Merge pull request #29 from Microverse-Fullstack-Program/feature/shop…
cherelemma Sep 9, 2023
948e41b
Merge branch 'dev' into unit-and-integration-test
cherelemma Sep 9, 2023
83905ea
fix linter errors
cherelemma Sep 9, 2023
3d9681f
Merge branch 'unit-and-integration-test' of github.com:Microverse-Ful…
cherelemma Sep 9, 2023
aae69c2
fix linter error
Enning94 Sep 9, 2023
6371c83
add public-recipe
cherelemma Sep 9, 2023
292ae1f
Merge branch 'unit-and-integration-test' of github.com:Microverse-Ful…
cherelemma Sep 9, 2023
c5064fb
Merge pull request #30 from Microverse-Fullstack-Program/unit-and-int…
cherelemma Sep 9, 2023
7e46fc4
Update list public recipe
Enning94 Sep 10, 2023
f00d5a0
Implemented the toggle_public functionality
Enning94 Sep 10, 2023
6bb6ed0
implement review changes
Enning94 Sep 10, 2023
e7126a6
update rspec tests
Enning94 Sep 10, 2023
0624659
fix linter error
Enning94 Sep 10, 2023
614df15
fix type error
cherelemma Sep 10, 2023
819bea8
Merge pull request #34 from Microverse-Fullstack-Program/Review-changes
cherelemma Sep 10, 2023
3e526bf
update chnages
cherelemma Sep 10, 2023
93262af
Merge branch 'dev' of github.com:Microverse-Fullstack-Program/rails-r…
cherelemma Sep 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
44 changes: 44 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Linters

on: pull_request

env:
FORCE_COLOR: 1

jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
with:
ruby-version: 3.1.x
- name: Setup Rubocop
run: |
gem install --no-document rubocop -v '>= 1.0, < 2.0' # https://docs.rubocop.org/en/stable/installation/
[ -f .rubocop.yml ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.rubocop.yml
- name: Rubocop Report
run: rubocop --color
stylelint:
name: Stylelint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Setup Stylelint
run: |
npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.stylelintrc.json
- name: Stylelint Report
run: npx stylelint "**/*.{css,scss}"
nodechecker:
name: node_modules checker
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check node_modules existence
run: |
if [ -d "node_modules/" ]; then echo -e "\e[1;31mThe node_modules/ folder was pushed to the repo. Please remove it from the GitHub repository and try again."; echo -e "\e[1;32mYou can set up a .gitignore file with this folder included on it to prevent this from happening in the future." && exit 1; fi
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key

#Ignore Node_Modules
/node_modules
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
60 changes: 60 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
AllCops:
NewCops: enable
Exclude:
- "db/**/*"
- "bin/*"
- "config/**/*"
- "Guardfile"
- "Rakefile"
- "node_modules/**/*"

DisplayCopNames: true

Layout/LineLength:
Max: 120
Metrics/MethodLength:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 20
Metrics/AbcSize:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 50
Metrics/ClassLength:
Max: 150
Metrics/BlockLength:
AllowedMethods: ['describe']
Max: 30

Style/Documentation:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/EachForSimpleLoop:
Enabled: false
Style/AndOr:
Enabled: false
Style/DefWithParentheses:
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: never

Layout/HashAlignment:
EnforcedColonStyle: key
Layout/ExtraSpacing:
AllowForAlignment: false
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-3.2.2
32 changes: 32 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"extends": ["stylelint-config-standard"],
"plugins": ["stylelint-scss", "stylelint-csstree-validator"],
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"tailwind",
"apply",
"variants",
"responsive",
"screen"
]
}
],
"scss/at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"tailwind",
"apply",
"variants",
"responsive",
"screen"
]
}
],
"csstree/validator": true
},
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css"]
}
82 changes: 82 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.2.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.0.7'

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'

# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 5.0'

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem 'importmap-rails'

# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem 'turbo-rails'

# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem 'stimulus-rails'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem 'jbuilder'

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false

# Use Sass to process CSS
# gem "sassc-rails"

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
gem 'rails-controller-testing'
gem 'rspec-rails'
end

group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem 'web-console'

# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"

# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end

group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem 'capybara'
gem 'faker'
gem 'selenium-webdriver'
gem 'webdrivers'
end

gem 'bootstrap', '~> 5.1.3'

gem 'cancancan', '~> 3.5'

gem 'devise', '~> 4.9'
Loading