This README would normally document whatever steps are necessary to get the application up and running.
Things you may want to cover:
- Project url: shonko-backend-app
- Ruby version
- 2.7.4
- Development configuration:
-
# The following instructions assumes that essential tools are configured, e.g. command line tool,git and homebrew $ rbenv install 2.7.4 # Or rvm, or whatever way to install the specified ruby version. $ # Generate development credentials. $ # Since it's a standalone application for now, there are no 3rd party credentials required. Simply generate your own development credentials: $ rails credentials:edit --environment development # Install dependencies $ bundle install # Setup development database $ rails db:setup # equvalent to rails db:migrate since no seed datum are configured # Now the rocket is ready to lift off! $ rails s # or bundle exec puma
-
- Dependencies
- Routes
friendly_id
+babosa
- For semantic url resource parameters(with ASCII support).
- Act as extensions
- gem 'acts_as_list'
- For sorting data with simple API
- I actually prefer some other approaches, for example, using
float
column to storeposition
.(previous.position + next.position) / 2
is a super simple and performant solution for sorting. However, considering the character of this project, I tend to adapt off-the-shelf solution.
- gem 'acts_as_list'
- API
jsonapi-serializer
- Small and lightening fast serializer
- Development
bullet
- Detect N+1 query issue
- Test
factory_bot
- Adapt
factory pattern
for building testing(or development) records in ease.
- Adapt
database_cleaner-active_record
- Truncate database for each tests, make sure each tests are independent.
shoulda-matchers
- Simple one-liner test syntax.
faker
- Random data generation.
- Routes
- Configuration
master.key
- Database creation
rails db:create
- Test Methodology
- Test pyramids:
- Request test as intergration test
- Covers routes as well.
- GraphQL integration test:
- Unit test
- Request test as intergration test
- Principles:
- Fast
- Mock behaviors from dependencies. e.g.
- Mock ORM classes instead of performing real query:
allow(ActiveRecord::Base).to receive(:find).and_return(double))
- Mock ORM classes instead of performing real query:
- Mock behaviors from dependencies. e.g.
- Complete
- Reliable
- Isolated
- Maintainable
- Expressive
- DAMP against DRY: Descriptive and Meaningful phrases
- Fast
- Test pyramids:
- Code of conduct:
- SOLID
- Comments:
- Only applies for
FIXME
andOPTIMIZE
, and they should be attached with follow-up task to resolve them.
- Only applies for
- TODO