Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book a Car api Backend #35

Merged
merged 191 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 185 commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
9fcbe04
Update the readme file
fmanimashaun Feb 12, 2024
7e50b3b
Update the readme file
fmanimashaun Feb 12, 2024
04f5fa0
Update the readme file
fmanimashaun Feb 12, 2024
25b91d7
Update the readme file
fmanimashaun Feb 12, 2024
ef51e0e
Update the readme file
fmanimashaun Feb 12, 2024
c6b0792
Create LICENSE
fmanimashaun Feb 12, 2024
cbb2bbd
Update cors
fmanimashaun Feb 12, 2024
86f6ba3
Fix linter errors
fmanimashaun Feb 12, 2024
51b02fa
Add rspec setup to project
fmanimashaun Feb 12, 2024
e29b48f
Add rswag for api documentation
fmanimashaun Feb 12, 2024
9a9318e
Add the swagger setting and tested with the city model
fmanimashaun Feb 12, 2024
bf9ce73
Update the rspec configuration
fmanimashaun Feb 12, 2024
446a68d
Update the rspec configuration
fmanimashaun Feb 12, 2024
3b0d109
Add active storage
fmanimashaun Feb 12, 2024
f051e50
Update schema
fmanimashaun Feb 12, 2024
a085a79
Update README.md
fmanimashaun Feb 13, 2024
91f3912
Add logo
fmanimashaun Feb 13, 2024
da8f5fb
Update README.md
fmanimashaun Feb 13, 2024
17ffbdd
Update README.md
fmanimashaun Feb 13, 2024
cf7d1c8
Update README.md
fmanimashaun Feb 13, 2024
6a1ca59
Add files via upload
fmanimashaun Feb 13, 2024
fd10f3d
Update README.md
fmanimashaun Feb 13, 2024
883576f
Update README.md
fmanimashaun Feb 13, 2024
c6b0a24
Update README.md
fmanimashaun Feb 13, 2024
2596436
Update the ERD diagram
fmanimashaun Feb 15, 2024
45b0cae
Fixed linter errors
fmanimashaun Feb 15, 2024
0ba53e8
Reset the rspec unit test codes
fmanimashaun Feb 15, 2024
e700213
Update github action
fmanimashaun Feb 15, 2024
587dae7
Merge pull request #15 from fmanimashaun/features/update-ERD
fmanimashaun Feb 15, 2024
29e370b
Update setup
fmanimashaun Feb 15, 2024
56b8fad
Fix linter errors
fmanimashaun Feb 15, 2024
2dd8173
Update github action
fmanimashaun Feb 15, 2024
2dc625a
Update github action
fmanimashaun Feb 15, 2024
082eb24
Update github action
fmanimashaun Feb 15, 2024
c30c10b
Update github action
fmanimashaun Feb 15, 2024
a043a65
Update github action
fmanimashaun Feb 15, 2024
7c9162f
Merge pull request #16 from fmanimashaun/features/models-generation
fmanimashaun Feb 15, 2024
4c5e8aa
Update gemfileloc to contain the credential settings
M-Anwar-Hussaini Feb 15, 2024
c71fed9
Add user association to have many reservations
M-Anwar-Hussaini Feb 15, 2024
cce1160
Add city association to have many reservations
M-Anwar-Hussaini Feb 15, 2024
501e9dc
Add car association to have many reservations
M-Anwar-Hussaini Feb 15, 2024
2ea0e84
Add car association to have many car_details
M-Anwar-Hussaini Feb 15, 2024
dfdb1d8
Add engine_type association to have many car_details
M-Anwar-Hussaini Feb 15, 2024
9a4b6af
Set models to be deleted while their independent elements are removed.
M-Anwar-Hussaini Feb 15, 2024
84e1717
Validate city model
M-Anwar-Hussaini Feb 15, 2024
ea96741
Create validation to the car model
M-Anwar-Hussaini Feb 15, 2024
c755b27
Create validation to the reservation model
M-Anwar-Hussaini Feb 15, 2024
2b5beb2
Create validation to the car_detail model
M-Anwar-Hussaini Feb 15, 2024
0f47780
Update .gitignore file to hide the editor settings from being shown i…
M-Anwar-Hussaini Feb 15, 2024
80420a9
Update Gemfile lock
fmanimashaun Feb 15, 2024
2156c9f
Update user model
fmanimashaun Feb 15, 2024
f6426bb
Refactor car model so it has one to one association with car_detail a…
Estete9 Feb 15, 2024
f0c88fb
Refactor car_details model with more validations
Estete9 Feb 15, 2024
d493e31
Refactor engine_details model with more validations
Estete9 Feb 15, 2024
e451ede
Refactor reservation model with more validations
Estete9 Feb 15, 2024
a6cc589
Refactor city model with more validations
Estete9 Feb 15, 2024
0cd52b5
Merge branch 'feature/models-association' of https://github.com/fmani…
Estete9 Feb 15, 2024
ed9028b
Merge branch 'feature/models-association' of https://github.com/fmani…
Estete9 Feb 15, 2024
d037d50
Merge branch 'feature/models-association' of https://github.com/fmani…
Estete9 Feb 15, 2024
01e21a1
Add maximum length to car model\
Estete9 Feb 15, 2024
2359282
Add maximum length to city model
Estete9 Feb 15, 2024
8c316b2
Minor adjustment to model association validation
fmanimashaun Feb 15, 2024
80f577d
Merge pull request #17 from fmanimashaun/feature/models-association
fmanimashaun Feb 15, 2024
6554d0a
Add city action controller
fmanimashaun Feb 15, 2024
88972a6
Fix linter errors
fmanimashaun Feb 15, 2024
49eaaa9
Add city api route
fmanimashaun Feb 15, 2024
6be96e2
Merge pull request #18 from fmanimashaun/features/implement-city-crud
fmanimashaun Feb 16, 2024
ee07dd2
Update city_serializer.rb
fmanimashaun Feb 16, 2024
9a5cd62
Add tests for cities_rspec
Estete9 Feb 15, 2024
93b85dd
Refactor city test that uses modified factories
Estete9 Feb 16, 2024
df4c397
Refactor and implement new factories
Estete9 Feb 16, 2024
1409a31
Add tests for engine_type_rspec
Estete9 Feb 16, 2024
8a35d43
Add tests for car_detail_rspec
Estete9 Feb 16, 2024
58f1f83
Add model tests for car_rspec
Estete9 Feb 16, 2024
8764806
Add model tests for car_rspec
Estete9 Feb 16, 2024
1b913ec
Add shoulda-matchers gem to simplify the association tests
Estete9 Feb 16, 2024
15cc0ff
Add autofix for rubocop linters
Estete9 Feb 16, 2024
4a500b5
Generate reservation controller
M-Anwar-Hussaini Feb 16, 2024
4a8e713
Update routes to include the reservation api endpoints
M-Anwar-Hussaini Feb 16, 2024
afc3895
Update the reservation_serializer.rb to include all the attributes of…
M-Anwar-Hussaini Feb 16, 2024
6b7300c
Add model tests for user_rspec
Estete9 Feb 16, 2024
0a0e693
Update the seed file to generate initial data for Reservations
M-Anwar-Hussaini Feb 16, 2024
e055241
Add model tests for user_rspec
Estete9 Feb 16, 2024
dd44b54
Merge branch 'features/models-unit-testing' of https://github.com/fma…
Estete9 Feb 16, 2024
14da7b0
Create the private helper functions and call them befor action
M-Anwar-Hussaini Feb 16, 2024
d1271a8
Add index action to render all the reservations
M-Anwar-Hussaini Feb 16, 2024
27736ad
Add destroy action to delete a reservation
M-Anwar-Hussaini Feb 16, 2024
1fe5888
Add show action to render the details of one specific reservation
M-Anwar-Hussaini Feb 16, 2024
be976b8
Add create action to create a new reservation
M-Anwar-Hussaini Feb 16, 2024
9f30e53
Add update action to update an existing reservation
M-Anwar-Hussaini Feb 16, 2024
17523c5
Fix the linters errors
M-Anwar-Hussaini Feb 16, 2024
f64b6d5
Merge pull request #19 from fmanimashaun/features/models-unit-testing
fmanimashaun Feb 16, 2024
9dd8a1b
Add routes for cars controller actions
Estete9 Feb 16, 2024
27cdb2b
Add engine type and car records to seeds.rb
Estete9 Feb 16, 2024
f629e0a
Fix syntax of car_with_details_serializer
Estete9 Feb 16, 2024
0573b32
Implement cars#show action
Estete9 Feb 16, 2024
b4efcd0
Implement cars#create action
Estete9 Feb 16, 2024
24c7827
Implement cars#update action
Estete9 Feb 16, 2024
934c57b
Implement cars#destroy action
Estete9 Feb 16, 2024
4cb0fe1
Rubocop linter fixes
Estete9 Feb 16, 2024
2b03605
Fix the type and revise the reservation query to only display the res…
M-Anwar-Hussaini Feb 17, 2024
4c86292
Merge pull request #21 from fmanimashaun/f/cars-controller
fmanimashaun Feb 17, 2024
c923371
Revert "Implement Car CRUD Operations"
fmanimashaun Feb 17, 2024
9512f69
Merge pull request #22 from fmanimashaun/revert-21-f/cars-controller
fmanimashaun Feb 17, 2024
6b88116
Revert "Revert "Implement Car CRUD Operations""
fmanimashaun Feb 17, 2024
b9aaaca
Merge pull request #23 from fmanimashaun/revert-22-revert-21-f/cars-c…
fmanimashaun Feb 17, 2024
eb434d4
Merge branch 'dev' into feature/reservations-controller
fmanimashaun Feb 17, 2024
bd4ab6a
Merge pull request #20 from fmanimashaun/feature/reservations-controller
fmanimashaun Feb 17, 2024
ae16862
Update setup and add authorization
fmanimashaun Feb 18, 2024
4c1500f
Update setup and add authorization
fmanimashaun Feb 18, 2024
2fbb193
Reset schema
fmanimashaun Feb 18, 2024
c591472
Reset schema
fmanimashaun Feb 18, 2024
9395cf6
Update schema
fmanimashaun Feb 18, 2024
aab89ad
Merge pull request #25 from fmanimashaun/features/minor-update-author…
fmanimashaun Feb 19, 2024
a3fb147
Update the database setup
fmanimashaun Feb 19, 2024
e179c6c
Merge pull request #26 from fmanimashaun/Feature/database-name-update
fmanimashaun Feb 19, 2024
cb6dc7d
Fix issues with tests after merge
Estete9 Feb 19, 2024
bf01358
Refactor user factory so it has a possible trait of admin
Estete9 Feb 19, 2024
0a0ed8c
Implement controller tests for cities_controller_spec
Estete9 Feb 19, 2024
4c8c468
Add devise test configurations to rails_helper.rb
Estete9 Feb 19, 2024
13d5abe
Instantiate cars controller spec
Estete9 Feb 19, 2024
2e68525
Refactor car factory so it has car details after creation
Estete9 Feb 19, 2024
a9a064d
Rename controller test file names
Estete9 Feb 19, 2024
8701748
Add default host to config/environments/test
Estete9 Feb 19, 2024
fa6b118
Fix third test in cars controller
Estete9 Feb 19, 2024
c97f11a
Hotfix: changed expect count to 2 instead of 1
Estete9 Feb 19, 2024
4435061
Implement test for initial_data_controller_spec
Estete9 Feb 19, 2024
1f952cf
Implement controller tests for reservations_controller_spec
Estete9 Feb 19, 2024
5ce3676
Refactor car controller tests so it does't create two car instances
Estete9 Feb 20, 2024
a3159b1
Rubocop linter fix
Estete9 Feb 20, 2024
dcc080b
Refactor car factory to add car details when created
Estete9 Feb 20, 2024
92ddeaa
Implement tests for cars_controller_spec
Estete9 Feb 20, 2024
be19379
Refactor reservation model spec so the date in past has more than one…
Estete9 Feb 20, 2024
773f41d
Rubocop linter fix
Estete9 Feb 20, 2024
775cbad
Add x86_64-linux platform to Gemfile.lock
Estete9 Feb 20, 2024
f0c02af
Fix test and porduction database names in database.yml
Estete9 Feb 20, 2024
4a7fb57
Add move the controller test to the right folder
fmanimashaun Feb 20, 2024
20295ae
Fix linter errors
fmanimashaun Feb 20, 2024
68d3ad5
Merge pull request #27 from fmanimashaun/feature/controller-tests
fmanimashaun Feb 20, 2024
04b93de
Create rswag spec for cars controller requests
simplegoose Feb 20, 2024
bbd4489
Create rswag spec for cities controller requests
simplegoose Feb 20, 2024
3afe9d3
Create rswag spec for initial data controller requests
simplegoose Feb 20, 2024
9b7c1f7
Create rswag spec for reservations controller requests
simplegoose Feb 20, 2024
a30bb77
Generate swagger.yaml file for swagger docs schema
simplegoose Feb 20, 2024
d10ec0f
Lint files
simplegoose Feb 20, 2024
75c424e
Revert to previous credentials file
simplegoose Feb 20, 2024
223be5a
Make changes to spec files for generating api documentation
simplegoose Feb 20, 2024
c13816a
Generate swagger schema for documentation
simplegoose Feb 20, 2024
1f51b31
Make changes to reservations
simplegoose Feb 20, 2024
49755a6
Lint files
simplegoose Feb 20, 2024
0b88323
Hotfix, update the test requests/api/v1/initial_data_spec to check fo…
Estete9 Feb 20, 2024
0c39359
Linter fixes
Estete9 Feb 20, 2024
4af2dd8
Merge pull request #28 from fmanimashaun/feature/api-docs
simplegoose Feb 21, 2024
1bf57f7
Merge pull request #29 from fmanimashaun/f/tests-hotfix
fmanimashaun Feb 21, 2024
6c290e5
Increment the JWT Token expiration time to 2 weeks
Estete9 Feb 22, 2024
ae34026
Merge pull request #30 from fmanimashaun/hotfix/token-expiration
tomasesquivelgc Feb 23, 2024
73c542e
Update database.yml
Estete9 Feb 26, 2024
3dde9e3
Update production environment to have the database as host
Estete9 Feb 26, 2024
3eead85
Update swagger.yaml and production environment
Estete9 Feb 26, 2024
9741bd0
Make rswag gem available in all the project environments
Estete9 Feb 26, 2024
a926fef
Update database url
Estete9 Feb 26, 2024
575456b
Update database url
Estete9 Feb 26, 2024
6ad03fc
change default_url_options to the new url
Estete9 Feb 26, 2024
bc47ade
change application.routes.default_url_options to the new url
Estete9 Feb 26, 2024
b2c80ee
change application.routes.default_url_options to the new url
Estete9 Feb 26, 2024
cb56a21
Merge branch 'test-deployment' of https://github.com/fmanimashaun/boo…
Estete9 Feb 26, 2024
1307cd3
reset database config
fmanimashaun Feb 27, 2024
aea35e3
Update the reservation serializer
fmanimashaun Feb 27, 2024
a7a067a
Update the reservation controller
fmanimashaun Feb 27, 2024
0f45af8
Add render deployment setup
fmanimashaun Feb 27, 2024
a2c836a
add configuration for s3 bucket
Estete9 Feb 27, 2024
17a65cb
Add key and secret for AWS
Estete9 Feb 27, 2024
d29ab7f
Update active storage to amazon
Estete9 Feb 27, 2024
00bafe4
Install aws gem
Estete9 Feb 27, 2024
66e72de
add production default host
Estete9 Feb 27, 2024
22ea3a1
Update README.md
Estete9 Feb 28, 2024
24ef2fe
Update README.md
Estete9 Feb 28, 2024
7ead532
Add licence and update missing author
Estete9 Feb 28, 2024
e79a47a
Merge pull request #34 from fmanimashaun/Estete9-authors
Estete9 Feb 28, 2024
05a2e38
Merge pull request #33 from fmanimashaun/test-deployment
Estete9 Feb 28, 2024
6e70864
Update correct rspec command for tests
Estete9 Feb 28, 2024
744bd72
Update seed data
fmanimashaun Feb 28, 2024
016e469
Update the user serializer
fmanimashaun Feb 28, 2024
79f96f1
Merge pull request #36 from fmanimashaun/hotfix-readme-rspec
fmanimashaun Feb 28, 2024
d00a7b3
Update seed data
fmanimashaun Feb 28, 2024
a5dd670
Include instructions to add AWS keys in readme.md
Estete9 Feb 28, 2024
7bda116
Merge pull request #37 from fmanimashaun/hotfix/credentials
tomasesquivelgc Feb 28, 2024
19fa65b
Update credentials
fmanimashaun Feb 29, 2024
3f12b9e
Updatet local setup
fmanimashaun Feb 29, 2024
4379236
Update the readme
fmanimashaun Feb 29, 2024
5e3fc6a
Update the readme
fmanimashaun Feb 29, 2024
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
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ jobs:
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost/test_database
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
run: bundle exec rails db:create db:schema:load
bundle exec rspec
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bundle exec rails db:create db:schema:load && bundle exec rspec
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', 'path', 'create', 'post', 'get', 'put']
Max: 60

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
45 changes: 36 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
source "https://rubygems.org"
source 'https://rubygems.org'

ruby "3.2.2"
ruby '3.2.2'

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

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

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

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
Expand All @@ -24,24 +24,51 @@ gem "puma", ">= 5.0"
# gem "bcrypt", "~> 3.1.7"

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

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

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

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin Ajax possible
# gem "rack-cors"
gem 'rack-cors'

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

group :development do
# 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 'selenium-webdriver'
gem 'shoulda-matchers'
end

# authentication and authorization
gem 'cancancan'
gem 'devise'
gem 'devise-jwt'
gem 'jsonapi-serializer'

# debugging tool
gem 'pry'

gem 'rswag'
gem 'rswag-api'
gem 'rswag-specs'
gem 'rswag-ui'

gem 'aws-sdk-s3', require: false
Loading
Loading