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 group capstone #34

Merged
merged 122 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 112 commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
6f75df7
Create rails API app
rubydevi Oct 31, 2023
d889562
Set up linters
rubydevi Oct 31, 2023
4b503f8
Update LICENCE
rubydevi Oct 31, 2023
42f6eaa
Documentation:added readme file to project
RileyManda Nov 1, 2023
c218d3c
Documentation:application logo
RileyManda Nov 1, 2023
318947a
Documentation:Removed extra line:install
RileyManda Nov 1, 2023
ac0be33
Update the indentation of Install section
rubydevi Nov 1, 2023
776b2a0
Merge branch 'f/setup-project' of github.com:rubydevi/jetlogix-backen…
rubydevi Nov 1, 2023
8e76fda
Merge pull request #15 from rubydevi/f/setup-project
rubydevi Nov 1, 2023
9ee078e
Set up rspec rails
rubydevi Nov 1, 2023
d4b9758
Generate User model
rubydevi Nov 1, 2023
d1e4ace
Generate Aeroplane model
rubydevi Nov 1, 2023
1018fb4
Generate Reservation model
rubydevi Nov 1, 2023
ea885d4
Fix Linters
rubydevi Nov 1, 2023
19799d7
Database migration and gem update
rubydevi Nov 1, 2023
d72040b
Merge pull request #17 from rubydevi/f/models-controllers
rubydevi Nov 1, 2023
4501254
Add routing for API endpoint
rubydevi Nov 1, 2023
739177b
Create association for all the models
rubydevi Nov 1, 2023
b76e58b
Validate all the necessary fields
rubydevi Nov 1, 2023
aa1a61d
chores: install devise and devise_jwt gem
Yonashenok Nov 1, 2023
58128c2
feat: update username and password
Yonashenok Nov 1, 2023
65fa781
Chores: install and Config Rack-cors gem
Yonashenok Nov 1, 2023
70c498f
feat: configer the port on the puma file set devise route
Yonashenok Nov 1, 2023
81cba24
feat: genarate devise and migrate user to users table
Yonashenok Nov 1, 2023
d16bebe
feat: create devise controllers and routes
Yonashenok Nov 1, 2023
d612999
Follow naming convention for associating tables
rubydevi Nov 1, 2023
7e2f360
Merge pull request #20 from rubydevi/f/association-routing
rubydevi Nov 1, 2023
4c01a5e
feat: set up a revocation strategy
Yonashenok Nov 1, 2023
9c7d5b9
feat: respond_with using jsonapi_serializers
Yonashenok Nov 1, 2023
441b55e
Create index action to return aeroplanes json data
rubydevi Nov 1, 2023
6323b43
Add some dummy data to test
rubydevi Nov 1, 2023
6a7ab2a
fix: bug on devise.rb config file
Yonashenok Nov 2, 2023
05a8bbd
feat: add user name as regastiration on devise
Yonashenok Nov 2, 2023
65fe0c6
feat: role colume is add to users table
Yonashenok Nov 2, 2023
8104b4f
Fix merge conflict on the route.rb and user.rb accpted both changes
Yonashenok Nov 2, 2023
ec60288
fix: linter error
Yonashenok Nov 2, 2023
d5e6cc3
feat: update the route and user.rb
Yonashenok Nov 2, 2023
97007b3
Merge pull request #21 from rubydevi/f/autho
Yonashenok Nov 2, 2023
d9c1b99
Dummy data for testing this PR
rubydevi Nov 2, 2023
d7b0230
Configure cors middleware
rubydevi Nov 2, 2023
3d5b9a1
Merge branch 'dev' of github.com:rubydevi/jetlogix-backend into f/mai…
rubydevi Nov 3, 2023
5b1ca65
Add role in user_serialiser
rubydevi Nov 3, 2023
72cc8ff
Merge pull request #22 from rubydevi/f/main-page
rubydevi Nov 3, 2023
f55571c
Updated controller and models:params and validations and routes.
RileyManda Nov 3, 2023
631b8fe
Linter fixes
RileyManda Nov 3, 2023
5289f69
feat: api controller for reservation
Yonashenok Nov 3, 2023
9fba31d
Merge branch 'f/add-aeroplane' of https://github.com/rubydevi/jetlogi…
Yonashenok Nov 3, 2023
1e60880
Merge pull request #23 from rubydevi/f/add-aeroplane
RileyManda Nov 3, 2023
61bd596
feat: controller for the show
Yonashenok Nov 3, 2023
7c34ff1
fix: linter error
Yonashenok Nov 3, 2023
ef34d29
reactor: remove commented code
Yonashenok Nov 3, 2023
25f70db
Merge pull request #24 from rubydevi/f/jet-show
Yonashenok Nov 4, 2023
ce7eac7
feat: remove redirection on the
Yonashenok Nov 4, 2023
8409b1d
fix: remove redirection from render
Yonashenok Nov 4, 2023
a7e7b4d
feat: add before action to auth
Yonashenok Nov 4, 2023
6249647
Updated db schema
RileyManda Nov 4, 2023
13a726f
Updated end_time data type
RileyManda Nov 4, 2023
ab321c4
Updated fee column to numeric
RileyManda Nov 4, 2023
8b75c38
Schema update:falsely ommited
RileyManda Nov 4, 2023
5bc26e9
Merge pull request #25 from rubydevi/f/reserve
Yonashenok Nov 4, 2023
83f57bc
db:schema dump
RileyManda Nov 4, 2023
0cd0fa4
Merge branch 'f/schema-iterations' of https://github.com/rubydevi/jet…
Yonashenok Nov 4, 2023
0daef12
Merge branch 'dev' of https://github.com/rubydevi/jetlogix-backend in…
Yonashenok Nov 4, 2023
33cda59
Add a destroy action for aeroplane
rubydevi Nov 5, 2023
6ab6cdd
Added rswag gem
RileyManda Nov 6, 2023
d362d15
Generated rswag initializers and swagger spec
RileyManda Nov 6, 2023
d674c05
Add a destroy action for aeroplane
rubydevi Nov 5, 2023
cbae150
Updated test cases:Path
RileyManda Nov 6, 2023
1dc0cc1
Implemented Updated and destroy specs
RileyManda Nov 6, 2023
e507660
Removed update from aeroplane controller
RileyManda Nov 6, 2023
7608cd8
Delete spec
RileyManda Nov 6, 2023
209b13f
Uppdated reservations specs
RileyManda Nov 6, 2023
5a60a46
Implemented api spec:docs-Test cases
RileyManda Nov 6, 2023
9b9abaf
Implemented reservatiosn rspec:api docs
RileyManda Nov 6, 2023
b0c6fee
Merge pull request #27 from rubydevi/f/aeroplane-delete
rubydevi Nov 6, 2023
5d2daf7
Merge pull request #26 from rubydevi/f/schema-iterations
RileyManda Nov 6, 2023
74dc5a1
Updated features and tech stack
RileyManda Nov 6, 2023
36f6b7d
Merge branch 'f/api-documentation' of https://github.com/rubydevi/jet…
Yonashenok Nov 6, 2023
61adb5e
fix: create requset with remove aeroplane with reservation
Yonashenok Nov 6, 2023
6d2092b
Merge branch 'dev' of https://github.com/rubydevi/jetlogix-backend in…
Yonashenok Nov 6, 2023
63f32e5
Merge branch 'dev' into f/api-documentation
Yonashenok Nov 6, 2023
d175c13
Merge pull request #28 from rubydevi/f/api-documentation
RileyManda Nov 6, 2023
5192da6
Updated reservations index to support show reservations
RileyManda Nov 6, 2023
4e70e23
Removed json render from reservations index
RileyManda Nov 6, 2023
8262435
Update routes and cors.rb
rubydevi Nov 7, 2023
d5e222b
Update Metrics/BlockLength
rubydevi Nov 7, 2023
3743a1a
Update Swagger documentation files
rubydevi Nov 7, 2023
583bc24
Merge branch 'dev' of https://github.com/rubydevi/jetlogix-backend in…
Yonashenok Nov 7, 2023
842ec3a
Merge branch 'f/show-reservations' of https://github.com/rubydevi/jet…
Yonashenok Nov 7, 2023
652c05e
feat: genaret migration for column name on reservation
Yonashenok Nov 7, 2023
0380455
feat: update the schama
Yonashenok Nov 7, 2023
d432724
Merge pull request #30 from rubydevi/f/api-documentation
rubydevi Nov 7, 2023
bc2ed17
Increased token expiry time
RileyManda Nov 8, 2023
f48bd13
Merge pull request #29 from rubydevi/f/show-reservations
RileyManda Nov 8, 2023
df16c04
Merge branch 'dev' of https://github.com/rubydevi/jetlogix-backend in…
Yonashenok Nov 8, 2023
27eb9ee
Added name param to reservations controller
RileyManda Nov 8, 2023
1c3ba45
Merge pull request #32 from rubydevi/f/iterations
RileyManda Nov 8, 2023
94a9d1c
Merge branch 'dev' of https://github.com/rubydevi/jetlogix-backend in…
Yonashenok Nov 8, 2023
13acf75
Docs update the prerequirment
Yonashenok Nov 9, 2023
ec83ef5
remove credential file
Yonashenok Nov 9, 2023
671f2f5
Merge pull request #33 from rubydevi/f/readme-update
Yonashenok Nov 9, 2023
62c0182
Updated reade me file with correct spec test command:Removed destroy …
RileyManda Nov 9, 2023
146da59
Linter fixes
RileyManda Nov 9, 2023
5a73eab
feat: add model folder
Yonashenok Nov 10, 2023
78e0552
Add model spec for aeroplane
rubydevi Nov 10, 2023
a4f3256
Update README
rubydevi Nov 10, 2023
795e388
Test: the reservation model for its attributes
Yonashenok Nov 10, 2023
2b61d62
remove: unused folder test and update the destroy method
Yonashenok Nov 10, 2023
d2d807a
fix: linter error
Yonashenok Nov 10, 2023
8d53755
Merge pull request #35 from rubydevi/f/iterations-tests
RileyManda Nov 10, 2023
ef3ba1c
Add migration file for name column
rubydevi Nov 10, 2023
e42cab2
Merge pull request #37 from rubydevi/bugfix/1
rubydevi Nov 10, 2023
cfd14fa
Added attribution,kanban board states to readme|env file setup|added …
RileyManda Nov 13, 2023
8f27731
Updated readme:rails db:migrate RAILS_ENV=test
RileyManda Nov 13, 2023
8973a4b
Updated end details
RileyManda Nov 13, 2023
7a69cd4
Updated env file variables and included number of team members in kan…
RileyManda Nov 13, 2023
256b212
Merge pull request #38 from rubydevi/f/documentation-update
RileyManda Nov 13, 2023
67feb36
Docs: update readme ER digram
Yonashenok Nov 14, 2023
46e85a7
docs: image update
Yonashenok Nov 14, 2023
d8b829f
Merge pull request #39 from rubydevi/f/update-readme
Yonashenok Nov 14, 2023
4d1d9f6
Update readme to include Live URL
rubydevi Nov 14, 2023
41f1a14
Merge pull request #40 from rubydevi/f/readme-liveurl
rubydevi Nov 14, 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.
rubydevi marked this conversation as resolved.
Show resolved Hide resolved

# 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
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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
.env
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
62 changes: 62 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
AllCops:
NewCops: enable
Exclude:
- 'db/**/*'
- 'bin/*'
- 'config/**/*'
- 'Guardfile'
- 'Rakefile'
- 'node_modules/**/*'

DisplayCopNames: true

Layout/LineLength:
Max: 125
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: 40

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

ruby '3.2.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'faker', '~> 2.20'
gem 'rails', '~> 7.1.1'
gem 'rspec-rails'
gem 'rswag'
# gem 'rswag-api'
# gem 'rswag-ui'
# 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"

gem 'devise'
gem 'devise-jwt'
gem 'jsonapi-serializer'
# 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 'dotenv-rails'
end

group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
# gem 'rspec-rails'
# gem 'rswag-specs'
end
Loading
Loading