How to run Steemhunt in local environment?

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.

image.png

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.

68747470733a2f2f63646e2e646973636f72646170702e636f6d2f6174746163686d656e74732f3435353236353131323738323134333438382f3436303037333837303336383730323438382f646f636b65722e676966.gif

(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)

> 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

image.png
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.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center