diff --git a/README.md b/README.md index 2e505ab2..009ba6ae 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ # Spee.ch +Spee.ch is a [NodeJS](https://nodejs.org) React web app that reads and publishes images and videos to and from the [LBRY](https://lbry.io/) blockchain. -spee.ch provides a user-friendly, custom-designed, image and video hosting site backed by a decentralized network and -blockchain ([LBRY](https://lbry.tech/)). Via just a small set of config files, you can spin your an entire spee.ch site back up including assets. +You can create your own custom version of spee.ch by installing this code base and then creating your own custom components and styles to override the defaults. (More details/guide on how to do that coming soon.) +Spee.ch depends on two other lbry technologies: + * [chainquery](https://github.com/lbryio/chainquery) - a normalized database of the blockchain data. We've provided credentials to use a public chainquery service. You can also install it on your own server to avoid being affected by the commons. + * [lbrynet](https://github.com/lbryio/lbry) - a daemon that handles your wallet and transactions. ![App GIF](https://spee.ch/e/speechgif.gif) -For a completely open, unrestricted example of a spee.ch site, check out https://www.spee.ch. +## Install -For a closed, custom-hosted and branded example, check out https://lbry.theantimedia.com/. +### Ubuntu Step by Step +[Ubuntu Install Guide](./docs/ubuntuinstall.md) -## Installation - -### Ubuntu Step-by-Step - -[Step-by-step Ubuntu Install Guide](./docs/ubuntuinstall.md) - -### Full Instructions +### Quickstart Overview #### Get some information ready: * mysqlusername @@ -23,7 +21,7 @@ For a closed, custom-hosted and branded example, check out https://lbry.theantim * domainname or 'http://localhost' * speechport = 3000 -#### Install and Set Up Dependencies +#### Install and Set Up System Dependencies: * Firewall open ports * 22 * 80 @@ -51,7 +49,7 @@ For a closed, custom-hosted and branded example, check out https://lbry.theantim * _note: even running on http://localhost, you must redirect http or https to port 3000_ -#### Clone spee.ch +#### Clone a spee.ch repo (choose one) * release version for stable production ``` $ git clone -b release https://github.com/lbryio/spee.ch.git @@ -97,8 +95,8 @@ Check out the [customization guide](https://github.com/lbryio/spee.ch/blob/readm #### (optional) add custom components and update the styles - * Create custom components by creating React components in `site/custom/src/` - * Update or override the CSS by changing the files in `site/custom/scss` + * Create custom components by creating React components in `site/custom/src/` (further instructions coming soon) + * Update the CSS by changing the files in `site/custom/scss` (further instructions and refactor coming soon) #### (optional) install your own chainquery Instructions are coming at [lbry-docker] to install your own chainquery instance using docker-compose. This will require 50GB of preferably SSD space and at least 10 minutes to download, possibly much longer. @@ -224,8 +222,7 @@ Spee.ch also runs a sync tool, which decodes blocks from the `LBRY` blockchain a * To run only tests that do not require LBC, run `npm run test:no-lbc` ### URL formats -Spee.ch has a few types of URL formats that return different assets from the LBRY network. Below is a list of all possible URLs for the content on spee.ch. You can learn more about LBRY URLs [here](https://lbry.tech/resources/uri). - +Spee.ch has a few types of URL formats that return different assets from the LBRY network. Below is a list of all possible URLs for the content on spee.ch * retrieve the controlling `LBRY` claim: * https://spee.ch/`claim` * https://spee.ch/`claim`.`ext` (serve) @@ -243,15 +240,22 @@ Spee.ch has a few types of URL formats that return different assets from the LBR * https://spee.ch/`@channel`:`channel_id`/`claim` * https://spee.ch/`@channel`:`channel_id`/`claim`.`ext` (serve) -### Dependencies - -Spee.ch depends on two other lbry technologies: - * [chainquery](https://github.com/lbryio/chainquery) - a normalized database of the blockchain data. We've provided credentials to use a public chainquery service. You can also install it on your own server to avoid being affected by the commons. - * [lbrynet](https://github.com/lbryio/lbry) - a daemon that handles your wallet and transactions. - ### Bugs If you find a bug or experience a problem, please report your issue here on GitHub and find us in the lbry discord! +### Issue tags in this repo +#### level 1 +Issues that anyone with basic web development can handle; little-to-no experience with the spee.ch codebase is required. + +#### level 2 +Familiarity with web apps is required, but little-to-no familiarity with the lbry daemon is necessary + +#### level 3 +Familiarity with the spee.ch code base and how the lbry daemon functions is required + +#### level 4 +Issues with lbry (e.g. the spee.ch wallet, lbrynet configuration, etc.) that require strong familiarity with the lbry daemon and/or network to fix. Generally these issues are best suited for the `lbry` `protocol team` but are reported in this repo because they are part of the spee.ch implementation + ## License This project is MIT licensed. For the full license, see [LICENSE](LICENSE). diff --git a/client/scss/all.scss b/client/scss/all.scss index 07601eb5..c61e42bd 100644 --- a/client/scss/all.scss +++ b/client/scss/all.scss @@ -1,44 +1,44 @@ -@import '~scss/_variables'; -@import '~scss/_reset'; -@import '~scss/font/_font.scss'; -@import '~scss/_html'; -@import '~scss/_body'; -@import '~scss/_react-app'; -@import '~scss/_text'; +@import '_variables'; +@import '_reset'; +@import 'font/_font.scss'; +@import '_html'; +@import '_body'; +@import '_react-app'; +@import '_text'; -@import '~scss/_link'; -@import '~scss/_input'; -@import '~scss/_select'; -@import '~scss/_textarea'; -@import '~scss/_video'; -@import '~scss/_form'; +@import '_link'; +@import '_input'; +@import '_select'; +@import '_textarea'; +@import '_video'; +@import '_form'; -@import '~scss/_asset-display'; -@import '~scss/_asset-preview'; -@import '~scss/_button'; -@import '~scss/_button-primary'; -@import '~scss/_button-secondary'; -@import '~scss/_click-to-copy'; -@import '~scss/_form-feedback'; -@import '~scss/_horizontal-split'; -@import '~scss/_label'; -@import '~scss/_nav-bar'; -@import '~scss/_page-layout'; -@import '~scss/_page-layout-show-lite'; -@import '~scss/_page-content'; -@import '~scss/_progress-bar'; -@import '~scss/_publish-preview'; -@import '~scss/_share-buttons'; -@import '~scss/_space-between'; -@import '~scss/_space-around'; -@import '~scss/_row'; -@import '~scss/_tooltip'; -@import '~scss/_social-share-link'; +@import '_asset-display'; +@import '_asset-preview'; +@import '_button'; +@import '_button-primary'; +@import '_button-secondary'; +@import '_click-to-copy'; +@import '_form-feedback'; +@import '_horizontal-split'; +@import '_label'; +@import '_nav-bar'; +@import '_page-layout'; +@import '_page-layout-show-lite'; +@import '_page-content'; +@import '_progress-bar'; +@import '_publish-preview'; +@import '_share-buttons'; +@import '_space-between'; +@import '_space-around'; +@import '_row'; +@import '_tooltip'; +@import '_social-share-link'; -@import '~scss/_channel-claims-display'; -@import '~scss/_dropzone'; -@import '~scss/_publish-url-input'; -@import '~scss/_publish-status'; -@import '~scss/_publish-disabled-message'; +@import '_channel-claims-display'; +@import '_dropzone'; +@import '_publish-url-input'; +@import '_publish-status'; +@import '_publish-disabled-message'; -@import '~scss/_media-queries'; +@import '_media-queries'; diff --git a/server/chainquery/bundle.js b/server/chainquery/bundle.js index 4a96169b..a859bd5d 100644 --- a/server/chainquery/bundle.js +++ b/server/chainquery/bundle.js @@ -873,8 +873,7 @@ var claimQueries = (db, table, sequelize) => ({ logger$1.debug(`claim.getAllChannelClaims for ${channelClaimId}`); const defaultWhereClauses = { - bid_state: - { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] } + bid_state: { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] } }; const addWhereClauses = (whereClauses, params) => { @@ -969,7 +968,7 @@ var claimQueries = (db, table, sequelize) => ({ getTopFreeClaimIdByClaimName: async (name) => { return await table.findAll({ // TODO: Limit 1 - where: { name }, + where: { name, bid_state: { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] } }, order: [['effective_amount', 'DESC'], ['height', 'ASC']], }).then(result => { if(result.length === 0) { diff --git a/server/chainquery/queries/claimQueries.js b/server/chainquery/queries/claimQueries.js index cf4b532b..521cda04 100644 --- a/server/chainquery/queries/claimQueries.js +++ b/server/chainquery/queries/claimQueries.js @@ -72,8 +72,7 @@ export default (db, table, sequelize) => ({ logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`); const defaultWhereClauses = { - bid_state: - { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] } + bid_state: { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] } }; const addWhereClauses = (whereClauses, params) => { @@ -168,7 +167,7 @@ export default (db, table, sequelize) => ({ getTopFreeClaimIdByClaimName: async (name) => { return await table.findAll({ // TODO: Limit 1 - where: { name }, + where: { name, bid_state: { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] } }, order: [['effective_amount', 'DESC'], ['height', 'ASC']], }).then(result => { if(result.length === 0) { diff --git a/utils/createModuleAliases.js b/utils/createModuleAliases.js index b9129f47..c77802e4 100644 --- a/utils/createModuleAliases.js +++ b/utils/createModuleAliases.js @@ -2,7 +2,6 @@ const { statSync, existsSync, readdirSync } = require('fs'); const { join, resolve } = require('path'); const DEFAULT_ROOT = 'client/build'; const CUSTOM_ROOT = 'site/custom/build'; -const DEFAULT_SCSS_ROOT = 'client/scss'; const CUSTOM_SCSS_ROOT = 'site/custom/scss'; const getFolders = path => { @@ -24,6 +23,17 @@ const addAliasesForCustomComponentFolder = (name, aliasObject) => { return aliasObject; }; +const addAlliasesForSCSS = (aliasObject) => { // scss + // creates an alias for every folder found in the custom scss folder + const customScssRoot = resolve(`${CUSTOM_SCSS_ROOT}`); + const customFolders = getFolders(customScssRoot); + for (let i = 0; i < customFolders.length; i++) { + let folderName = customFolders[i]; + aliasObject[folderName] = resolve(`${CUSTOM_SCSS_ROOT}/${folderName}`); + } + return aliasObject; +}; + module.exports = () => { let moduleAliases = {}; @@ -48,6 +58,9 @@ module.exports = () => { moduleAliases['@sagas'] = resolve(`${DEFAULT_ROOT}/sagas`); moduleAliases['@app'] = resolve(`${DEFAULT_ROOT}/app.js`); + // scss aliases + moduleAliases = addAlliasesForSCSS(moduleAliases); + // return finished aliases return moduleAliases; }; diff --git a/webpack.config.js b/webpack.config.js index 5672721f..1512a4d5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,8 +2,6 @@ const Path = require('path'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const createModuleAliases = require('./utils/createModuleAliases.js'); const SCSS_ROOT = Path.join(__dirname, 'client/scss/'); -const CLIENT_ROOT = Path.join(__dirname, 'client/'); -const CUSTOM_CLIENT_ROOT = Path.join(__dirname, 'site/custom/'); const customAliases = createModuleAliases(); @@ -40,8 +38,6 @@ module.exports = { }, resolve: { modules: [ - CUSTOM_CLIENT_ROOT, - CLIENT_ROOT, SCSS_ROOT, 'node_modules', __dirname,