How to run Steemhunt in local environment?

in steemhunt •  6 years ago  (edited)

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.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

This post has been curated by TeamMalaysia Community :-

To support the growth of TeamMalaysia Follow our upvotes by using steemauto.com and follow trail of @myach

Vote TeamMalaysia witness bitrocker2020 using this link vote for witness

I imagine this will be uber useful for developers who want to live test their codes in a sandbox environment?

yea, basically you don't need to know the back end setup and database setup, and you can have a back end spin up to test ur front end

@superoo7 I see how this will be useful for front end devs... Speaking of which maybe i dont have the eye for it but do you think steemhunt frontend needs for front end changes? look mighty cool to me already..

if you check on github, there are more than 70 issues being filed LOL

@superoo7 Devs gonna get real busy!!!

hi superoo7,

very interesting but prob..!!
frontend launch and accessible
but many problems with API during the test for installation (step docker-build crash ..)

I try to be inspired by the whole to create something else with in the idea steem, Eth, TRx

would you have any fixes to be able to test the foundations
thx