Reactive Rails 6.1 app that allows users to upload a CSV file containing vehicles information
Reference CSV data (downloadable as a template from within import modal)
Name,Nationality,Email,Model,Year,ChassisNumber,Color,RegistrationDate,OdometerReading
Gemma,Kirke,gemma@kirke.me,Ford Focus,2018,123456789,Black,02/02/2018,30000
Jane Thomas,Australia,jane@thomas.me,Audi A4,2020,999999999,Green,02/01/2019,25000
Sam Johns,Belgium,sam@johns.me,BMW 4 Series,2017,111111111,White,05/01/2020,34000
Mehdi ,Elabd,mehdi@elabd.me,LEXUS IS 3000,2011,222222222,Black,02/01/2019,12300
Gemma,Kirke,gemma@kirke.me,INFINITI JX35,2011,444444444,Black,02/01/2019,12000
Jeni,Mohan,jeni@mohan.me,Audi A4,2018,555555555,White,05/04/2020,123000
Joseph,Sasank,joseph@sasank.me,Ford Focus,2020,888888888,Black,02/11/2019,34000
Notice that Name
and Nationality
columns can overlap -> handle that
- Leverage Reactive Rails using Hotwire Turbo
- Async offload of the import to background jobs so to not block the UI
- Downloadable CSV reports and import template
- List of customers-vehicles that is filterable
- Use RVM or rbenv, have PostgreSQL running
- clone this repository and
cd
into it bundle install
yarn
rails db:create
-> might need you to configure database credentialsrails db:schema:load
rails data:migrate
IMPORTANT! to load Country and Car brands datarails s
to launch local server- Open another terminal and launch the background jobs queue with
bundle exec good_job start
- See the app at http://127.0.0.1:3000/ and background jobs dashboard at http://127.0.0.1:3000/good_job/
I choose to use unfamiliar/new gems/libs in this project to see what's different from the regular way of libraries stacking
- Hotwire
- ViewComponent
- StimulusJS
- TailwindCSS
- Heroicon instead of FontAwesome
- Pagy instead of WillPaginate or Kaminari
- Ransack for search
- And last but not least
good_job
instead ofsidekiq
-> not Redis dependent on storing jobs queue anymore
The test matrix will mainly cover the CSV import interaction:
- Empty CSV should insert no data
- Invalid vehicle or customer rows
- Cross validation between customers fleet -> should not allow reassigning vehicles
- Customer-Country automatic association
- Vehicle-Model-Make automatic association
- Already existing vehicles should not be duplicated -> should be able to reupload the same CSV over and over without effect
Would have extended the app features towards:
Push notification + alert + list refresh
when some new records are inserted in the background- CSV Import statistics along with possibility to re-upload failed rows, the actual schema is already ready for that but the UI not wired up.
- Dockerized app