If you had been watching Steemhunt github, there is so many issues pilling up on steemhunt/web, but only the core developer @tabris and me working on the issues.
One of the issue of new contributors having to contribute to steemhunt is about installation of steemhunt in their environment. Personally, I also find that Ruby On Rails setup on different OS will have different outcomes, therefore from day 1 of me contributing to SteemHunt, I always wanted to dockerize the project so that everyone can use it with ease.
Today, I just send in a Pull Request #36 that I dockerize the back end server of SteemHunt, therefore I decided to write a tutorial on how to setup SteemHunt on your local machine that works on all OS including Windows, Linux and Mac.
(I tested this on Linux Mint and Mac)
Step 0: Installed required software
Since docker is used in this case, you need to install docker.
- install docker
- install git
- install node and npm
Step 1: Clone the repo
Create a folder to store both web and api repository.
(Since my pull request have not been merged, you need to use my repository)
- Official repo: https://github.com/Steemhunt/api/
- My repo: https://github.com/superoo7/api/ (With docker file)
> mkdir steemhunt && cd steemhunt
> git clone https://github.com/superoo7/api.git # replace to https://github.com/Steemhunt/api.git in future
> git clone https://github.com/Steemhunt/web.git # you can change this into your own forked repo
Step 2: Setup back end
Setting up the ruby on rails back end with ease! Open up a new terminal and run the following:
> cd api
> docker-compose build
> docker-compose up
Terminal 1
The docker will setup rails API server at localhost:3001
and postgres server at localhost:5432
.
Step 3: Setup front end
Once back end server is up, you can setup the front end.
> cd web
> npm install
open another terminal to run scss compiler of the web and another terminal to run react script on localhost:3000
> cd web
> npm run build-css
Terminal 2: scss compiler
> cd web
> npm run start
Terminal 3: React front end server at localhost:3000
The front end will be available at localhost:3000
localhost:3000
Conclusion
With the docker file being available, setting up the back end server are really easy. I hope that my contribution on dockerize steemhunt api server will drive interest of more front end developers to help out Steemhunt to develop and clear up pending issues.