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

Final Capstone Project: Car Test Drive Booking System Merge Request #29

Merged
merged 99 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
80c3d4f
Add the tables and models for the ap
ClaudiaRojasSoto Oct 25, 2023
54c2525
Add the rubocop linter
ClaudiaRojasSoto Oct 25, 2023
984a97f
Add the linters workflow
ClaudiaRojasSoto Oct 25, 2023
fb936fd
Add the rubocop gem, rack cors ande devise
ClaudiaRojasSoto Oct 25, 2023
4f548dc
Upload the gemfile lock with the new gems installed
ClaudiaRojasSoto Oct 25, 2023
a4dc5ee
Create the new rails app with api and postgre command generating all …
ClaudiaRojasSoto Oct 25, 2023
42c927d
Upload the readme file
ClaudiaRojasSoto Oct 25, 2023
e997de1
Add the mit license
ClaudiaRojasSoto Oct 25, 2023
0666e1d
Upload the readme file and the mit file
ClaudiaRojasSoto Oct 25, 2023
91e6ded
Upload the readme file
ClaudiaRojasSoto Oct 25, 2023
1d08a20
Add images to cars tables and delete reservation columns from reserva…
ClaudiaRojasSoto Oct 26, 2023
b5c45bd
Add the erd diagram
ClaudiaRojasSoto Oct 26, 2023
470ea20
Fix linter errors
ClaudiaRojasSoto Oct 26, 2023
e1388d3
Merge pull request #17 from ClaudiaRojasSoto/feature/setup-backend-app
ClaudiaRojasSoto Oct 26, 2023
03fa755
Add the devise and bcr
ClaudiaRojasSoto Oct 27, 2023
191e94a
Upload the lock gemfile
ClaudiaRojasSoto Oct 27, 2023
e112ee0
Delete the seeds added on seed file
ClaudiaRojasSoto Oct 27, 2023
c21fa96
Add active storage with a migration
ClaudiaRojasSoto Oct 27, 2023
bc5e65f
Remove devise columns by a new migration
ClaudiaRojasSoto Oct 27, 2023
966961f
Add the attributes name. email and password to user
ClaudiaRojasSoto Oct 27, 2023
24e18bf
Rename the password column to use the bcrypt gem
ClaudiaRojasSoto Oct 27, 2023
befc23c
Add images to use the active storage
ClaudiaRojasSoto Oct 27, 2023
fa5f043
Modificate the devise create user migration
ClaudiaRojasSoto Oct 27, 2023
5939538
Creates the test using the command generate
ClaudiaRojasSoto Oct 27, 2023
e3f3ec7
Upload the schema file with the new migrations
ClaudiaRojasSoto Oct 27, 2023
ac8f2df
Creates the controllers for users, reservations, sessions and cars
ClaudiaRojasSoto Oct 27, 2023
313b8e4
Add the current user logic
ClaudiaRojasSoto Oct 27, 2023
d15483b
Add the middlewares configurations
ClaudiaRojasSoto Oct 27, 2023
d206d02
Creates the user model and added the validations
ClaudiaRojasSoto Oct 27, 2023
f5798b9
Add the car model with their validation and the available method
ClaudiaRojasSoto Oct 27, 2023
78274ed
Add the reservation model with validations and the reservation with c…
ClaudiaRojasSoto Oct 27, 2023
5c7e972
Configurates the new rou
ClaudiaRojasSoto Oct 27, 2023
5c4d876
Add the autocomplete on create method
ClaudiaRojasSoto Oct 27, 2023
741fdf6
Delete comments
ClaudiaRojasSoto Oct 27, 2023
721c317
Delete the image column on cars table to use just active storage
ClaudiaRojasSoto Oct 27, 2023
783e9ba
Delete comments
ClaudiaRojasSoto Oct 27, 2023
e12509b
Fix linter errors
ClaudiaRojasSoto Oct 27, 2023
2258c91
Add dependant to cars
ClaudiaRojasSoto Oct 27, 2023
181f421
Fix linter errors
ClaudiaRojasSoto Oct 27, 2023
a99329e
Delete comments
ClaudiaRojasSoto Oct 27, 2023
63a0f5b
Merge pull request #18 from ClaudiaRojasSoto/feature/models-and-contr…
ClaudiaRojasSoto Oct 28, 2023
1e11c82
Add the boolean credentials true to make the cookie token available
ClaudiaRojasSoto Oct 31, 2023
888894d
Creates on user controller the index and show method to handle the us…
ClaudiaRojasSoto Oct 31, 2023
434b0e7
Merge pull request #21 from ClaudiaRojasSoto/feature/fix-credentials
ClaudiaRojasSoto Oct 31, 2023
73a32fa
added api documentation via Postman
alexmedinasf Oct 31, 2023
252ed1c
changed folder name
alexmedinasf Oct 31, 2023
10a1ff1
Merge pull request #22 from ClaudiaRojasSoto/api_documentation
alexmedinasf Oct 31, 2023
cb4ee75
Add the current user method to catch the data of the current user
ClaudiaRojasSoto Nov 3, 2023
1c0a99d
Add a route to handle the data of the current user
ClaudiaRojasSoto Nov 3, 2023
efaf42f
Merge pull request #25 from ClaudiaRojasSoto/feature/add-current-user…
PabloBona Nov 3, 2023
af10ea7
Upload the documentation info adding the g
ClaudiaRojasSoto Nov 3, 2023
47271f0
Add the spec testing files for models, and controllers of users, cars…
ClaudiaRojasSoto Nov 3, 2023
aa8c153
nstall the gems and made all the setup to
ClaudiaRojasSoto Nov 3, 2023
85c7d76
Upload readme file and mit license
ClaudiaRojasSoto Nov 3, 2023
2f3117c
Merge pull request #26 from ClaudiaRojasSoto/feature/rspec-test
ClaudiaRojasSoto Nov 4, 2023
b418a1a
Add the new diagram changing the old picture, add the application pic…
ClaudiaRojasSoto Nov 5, 2023
59b9bdd
Change the position of the picture and center the picture and the title
ClaudiaRojasSoto Nov 5, 2023
d3dd510
Fix errors
ClaudiaRojasSoto Nov 5, 2023
72a34c9
Add the picture of the app, change the pic
ClaudiaRojasSoto Nov 5, 2023
acc1983
Center the link to the api documentation
ClaudiaRojasSoto Nov 6, 2023
3775d1e
Add the kanban board information
ClaudiaRojasSoto Nov 6, 2023
23c8c62
Add a link to the issue of the original state of the kanban board
ClaudiaRojasSoto Nov 6, 2023
55527c6
Fix error with the link to the original state o
ClaudiaRojasSoto Nov 6, 2023
5073f9f
Merge pull request #28 from ClaudiaRojasSoto/feature/details-pre-review
ClaudiaRojasSoto Nov 6, 2023
c533640
Add a personalizated validation on reservation model called start tim…
ClaudiaRojasSoto Nov 6, 2023
e2c71b3
Delete the test folder to use only rspec
ClaudiaRojasSoto Nov 6, 2023
833c1c0
Add the instructions to use the API rils running the project
ClaudiaRojasSoto Nov 6, 2023
1b6fc0e
Add information to run the test
ClaudiaRojasSoto Nov 6, 2023
c93388e
Upload the readme file with the right way to run the testing process …
ClaudiaRojasSoto Nov 6, 2023
d6061cd
Add a line to avoid the nil date
ClaudiaRojasSoto Nov 6, 2023
f53d225
Fix the rspec test on reservation considering the new validation
ClaudiaRojasSoto Nov 6, 2023
c512c3b
Fix linter errros
ClaudiaRojasSoto Nov 6, 2023
309a088
Merge pull request #30 from ClaudiaRojasSoto/feature/corrections-firs…
ClaudiaRojasSoto Nov 6, 2023
58a35e9
Update README.md
PabloBona Nov 8, 2023
4204d5d
Update README.md
PabloBona Nov 8, 2023
1d51ccc
Update README.md
PabloBona Nov 8, 2023
6e6b5c6
Update README.md
PabloBona Nov 8, 2023
9717b57
Update README.md
PabloBona Nov 8, 2023
57ab445
Update README.md
PabloBona Nov 8, 2023
7c480a5
Update MIT.md
PabloBona Nov 8, 2023
2c8af88
Update MIT.md
PabloBona Nov 8, 2023
5b44ba1
Update MIT.md
PabloBona Nov 8, 2023
db98e9c
Update MIT.md
PabloBona Nov 8, 2023
f8c7394
Update MIT.md
PabloBona Nov 8, 2023
2eb1e68
Update MIT.md
PabloBona Nov 8, 2023
e1ccb82
Update MIT.md
PabloBona Nov 8, 2023
8061a62
Update MIT.md
PabloBona Nov 8, 2023
f26dafd
Update MIT.md
PabloBona Nov 8, 2023
c61f304
Update MIT.md
PabloBona Nov 8, 2023
09fc47f
Update MIT.md
PabloBona Nov 8, 2023
a9a2ef8
Update MIT.md
PabloBona Nov 8, 2023
69e46a8
Update MIT.md
PabloBona Nov 8, 2023
3b7bad6
Update MIT.md
PabloBona Nov 8, 2023
2d2b1a7
Update MIT.md
PabloBona Nov 8, 2023
4dd5e47
Update MIT.md
PabloBona Nov 8, 2023
e4e7089
Update MIT.md
PabloBona Nov 8, 2023
da49f39
Update Full Stack Capstone Project.postman_collection.json
PabloBona Nov 8, 2023
47c6b65
Merge pull request #31 from ClaudiaRojasSoto/extra
PabloBona Nov 8, 2023
4ae85ec
Update README.md
PabloBona Nov 16, 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
31 changes: 31 additions & 0 deletions .dockerignore
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
9 changes: 9 additions & 0 deletions .gitattributes
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
30 changes: 30 additions & 0 deletions .github/workflows/linters.yml
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
33 changes: 33 additions & 0 deletions .gitignore
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
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
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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/


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

ruby '3.2.2'

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

gem 'rubocop', '>= 1.0', '< 2.0'

gem 'rack-cors'

gem 'devise'

gem 'bcrypt', '~> 3.1', '>= 3.1.16'

# 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"

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 'factory_bot_rails'
gem 'faker'
gem 'rspec-rails', '~> 5.0'
gem 'shoulda-matchers', '~> 4.0'
end

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

gem 'capybara'
gem 'database_cleaner'
gem 'selenium-webdriver'
gem 'web-console'
end
Loading
Loading