First sprint is officially started! My team and I have passed all along the journey before the first sprint is started. Yep, creating project vision, presentation slides about our product, mock up of our product, and list all our backlog. Now, we enter the development phase!
To begin develop our product, I got an assignment to initialize all the libraries that will be used and create a setup script which also known as build script. Our project will be developed using Ruby on Rails and MongoDB for the database, so I installed Ruby and Rails on my local laptop and fortunately MongoDB is already installed. But, my task isn’t finished yet just by installing Rails and MongoDB. I also installed sass-rails, mongoid, and haml-rails. Those libraries will be used for developing our product. I also configured some of the libraries to work expected. Unfortunately, I got some doubt to install React library (yep, our project will be also developed using React!).
There are two popular libraries that are already integrated inside Rails which are react-rails and react_on_rails. After some exploration, I found a good blog post that tells you there are 3 ways to use React in Rails with their comparison. I found an interesting terms that I ever heard before but never really know well about it. Before telling you what the terms is, you may look on Adam’s post, he was talking about pipeline. Guess what? This terms also contains a pipeline! But not pipeline used in CI, this is a pipeline which you’ll find in Rails. Yep, Rails asset pipeline. Cool! Rails also has a pipeline! But what is it for?
I installed react-rails library then followed this simplest explanation to configure the library and make sure it works well. But again, the installation process isn’t finished yet! Since we have to do TDD, I also have to prepare the libraries which allows you to do TDD with React in Rails. After several research, I found this helpful project and tell my team to use Jest for testing React. My team is okay with it, so I followed the step on that helpful project, I have to install browserify-rails first to make Jest can work in Rails.
Finally, after finishing the installation, I have to create a build script. I created a .sh file for setup the project automatically including installing dependencies like MongoDB and libraries in one step, yep just run that .sh file! That .sh file only works in Unix, so for the Windows users I already created the procedure to setup the project too. Finally, I have to test my script to make sure it’s running well. Actually, there is another task for me, which is setup linter for coding React. My team will use linter from Airbnb so our code will follow same convention. I already configured it but it isn’t running well yet.
Well, I’ve pushed some of my work to Gitlab and will push completely as soon as possible! I hope I can finish setup the linter and test the script soon. To end this post, I want to share good tutorials for creating simple CRUD in Rails using React:
Yep, we will also follow those tutorials to develop our project.