-
Notifications
You must be signed in to change notification settings - Fork 2
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
Full-Stack Capstone - Booking an Appointment Application. #33
Merged
Merged
Changes from all commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
d407f76
Install Rails and linters
Wineshuga 8553d50
Fix Linters
Wineshuga 20a8416
Merge pull request #19 from tan12082001/setup_backend
hetrox8 a64796a
add database
hetrox8 60d0dd2
add dependancies
hetrox8 a1ad0a3
revert changes , mistake for wrong repo
hetrox8 cd9ad72
fix rubocop
hetrox8 316af0d
Update schema.rb
hetrox8 5fddb4b
add migrations
hetrox8 37bc714
Delete reservation migration file
Wineshuga afcb7fa
Create join table for user and cars
Wineshuga fd45069
Create schema file
Wineshuga 7894059
Make database.yml file DRY
Wineshuga e57a395
Remove port from configuration
Wineshuga 1ea39dd
Merge pull request #20 from tan12082001/setup_database
Wineshuga c9c2d2b
add models
hetrox8 bdb81cc
Merge pull request #21 from tan12082001/models_users
hetrox8 a251ccb
Create cars_controller index, show and create actions
Wineshuga 2890f9b
Create api routes
Wineshuga a763574
Modify models
Wineshuga 3d0b9e5
Merge pull request #22 from tan12082001/item_controller
Wineshuga 6edff41
add authentication for user
hetrox8 ca90c1b
solve rubocop
hetrox8 61a90dc
modify file
hetrox8 ebfd222
Create index action for reservations
Wineshuga e23fe60
Add route for reservation index
Wineshuga 2c0b83e
Update my reservation index to find user with id
Wineshuga 5ce2227
Modify my reservation index route to use user id
Wineshuga 5f98a8e
Add authentication to controller
Wineshuga f948e2b
add index
hetrox8 cc41cda
Add my reservation create action method
Wineshuga 2692c30
Modify routes to create pages
Wineshuga aa5b8f8
Fix location and params errors
Wineshuga 6411c8f
Fix rubocop issues
Wineshuga ab0a582
Merge pull request #25 from tan12082001/user_authentication
hetrox8 3e4d07e
Merge branch 'dev' of https://github.com/tan12082001/Vehicle-Booking-…
Wineshuga cbb70ef
Add user authentication in application controller
Wineshuga c1fce9b
Fix before action for authenticate api user
Wineshuga 310c4ad
Add authentication on reservation controller
Wineshuga 97ef622
Modify routes
Wineshuga dfcf31c
Add sample to seeds.rb
Wineshuga 6c25064
implement delete
hetrox8 f8c9927
revert changes
hetrox8 1eff38e
revert changes
hetrox8 5d7274a
Merge branch 'dev' of https://github.com/tan12082001/Vehicle-Booking-…
hetrox8 1a12c7c
Merge pull request #26 from tan12082001/my_reservation_controller
Wineshuga 3620c35
add delete functionality
hetrox8 430f9a0
solve rubocop
hetrox8 ec0c2b4
solve rubocop
hetrox8 da7051b
solve rubocop
hetrox8 40a8bfe
solve rubocop
hetrox8 f0e6652
enable authentication. left overs
hetrox8 a83928b
solve rubocop
hetrox8 2505c44
solve rubocop
hetrox8 56d4623
solve rubocop
hetrox8 3db7f4b
Merge pull request #27 from tan12082001/delete_actions
hetrox8 6bf1543
Modify cors.rb
Wineshuga cfa3bcf
Change localhost port to 4000
Wineshuga 5aa2a41
Add jwt configuration
Wineshuga 8c54d7a
Fix attribute name to username
Wineshuga 9c6567e
Add jti migration
Wineshuga 795df07
Add devise migration
Wineshuga 47dbcf3
Update schema file
Wineshuga 8fdc26a
Modify User model
Wineshuga 3421186
Modify registration controller
Wineshuga 167d7b9
Fix rubocop issue
Wineshuga 3b60cec
Add authentication to cars controller
Wineshuga 5909bd2
Change url path in create action
Wineshuga 108dad8
Change url path in create action
Wineshuga d59a8cc
Configure cookie store
Wineshuga 7688088
Modify create and destroy actions
Wineshuga ff749c0
Merge pull request #28 from tan12082001/fix_authentication_with_jwt
Wineshuga 29aa308
Fix redirection path
Wineshuga 95511e9
Remove unnecessary query
Wineshuga 1294a6c
Extend jwt expiration time
Wineshuga 159ede9
Fix exclusion of deleted cars from query
Wineshuga bdd52e3
Add image column to users table
Wineshuga 5248e75
Include image to required params for cars
Wineshuga 4ce7bc4
Add image column to cars table
Wineshuga 78d22a1
Add image validation to car model
Wineshuga 8e3d398
Show all data of car
Wineshuga b3abd90
create tests for models
hetrox8 9910e74
Fix session destroy method
Wineshuga c8e2bf5
Fix rubocop issues
Wineshuga 7517f9b
modify tests, modify order for associations in models
hetrox8 312a5e5
Merge pull request #29 from tan12082001/fix_bugs
Wineshuga 849c1ac
Update README.md
hetrox8 0905323
Merge branch 'dev' into test-models
hetrox8 0c09917
Update rails_helper.rb
hetrox8 a6cdadc
Update spec_helper.rb
hetrox8 993bddd
Update spec_helper.rb
hetrox8 8dcf457
Update Gemfile
hetrox8 d13dfd2
Update Gemfile
hetrox8 068b3c5
Update Gemfile
hetrox8 a6da522
Update Gemfile
hetrox8 391620b
Update README.md
hetrox8 8a6caf7
Update README.md
hetrox8 2774efc
Update README.md
hetrox8 d08f3b7
Install helpers
Wineshuga 9431d77
Fix rubocop issues
Wineshuga 03f47c0
Create cars_controller tests
Wineshuga 7da1530
Create my_reservations_controller tests
Wineshuga 2e36afe
Create registrations_controller tests
Wineshuga 08cd76a
Create sessions_controller tests
Wineshuga 8094999
Merge pull request #30 from tan12082001/test-models
hetrox8 6458fb3
solved failing test for car
hetrox8 7a56d9f
Merge pull request #32 from tan12082001/test-models-fix
hetrox8 8713a3b
all test pass
hetrox8 1596f8b
Merge pull request #31 from tan12082001/controllers_tests
hetrox8 50ae9db
update the origins path
tan12082001 843d310
Merge pull request #34 from tan12082001/update-cors-config
Wineshuga 3f9bdd1
add gems for api documentation
hetrox8 4bf1f3a
try fix api
hetrox8 42a1c27
Update the index response body by car ref from soft deletes
tan12082001 bc35fd5
solve agin
hetrox8 1ec8f7c
swagger fixed
hetrox8 e818b9d
Image Validation
Simpleshaikh1 bdc97fc
Merge pull request #35 from tan12082001/reservations-response-bug-fix
tan12082001 915d2f1
Image Validation
Simpleshaikh1 a4479df
Image Validation
Simpleshaikh1 e8a0bb2
Merge branch 'dev' of https://github.com/tan12082001/Vehicle-Booking-…
Simpleshaikh1 2e2c572
Merge pull request #36 from tan12082001/Image-Fix
Simpleshaikh1 f8e498a
Modify documentation
Wineshuga 7fbbe5e
Edit README
Wineshuga b789686
Delete test folder as suggested
Wineshuga b5491a8
Add schemas and delete car path
Wineshuga 1f14db9
Merge branch 'dev' into api-documentation
Wineshuga a1d8493
Fix rubocop issues
Wineshuga ac73cd2
Add api docs details to readme file
Wineshuga 15547c8
fix descriptions in api-doc
Wineshuga 2b5a6a0
Merge pull request #37 from tan12082001/api-documentation
Wineshuga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. | ||
|
||
# Ignore git directory. | ||
/.git/ | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all environment files (except templates). | ||
/.env* | ||
!/.env*.erb | ||
|
||
# Ignore all default key files. | ||
/config/master.key | ||
/config/credentials/*.key | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
|
||
# Ignore pidfiles, but keep the directory. | ||
/tmp/pids/* | ||
!/tmp/pids/.keep | ||
|
||
# Ignore storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
!/storage/.keep | ||
/tmp/storage/* | ||
!/tmp/storage/.keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 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 | ||
config/credentials/*.yml.enc diff=rails_credentials | ||
config/credentials.yml.enc diff=rails_credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 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 all environment files (except templates). | ||
/.env* | ||
!/.env*.erb | ||
|
||
# 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 storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
!/storage/.keep | ||
/tmp/storage/* | ||
!/tmp/storage/ | ||
!/tmp/storage/.keep | ||
|
||
# Ignore master key for decrypting credentials and more. | ||
/config/master.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby-3.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile | ||
ARG RUBY_VERSION=3.2.2 | ||
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base | ||
|
||
# Rails app lives here | ||
WORKDIR /rails | ||
|
||
# Set production environment | ||
ENV RAILS_ENV="production" \ | ||
BUNDLE_DEPLOYMENT="1" \ | ||
BUNDLE_PATH="/usr/local/bundle" \ | ||
BUNDLE_WITHOUT="development" | ||
|
||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base as build | ||
|
||
# Install packages needed to build gems | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config | ||
|
||
# Install application gems | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install && \ | ||
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ | ||
bundle exec bootsnap precompile --gemfile | ||
|
||
# Copy application code | ||
COPY . . | ||
|
||
# Precompile bootsnap code for faster boot times | ||
RUN bundle exec bootsnap precompile app/ lib/ | ||
|
||
# Adjust binfiles to be executable on Linux | ||
RUN chmod +x bin/* && \ | ||
sed -i "s/\r$//g" bin/* && \ | ||
sed -i 's/ruby\.exe$/ruby/' bin/* | ||
|
||
|
||
# Final stage for app image | ||
FROM base | ||
|
||
# Install packages needed for deployment | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y curl libvips postgresql-client && \ | ||
rm -rf /var/lib/apt/lists /var/cache/apt/archives | ||
|
||
# Copy built artifacts: gems, application | ||
COPY --from=build /usr/local/bundle /usr/local/bundle | ||
COPY --from=build /rails /rails | ||
|
||
# Run and own only the runtime files as a non-root user for security | ||
RUN useradd rails --create-home --shell /bin/bash && \ | ||
chown -R rails:rails db log storage tmp | ||
USER rails:rails | ||
|
||
# Entrypoint prepares the database. | ||
ENTRYPOINT ["/rails/bin/docker-entrypoint"] | ||
|
||
# Start the server by default, this can be overwritten at runtime | ||
EXPOSE 3000 | ||
CMD ["./bin/rails", "server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
source 'https://rubygems.org' | ||
ruby '3.2.2' | ||
|
||
# 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' | ||
# 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.1" | ||
# 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[windows jruby] | ||
# Reduces boot times through caching; required in config/boot.rb | ||
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 'psych', '~> 4.0.1' | ||
gem 'rails', '~> 7.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 windows] | ||
gem 'rspec-rails' | ||
end | ||
|
||
group :development do | ||
# Speed up commands on slow machines / big apps [https://github.com/rails/spring] | ||
# gem "spring" | ||
gem 'devise', '~> 4.9' | ||
gem 'rails-controller-testing' | ||
end | ||
|
||
gem 'database_cleaner' | ||
gem 'devise-jwt' | ||
gem 'factory_bot_rails' | ||
gem 'jsonapi-serializer', '~> 2.2' | ||
gem 'paranoia', '~> 2.5' | ||
gem 'rack-cors' | ||
gem 'rswag' | ||
gem 'rswag-api' | ||
gem 'rswag-ui' | ||
gem 'shoulda-matchers' | ||
gem 'swagger-docs' | ||
gem 'swagger-ui_rails' |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tip: If you feel you've completed 90% of the features, kindly say in your PR description what features will be left out to give a heads-up to the final evaluator and reviewers.