You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Condenser is the react.js web interface to the world's first and best blockchain-based social media platform, steemit.com. It uses [STEEM](https://github.com/steemit/steem), a blockchain powered by Graphene 2.0 technology to store JSON-based content for a plethora of web applications.
5
+
Condenser is the react.js web interface to the world's first and best
6
+
blockchain-based social media platform, steemit.com. It uses
7
+
[STEEM](https://github.com/steemit/steem), a blockchain powered by Graphene
8
+
2.0 technology to store JSON-based content for a plethora of web
9
+
applications.
6
10
7
11
## Why would I want to use Condenser (steemit.com front-end)?
8
-
* Learning how to build blockchain-based web applications using STEEM as a content storage mechanism in react.js
12
+
13
+
* Learning how to build blockchain-based web applications using STEEM as a
14
+
content storage mechanism in react.js
9
15
* Reviewing the inner workings of the steemit.com social media platform
10
16
* Assisting with software development for steemit.com
11
17
12
18
## Installation
13
19
14
20
#### Docker
15
21
16
-
We highly recommend using docker to run condenser. This is how we run the live steemit.com site and it is the most supported (and fastest) method of both building and running condenser. We will always have the latest version of condenser (master branch) available on dockerhub. Configuration settings can be set using environment variables (see configuration section below for more information). If you need to install docker, you can get it at https://get.docker.com
22
+
We highly recommend using docker to run condenser. This is how we run the
23
+
live steemit.com site and it is the most supported (and fastest) method of
24
+
both building and running condenser. We will always have the latest version
25
+
of condenser (master branch) available on Docker Hub. Configuration settings
26
+
can be set using environment variables (see configuration section below for
27
+
more information). If you need to install docker, you can get it at
28
+
https://get.docker.com
17
29
18
30
To bring up a running container it's as simple as this:
19
31
@@ -27,7 +39,9 @@ Environment variables can be added like this:
27
39
docker run -it --env SDC_DATABASE_URL="mysql://user:pass@hostname/databasename" -p 8080:8080 steemit/condenser
28
40
```
29
41
30
-
If you would like to modify, build, and run condenser using docker, it's as simple as pulling in the github repo and issuing one command to build it, like this:
42
+
If you would like to modify, build, and run condenser using docker, it's as
43
+
simple as pulling in the github repo and issuing one command to build it,
44
+
like this:
31
45
32
46
```bash
33
47
git clone https://github.com/steemit/condenser
@@ -39,6 +53,7 @@ docker run -it -p 8080:8080 myname/condenser:mybranch
39
53
## Building from source without docker (the 'traditional' way):
40
54
41
55
#### Clone the repository and make a tmp folder
56
+
42
57
```bash
43
58
git clone https://github.com/steemit/condenser
44
59
cd condenser
@@ -47,16 +62,27 @@ mkdir tmp
47
62
48
63
#### Install dependencies
49
64
50
-
Install at least Node v8.7 if you don't already have it. We recommend using `nvm` to do this as it's both the simplest way to install and manage installed version(s) of node. If you need `nvm`, you can get it at [https://github.com/creationix/nvm](https://github.com/creationix/nvm).
65
+
Install at least Node v8.7 if you don't already have it. We recommend using
66
+
`nvm` to do this as it's both the simplest way to install and manage
67
+
installed version(s) of node. If you need `nvm`, you can get it at
Condenser is known to successfully build using node 8.7, npm 5.4.2, and yarn 1.3.2.
70
+
Condenser is known to successfully build using node 8.7, npm 5.4.2, and
71
+
yarn 1.3.2.
53
72
54
73
Using nvm, you would install like this:
74
+
55
75
```bash
56
76
nvm install v8.7
57
77
```
58
78
59
-
We use the yarn package manager instead of the default `npm`. There are multiple reasons for this, one being that we have `steem-js` built from source pulling the github repo as part of the build process and yarn supports this. This way the library that handles keys can be loaded by commit hash instead of a version name and cryptographically verified to be exactly what we expect it to be. Yarn can be installed with `npm`, but afterwards you will not need to use `npm` further.
79
+
We use the yarn package manager instead of the default `npm`. There are
80
+
multiple reasons for this, one being that we have `steem-js` built from
81
+
source pulling the github repo as part of the build process and yarn
82
+
supports this. This way the library that handles keys can be loaded by
83
+
commit hash instead of a version name and cryptographically verified to be
84
+
exactly what we expect it to be. Yarn can be installed with `npm`, but
85
+
afterwards you will not need to use `npm` further.
60
86
61
87
```bash
62
88
npm install -g yarn
@@ -70,53 +96,84 @@ To run condenser in production mode, run:
70
96
yarn run production
71
97
```
72
98
73
-
When launching condenser in production mode it will automatically use 1 process per available core. You will be able to access the front-end at http://localhost:8080 by default.
99
+
When launching condenser in production mode it will automatically use 1
100
+
process per available core. You will be able to access the front-end at
101
+
http://localhost:8080 by default.
74
102
75
103
To run condenser in development mode, run:
76
104
77
105
```bash
78
106
yarn run start
79
107
```
80
108
81
-
It will take quite a bit longer to start in this mode (~60s) as it needs to build and start the webpack-dev-server.
109
+
It will take quite a bit longer to start in this mode (~60s) as it needs to
110
+
build and start the webpack-dev-server.
82
111
83
-
By default you will be connected to steemit.com's public steem node at `wss://steemd.steeemit.com`. This is actually on the real blockchain and you would use your regular account name and credentials to login - there is not an official separate testnet at this time. If you intend to run a full-fledged site relying on your own, we recommend looking into running a copy of `steemd` locally instead [https://github.com/steemit/steem](https://github.com/steemit/steem).
112
+
By default you will be connected to steemit.com's public steem node at
113
+
`wss://steemd.steeemit.com`. This is actually on the real blockchain and
114
+
you would use your regular account name and credentials to login - there is
115
+
not an official separate testnet at this time. If you intend to run a
116
+
full-fledged site relying on your own, we recommend looking into running a
The intention is to configure condenser using environment variables. You can see the names of all of the available configuration environment variables in `config/custom-environment-variables.json`. Default values are stored in `config/defaults.json`.
122
+
The intention is to configure condenser using environment variables. You
123
+
can see the names of all of the available configuration environment
124
+
variables in `config/custom-environment-variables.json`. Default values are
Keep in mind environment variables only exist in your active session, so if you wish to save them for later use you can put them all in a file and `source` them in.
96
133
97
-
If you'd like to statically configure condenser without variables you can edit the settings directly in `config/production.json`. If you're running in development mode, copy `config/production.json` to `config/dev.json` with `cp config/production.json config/dev.json` and adjust settings in `dev.json`.
134
+
Keep in mind environment variables only exist in your active session, so if
135
+
you wish to save them for later use you can put them all in a file and
136
+
`source` them in.
137
+
138
+
If you'd like to statically configure condenser without variables you can
139
+
edit the settings directly in `config/production.json`. If you're running
140
+
in development mode, copy `config/production.json` to `config/dev.json`
141
+
with `cp config/production.json config/dev.json` and adjust settings in
142
+
`dev.json`.
98
143
99
-
If you're intending to run condenser in a production environment one configuration option that you will definitely want to edit is `server_session_secret` which can be set by the environment variable `SDC_SESSION_SECRETKEY`. To generate a new value for this setting, you can do this:
144
+
If you're intending to run condenser in a production environment one
145
+
configuration option that you will definitely want to edit is
146
+
`server_session_secret` which can be set by the environment variable
147
+
`SDC_SESSION_SECRETKEY`. To generate a new value for this setting, you can
148
+
do this:
100
149
101
150
```bash
102
151
node
103
152
> crypto.randomBytes(32).toString('base64')
104
153
> .exit
105
154
```
106
155
107
-
####Install mysql server
156
+
## Install mysql server
108
157
109
-
If you've followed the instructions up until this point you will already have a running condenser installation which is entirely acceptable for development purposes. It is *not required to run a SQL server for development*. If you're running a full-fledged site however, you will want to set one up.
158
+
If you've followed the instructions up until this point you will already
159
+
have a running condenser installation which is entirely acceptable for
160
+
development purposes. It is *not required to run a SQL server for
161
+
development*. If you're running a full-fledged site however, you will want
162
+
to set one up.
110
163
111
-
Once set up, you can set the mysql server configuration option for condenser using the environment variable `SDC_DATABASE_URL`, or alternatively by editing it in `config/production.json`. You will use the format `mysql://user:pass@hostname/databasename`.
164
+
Once set up, you can set the mysql server configuration option for
165
+
condenser using the environment variable `SDC_DATABASE_URL`, or
166
+
alternatively by editing it in `config/production.json`. You will use the
Here are instructions for setting up a mysql server and running the necessary migrations by operating system:
175
+
Here are instructions for setting up a mysql server and running the
176
+
necessary migrations by operating system:
120
177
121
178
OS X:
122
179
@@ -135,8 +192,8 @@ sudo apt-get update
135
192
sudo apt-get install mysql-server
136
193
```
137
194
138
-
On Ubuntu 16.04+ you may be unable to connect to mysql without root access, if
139
-
so update the mysql root user as follows:
195
+
On Ubuntu 16.04+ you may be unable to connect to mysql without root access,
196
+
if so update the mysql root user as follows:
140
197
141
198
```
142
199
sudo mysql -u root
@@ -153,12 +210,14 @@ mysql -u root
153
210
> quit
154
211
```
155
212
156
-
####Database migrations
213
+
### Database migrations
157
214
158
-
This is a required step in order for the database to be 'ready' for condenser's use.
215
+
This is a required step in order for the database to be 'ready' for
216
+
condenser's use.
159
217
160
-
161
-
Edit the file `src/db/config/config.json` using your favorite command line text editor being sure that the username, password, host, and database name are set correctly and match your newly configured mysql setup.
218
+
Edit the file `src/db/config/config.json` using your favorite command line
219
+
text editor being sure that the username, password, host, and database name
220
+
are set correctly and match your newly configured mysql setup.
162
221
163
222
Run `sequelize db:migrate` in `src/db` directory, like this:
164
223
@@ -167,22 +226,28 @@ cd src/db
167
226
yarn exec sequelize db:migrate
168
227
```
169
228
170
-
####Style Guides For Submitting Pull Requests
229
+
## Style Guides For Submitting Pull Requests
171
230
172
-
#####File naming and location
231
+
### File naming and location
173
232
174
233
- Prefer CamelCase js and jsx file names
175
234
- Prefer lower case one word directory names
176
235
- Keep stylesheet files close to components
177
236
- Component's stylesheet file name should match component name
178
237
179
-
##### Js & Jsx
238
+
#### Js & Jsx
239
+
240
+
We use [prettier](https://github.com/prettier/prettier) to autofromat the
241
+
code, with [this configuration](.prettierrc). Run `yarn run fmt` to format
242
+
everything in `src/`, or `yarn exec -- prettier --config .prettierrc
243
+
--write src/whatever/file.js` for a specific file.
180
244
181
-
We use [prettier](https://github.com/prettier/prettier) to autofromat the code, with [this configuration](.prettierrc). Run `yarn run fmt` to format everything in `src/`, or `yarn exec -- prettier --config .prettierrc --write src/whatever/file.js` for a specific file.
245
+
#### CSS & SCSS
182
246
183
-
##### CSS & SCSS
184
-
If a component requires a css rule, please use its uppercase name for the class, e.g. "Header" class for the header's root div.
185
-
We adhere to BEM methodology with exception for Foundation classes, here is an example for the Header component:
247
+
If a component requires a css rule, please use its uppercase name for the
248
+
class, e.g. "Header" class for the header's root div. We adhere to BEM
249
+
methodology with exception for Foundation classes, here is an example for
250
+
the Header component:
186
251
187
252
```html
188
253
<!-- Block -->
@@ -195,6 +260,10 @@ We adhere to BEM methodology with exception for Foundation classes, here is an e
0 commit comments