Skip to content

Commit

Permalink
initial commit with user auth
Browse files Browse the repository at this point in the history
  • Loading branch information
kortirso committed Dec 29, 2022
0 parents commit bad57e3
Show file tree
Hide file tree
Showing 145 changed files with 3,871 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
coverage

.DS_Store

/app/assets/builds/*
!/app/assets/builds/.keep

/dist/*
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--color
--require spec_helper
--require rails_helper
241 changes: 241 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
require:
- rubocop-performance
- rubocop-rspec
- rubocop-rails

AllCops:
Exclude:
- 'bin/*'
- 'db/**/*'
- 'node_modules/**/*'
NewCops: enable

# Commonly used screens these days easily fit more than 80 characters.
Layout/LineLength:
Max: 120

# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
Max: 20

# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
Metrics/ClassLength:
Max: 1500

# No space makes the method definition shorter and differentiates
# from a regular assignment.
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space

# Single quotes being faster is hardly measurable and only affects parse time.
# Enforcing double quotes reduces the times where you need to change them
# when introducing an interpolation. Use single quotes only if their semantics
# are needed.
Style/StringLiterals:
EnforcedStyle: single_quotes

# We do not need to support Ruby 1.9, so this is good to use.
Style/SymbolArray:
Enabled: true

# Most readable form.
Layout/HashAlignment:
EnforcedHashRocketStyle: key
EnforcedColonStyle: key

# Mixing the styles looks just silly.
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
EnforcedShorthandSyntax: never

# has_key? and has_value? are far more readable than key? and value?
Style/PreferredHashMethods:
Enabled: false

# String#% is by far the least verbose and only object oriented variant.
Style/FormatString:
EnforcedStyle: percent

Style/CollectionMethods:
Enabled: true
PreferredMethods:
# inject seems more common in the community.
reduce: "inject"

# Either allow this style or don't. Marking it as safe with parenthesis
# is silly. Let's try to live without them for now.
Style/ParenthesesAroundCondition:
AllowSafeAssignment: false

Lint/AssignmentInCondition:
AllowSafeAssignment: false

# A specialized exception class will take one or more arguments and construct the message from it.
# So both variants make sense.
Style/RaiseArgs:
Enabled: false

# Indenting the chained dots beneath each other is not supported by this cop,
# see https://github.com/bbatsov/rubocop/issues/1633
Layout/MultilineOperationIndentation:
Enabled: false

Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

# Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
# The argument that fail should be used to abort the program is wrong too,
# there's Kernel#abort for that.
Style/SignalException:
EnforcedStyle: only_raise

# Suppressing exceptions can be perfectly fine, and be it to avoid to
# explicitly type nil into the rescue since that's what you want to return,
# or suppressing LoadError for optional dependencies
Lint/SuppressedException:
Enabled: false

# Layout/SpaceInsideBlockBraces:
# # The space here provides no real gain in readability while consuming
# # horizontal space that could be used for a better parameter name.
# # Also {| differentiates better from a hash than { | does.
# SpaceBeforeBlockParameters: false

# No trailing space differentiates better from the block:
# foo} means hash, foo } means block.
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space

# { ... } for multi-line blocks is okay, follow Weirichs rule instead:
# https://web.archive.org/web/20140221124509/http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc
Style/BlockDelimiters:
Enabled: false

# do / end blocks should be used for side effects,
# methods that run a block for side effects and have
# a useful return value are rare, assign the return
# value to a local variable for those cases.
Style/MethodCalledOnDoEndBlock:
Enabled: true

# Enforcing the names of variables? To single letter ones? Just no.
Style/SingleLineBlockParams:
Enabled: false

# Shadowing outer local variables with block parameters is often useful
# to not reinvent a new name for the same thing, it highlights the relation
# between the outer variable and the parameter. The cases where it's actually
# confusing are rare, and usually bad for other reasons already, for example
# because the method is too long.
Lint/ShadowingOuterLocalVariable:
Enabled: false

# Check with yard instead.
Style/Documentation:
Enabled: false

Naming/MethodParameterName:
AllowedNames:
- id

Style/IfUnlessModifier:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'config/**/*'
- 'spec/**/*'

Rails/FilePath:
EnforcedStyle: slashes

RSpec/NestedGroups:
Max: 7

RSpec/ContextWording:
Prefixes:
- when
- with
- without
- and
- if
- in
- for

RSpec/ExampleLength:
Max: 20

# Hanami::Interactor::Result expose are not verifiable
RSpec/VerifiedDoubles:
Enabled: false

Layout/MultilineMethodCallIndentation:
Enabled: false

Layout/EndAlignment:
EnforcedStyleAlignWith: variable

Style/FormatStringToken:
EnforcedStyle: template

Layout/CaseIndentation:
EnforcedStyle: end

RSpec/ImplicitSubject:
EnforcedStyle: single_statement_only

Lint/RaiseException:
Enabled: false

Lint/StructNewOverride:
Enabled: false

Style/HashEachMethods:
Enabled: false

Style/HashTransformKeys:
Enabled: false

Style/HashTransformValues:
Enabled: false

Layout/SpaceAroundMethodCallOperator:
Enabled: false

Style/ExponentialNotation:
Enabled: false

Style/RedundantRegexpEscape:
Enabled: false

# avoiding rubocop bug
Rails/UniqueValidationWithoutIndex:
Enabled: false

Rails/SkipsModelValidations:
Enabled: false

RSpec/MultipleMemoizedHelpers:
Enabled: false

Lint/MissingSuper:
Enabled: false

RSpec/InstanceVariable:
Enabled: false

RSpec/PredicateMatcher:
Enabled: false

RSpec/FactoryBot/ConsistentParenthesesStyle:
Enabled: false

Rails/InverseOf:
Enabled: false

Rails/RedundantForeignKey:
Enabled: false

Naming/BlockForwarding:
EnforcedStyle: explicit
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-3.1.2
72 changes: 72 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.1.2'

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

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

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 6.0'

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

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sassc-rails'
gem 'sprockets', git: 'https://github.com/rails/sprockets', branch: 'main'

# A framework for building view components
gem 'view_component', '~> 2.75', require: 'view_component/engine'

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
gem 'bcrypt', '~> 3.1'

# A ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT) standard
gem 'jwt', '~> 2.5'

# validations
gem 'dry-validation', '~> 1.10'

# Catch unsafe migrations in development
gem 'strong_migrations', '~> 1.4'

# Pretty print
gem 'awesome_print'

# running application
gem 'foreman'

# A performance dashboard for Postgres
gem 'pghero'

group :development, :test do
gem 'bullet', git: 'https://github.com/flyerhzm/bullet', branch: 'master'
gem 'rubocop', '~> 1.35', require: false
gem 'rubocop-performance', '~> 1.14', require: false
gem 'rubocop-rails', '~> 2.15', require: false
gem 'rubocop-rspec', '~> 2.12', require: false
end

group :development do
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem 'rack-mini-profiler', '>= 2.3.3'

# email previews
gem 'letter_opener'
end

group :test do
gem 'database_cleaner', '~> 2.0'
gem 'factory_bot_rails', '6.2.0'
gem 'json_spec', '1.1.5'
gem 'rails-controller-testing', '1.0.5'
gem 'rspec-rails', '~> 6.0'
gem 'shoulda-matchers', '~> 5.0'
gem 'simplecov', require: false
end
Loading

0 comments on commit bad57e3

Please sign in to comment.