create account

Greenshift 08: Setting Up Rails by qfilter

View this thread on: hive.blogpeakd.comecency.com
· @qfilter ·
$3.31
Greenshift 08: Setting Up Rails
In terms of Project Greenshift, we are still very early in the development of the project. We have yet to write a single piece of code and are still in the early stages of conceptual development. Sure we have a basic idea that we want to test, but we have yet to have a concrete implementation plan and have only now begun to start setting things up to begin actually building this project up.

First off, we need to take our repository and get a fresh Rails Project onto it before we begin working on Project Greenshift code. This requires cloning the repository and putting the new Project onto the cloned repository before pushing the changes back to Github. This is known as decentralized version control. Each person that works on the code has a complete history of it inside their repository and can publish changes that eventually other users can build upon. The Steem blockchain is built in such a way amongst a relatively large group of different developers and contributors.

<center>
![Greenshift B1.png](https://cdn.steemitimages.com/DQmcfLxANeGS8kX3MrJFoq4oT6kFeQ2dXaNS9BuW2Yq5fMd/Greenshift%20B1.png)
<h6></h6>
</center>

To initialize a Rails project, we need the Rails gem which I downloaded last time. A gem is a packaged library. Different developers publish gems so that user developers can develop on top of them. We see different libraries being shared and built upon in all sorts of different programming languages. Rails in fact is built on top of a lot of different gems which we have to download when we initialized the project. But luckily all of that information is abstracted away and all we have to do is the run the simple command below: 

<center>
![Greenshift B2.png](https://cdn.steemitimages.com/DQmSP57qKyeqDB2azJfFwPRZWjL4WK8qTWS1HbwhkesHbAc/Greenshift%20B2.png)
<h6></h6>
</center>

And just like that and a little patient waiting for Rails to grab a bunch of new gems we now have a fresh Rails project ready for us to begin working on:

<center>
![Greenshift B3.png](https://cdn.steemitimages.com/DQmSwkXV1P4onZDuGeEdoxMpTwKdT5WhUoXe9L1jUJw3RvF/Greenshift%20B3.png)
<h6></h6>
</center>

But before we dive in, I'll just briefly describe the structure that Rails supplies us. It is this structure that makes Rails a great web framework in that it provides a lot of stuff for you beforehand and ways to generate new code. It also keeps things organized and keeps things from getting too bloated.

The app folder holds most of the application code. The config folder allows us to set up routing throughout the web application and allow us to config settings during deployment of the application. The db folder holds the database structure and any changes we make to that structure. The lib folder allows us to define different tasks and jobs that allow us to automate different actions later in the process. Those are the big files in the project. There is also the Gemfile which basically tells the project which different gems it needs to build the project during deployment.

<center>
![Greenshift B4.png](https://cdn.steemitimages.com/DQmaiDUHU3XSb5dPCZJhYFQP1HDvjuE4QvmF27fbs66gjto/Greenshift%20B4.png)
<h6></h6>
</center>

Inside our application, there are the three key folders that define the architecture of the MVC paradigm. Models, Views, and Controllers. Models essentially run on the server side, grab information from the database, and store the current state of the website. Views run on the client side and are sent to users when they download the web page upon visiting the site. The controllers essentially communicate between the two, updating both the model and the views depending on different actions that the users take.

And that's pretty much the Rails architecture in a nutshell. Don't worry if that was really confusing because we will be going through each of these folders a bunch as we start developing code and building out this project. I'll also remember to throw in some conceptual and higher-level posts to mix things up as Project Greenshift begins to pick up steam.
👍  , , , ,
properties (23)
authorqfilter
permlinkgreenshift-08-setting-up-rails
categorygreenshift
json_metadata{"tags":["greenshift","blog","development","brainstorm","programming"],"image":["https://cdn.steemitimages.com/DQmcfLxANeGS8kX3MrJFoq4oT6kFeQ2dXaNS9BuW2Yq5fMd/Greenshift%20B1.png","https://cdn.steemitimages.com/DQmSP57qKyeqDB2azJfFwPRZWjL4WK8qTWS1HbwhkesHbAc/Greenshift%20B2.png","https://cdn.steemitimages.com/DQmSwkXV1P4onZDuGeEdoxMpTwKdT5WhUoXe9L1jUJw3RvF/Greenshift%20B3.png","https://cdn.steemitimages.com/DQmaiDUHU3XSb5dPCZJhYFQP1HDvjuE4QvmF27fbs66gjto/Greenshift%20B4.png"],"app":"steemit/0.1","format":"markdown"}
created2018-07-20 01:57:15
last_update2018-07-20 01:57:15
depth0
children1
last_payout2018-07-27 01:57:15
cashout_time1969-12-31 23:59:59
total_payout_value2.620 HBD
curator_payout_value0.690 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,037
author_reputation391,282,423,676
root_title"Greenshift 08: Setting Up Rails"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id65,307,981
net_rshares1,579,591,643,388
author_curate_reward""
vote details (5)
@steemprojects ·
This post has been just added as new item to _[timeline of Q-Filter on Steem Projects](https://steemprojects.com/projects/p/q-filter/?utm_source=comment_timeline&utm_medium=steem&utm_campaign=new_event&utm_content=c1)_.

If you want to be notified about new updates from this project, register on Steem Projects and add Q-Filter to your favorite projects.
properties (22)
authorsteemprojects
permlinkre-greenshift-08-setting-up-rails-20180819t111657
categorygreenshift
json_metadata""
created2018-08-19 11:17:00
last_update2018-08-19 11:17:00
depth1
children0
last_payout2018-08-26 11:17:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length357
author_reputation29,054,729,340
root_title"Greenshift 08: Setting Up Rails"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,687,999
net_rshares0