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

## Pull Request: Add Initial Backend Features (API v1) for Vecs School #26

Merged
merged 99 commits into from
Aug 31, 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
777292b
Create new rails app
christianonoh Aug 17, 2023
278bb1d
Add linters
christianonoh Aug 17, 2023
1f1ad4c
Create user model
christianonoh Aug 17, 2023
8ea4efb
Add course model
christianonoh Aug 17, 2023
a0532b6
Update schema and seeds files
christianonoh Aug 17, 2023
9d7fb1a
Update course model to add validations
christianonoh Aug 17, 2023
a501532
Create course controller with CRUD functions
christianonoh Aug 17, 2023
0fd29ab
Update routes file
christianonoh Aug 17, 2023
5e27bf9
Add user controller and update routes file
christianonoh Aug 17, 2023
30d61b0
Fix linter errors
christianonoh Aug 17, 2023
11fb9ab
Merge pull request #19 from christianonoh/setup
christianonoh Aug 17, 2023
6794183
update gimfile
Ellyboi Aug 21, 2023
16babb3
add reservation controllers
Ellyboi Aug 21, 2023
d5e9602
add reservation models
Ellyboi Aug 21, 2023
10acf3b
update db
Ellyboi Aug 21, 2023
15be68d
update routes to accommondate reservations
Ellyboi Aug 21, 2023
4ead6a1
update schema with reservation model
Ellyboi Aug 21, 2023
d6976c6
update controller test
Ellyboi Aug 21, 2023
0ec7332
Modify reservation migration file
christianonoh Aug 21, 2023
ccbddad
Modify reservation model to add associations
christianonoh Aug 21, 2023
49dbcc1
Add associations to user model
christianonoh Aug 21, 2023
1171491
Modify course model to add associations
christianonoh Aug 21, 2023
50336ce
Fix typo error
christianonoh Aug 21, 2023
2c0aba9
Modify reservation controller
christianonoh Aug 21, 2023
6962d8c
Update Schema
christianonoh Aug 21, 2023
653c24a
fix the linters error
Ellyboi Aug 21, 2023
d30bb3c
Merge pull request #20 from christianonoh/reservations
Ellyboi Aug 21, 2023
ea0c139
Install dependencies
christianonoh Aug 21, 2023
603828d
Setup devise and necessary configurations
christianonoh Aug 21, 2023
0df0bb5
Add devise to user model + migration file + modify route
christianonoh Aug 21, 2023
d862554
Update schema
christianonoh Aug 21, 2023
4b2055e
Add session and registration controllers and routes
christianonoh Aug 21, 2023
128601a
Configure devise-jwt
christianonoh Aug 21, 2023
799fe3d
Add JTI to user model
christianonoh Aug 22, 2023
16e5f8e
Permit name parameter
christianonoh Aug 22, 2023
33327db
Modify user_params
christianonoh Aug 22, 2023
7a130f7
Modify registrations & sessions controller using devise helpers
christianonoh Aug 22, 2023
3cc43b6
Add user serializer
christianonoh Aug 22, 2023
ab928e4
create a fake session hash
christianonoh Aug 22, 2023
b480ac1
Update schema
christianonoh Aug 22, 2023
fbe9bfe
Create current_user endpoint and update route file
christianonoh Aug 22, 2023
7c86972
Fix linter errors
christianonoh Aug 22, 2023
637347e
Update credentials
christianonoh Aug 22, 2023
c9ec9d6
Update database.yml
christianonoh Aug 22, 2023
6b1aae7
Update routes.rb
christianonoh Aug 22, 2023
e008870
Add course serializer and modify course controller to implement it
christianonoh Aug 22, 2023
ab58d04
Modify reservations controller
christianonoh Aug 22, 2023
005fe98
Modify users to use serializer
christianonoh Aug 22, 2023
320567d
Fix linters errors
christianonoh Aug 22, 2023
bf463ea
Merge pull request #21 from christianonoh/authentication
christianonoh Aug 23, 2023
3e82315
Add files via upload
christianonoh Aug 23, 2023
7c7e169
Update README.md
christianonoh Aug 23, 2023
57921e4
Update README.md
christianonoh Aug 23, 2023
63c4567
Update README.md
christianonoh Aug 23, 2023
db2ae07
add course data to registrations
smunoz1988 Aug 25, 2023
8737979
Setup rspec for testing
christianonoh Aug 25, 2023
a806e0c
Modify user model to add validations
christianonoh Aug 25, 2023
447fb16
Modify course model to add validations
christianonoh Aug 25, 2023
43b4d18
Modify reservation model to add validations
christianonoh Aug 25, 2023
2767fd5
Create user model test
christianonoh Aug 25, 2023
ea6d87e
Create course model test
christianonoh Aug 25, 2023
1b64d9b
Create reservation model test
christianonoh Aug 25, 2023
b088bc1
Install factory bot dependency
christianonoh Aug 25, 2023
eb3fd51
Modify `rails_helper.rb` to import factory bot
christianonoh Aug 25, 2023
909d527
Create user and course factories
christianonoh Aug 25, 2023
9eef344
Create course request test
christianonoh Aug 25, 2023
93e6b94
Create reservations request test
christianonoh Aug 25, 2023
4a4c0a4
Fix linter errors
christianonoh Aug 26, 2023
9d102dd
Modify course and user factory values
christianonoh Aug 26, 2023
dae6b97
Modify course, reservation and user model test to use factory data
christianonoh Aug 26, 2023
49d2ea9
Merge branch 'dev' into tests
christianonoh Aug 26, 2023
8d129ef
Merge pull request #22 from christianonoh/readme
christianonoh Aug 26, 2023
f32d7bb
Merge pull request #23 from christianonoh/tests
christianonoh Aug 26, 2023
035e1c7
add rswag configuration
Ellyboi Aug 28, 2023
6662d08
add course documentation using rswag
Ellyboi Aug 28, 2023
98a07da
add registration session using rswag for do
Ellyboi Aug 28, 2023
47ba741
add rservation documentation using rswag
Ellyboi Aug 28, 2023
4ba9b8b
add session to doc
Ellyboi Aug 28, 2023
931b415
update db
Ellyboi Aug 28, 2023
123af9d
add rswag to gemfile
Ellyboi Aug 28, 2023
248b799
update jwt timing
Ellyboi Aug 28, 2023
0bb229f
update course controller
Ellyboi Aug 28, 2023
a1ef8c9
fix the linters error
Ellyboi Aug 29, 2023
23f538d
fix linters error
Ellyboi Aug 29, 2023
a96a849
fix linters error
Ellyboi Aug 29, 2023
fd60c22
linters error fixed
Ellyboi Aug 29, 2023
9717f51
update all the files based on code reviewer suggestions
Ellyboi Aug 29, 2023
cf31425
Modify database.yml
christianonoh Aug 29, 2023
8ae1023
Fix linter errors
christianonoh Aug 29, 2023
86ff47f
Move controller spec files to controller folder
christianonoh Aug 29, 2023
497f4e5
Rename rswag test files to order them in documentation
christianonoh Aug 29, 2023
e325909
Modify routes.rb to navigate to `api-doc` on root path
christianonoh Aug 29, 2023
eef5781
Update swagger.yaml file
christianonoh Aug 29, 2023
5606560
Merge pull request #25 from christianonoh/rswag_doc
Ellyboi Aug 29, 2023
a637455
Modify Readme.md file to include seeds and correct testing commands
christianonoh Aug 30, 2023
638da95
Delete redundant test folder
christianonoh Aug 30, 2023
ea03b95
Fix typo
christianonoh Aug 30, 2023
10c1361
Update seeds.rb
christianonoh Aug 30, 2023
510e188
Merge pull request #27 from christianonoh/fix-review-changes
christianonoh Aug 30, 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
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
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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 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

# 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 @@
3.2.2
60 changes: 60 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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'

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

# 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 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
gem 'rspec-rails'

gem 'factory_bot_rails'
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[mri mingw x64_mingw]
end

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

gem 'rubocop', '~> 1.56'

gem 'devise'

gem 'devise-jwt'

gem 'jsonapi-serializer'

gem 'rswag'
Loading
Loading