diff --git a/README.md b/README.md index 99d940f9..950e3075 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,20 @@ # Spee.ch -spee.ch is a node-based web server that uses a lbrynet daemon to interact with the lbry network. +This repo packages the spee.ch server for use with spee.ch implementations. -##Installation +## Installation +visit [lbryio/www.spee.ch](https://github.com/lbryio/www.spee.ch) to get started -* start spee.ch - * clone this repo - * run `npm install` - * create your ` - speechConfig.js` file - * copy `speechConfig.js.example` and name it `speechConfig.js` - * replace the `null` values in the config file with the appropriate values for your environment - * build the app by running `npm run build-prod` - * to start the server, run `npm run start` -* visit [localhost:3000](http://localhost:3000) -* start spee.ch-sync (optional, recommended) - * Note: this tool will decode blocks from the `lbry` blockchain and update the Claim and Certificate tables in mysql with all the claims from the blockchain. This is not necessary if you only want to host and resolve content published through your version of spee.ch, but it is required if you want to retrieve and host other content from the lbry network. - * install and run this [`speech-sync`](https://github.com/billbitt/spee.ch-sync) tool +## Development / Structure +* the `server/` folder contains all of the server code + * `index.js` is the entry point for the server. It creates the [express app](https://expressjs.com/), requires the routes, syncs the database, and starts the server listening on the `PORT` designated in the config file. This file is the entry point for webpack to build the server bundle. + * the `server/routes` folder contains all of the routes for the express app + * the `server/models` folder contains all of the models which the app uses to interact with the `mysql` database. Note: this app uses the [sequelize](http://docs.sequelizejs.com/) orm. +* webpack + * During the build process, webpack creates a bundle for this project at `index.js`: ## Tests -* Spee.ch uses `mocha` with `chai` for testing. +* This package uses `mocha` with `chai` for testing. * To run all tests that do not require LBC, run `npm test -- --grep @usesLbc --invert` * To run all tests, including those that require LBC (like publishing), simply run `npm test` @@ -41,8 +36,8 @@ spee.ch is a node-based web server that uses a lbrynet daemon to interact with t * /api/claim/publish * example: `curl -F 'name=MyPictureName' -F 'file=@/path/to/myPicture.jpeg' https://spee.ch/api/claim/publish` * Parameters: - * `name` - * `file` (must be type .mp4, .jpeg, .jpg, .gif, or .png) + * `name` (required) + * `file` (required) (must be type .mp4, .jpeg, .jpg, .gif, or .png) * `nsfw` (optional) * `license` (optional) * `title` (optional) @@ -56,16 +51,20 @@ If you find a bug or experience a problem, please report your issue here on gith ## Contribute -### below is a guide to the issue tags in this repo -level 1 - issues with spee.ch that anyone with basic web development can handle, little-to-no experience with the spee.ch codebase is required. +### Below is a guide to the issue tags in this repo +####level 1 +Issues with spee.ch that anyone with basic web development can handle, little-to-no experience with the spee.ch codebase is required. -level 2 - issues with spee.ch familiarity with the spee.ch codebase is required, but little-to-no familiarity with the lbry daemon is necessary +#### level 2 +Issues with spee.ch familiarity with the spee.ch codebase is required, but little-to-no familiarity with the lbry daemon is necessary -level 3 - issues with spee.ch strong familiarity with the spee.ch code base and how the lbry daemon functions is required +#### level 3 +Issues with spee.ch strong 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 placed in this repo because of they are part of the spee.ch implementation +#### 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 placed in this repo because of they are part of the spee.ch implementation +### Stack The spee.ch stack is MySQL, Express.js, Node.js, React.js. Spee.ch runs lbrynet on its server, and spee.ch uses the lbrynet api to make requests such as `publish`, `create_channel`, and `get`. -spee.ch also runs a sync tool, which decodes the lbry blocks as they are mined and stores the claims in a mysql. It stores all claims in the `Claims` table, and all channel claims in the `Certificates` table. - +spee.ch also runs a sync tool, which decodes the `LBRY` blocks as they are mined and stores the claims in mysql. It stores all claims in the `Claims` table, and all channel claims in the `Certificates` table. diff --git a/config/mysqlConfig.js b/config/mysqlConfig.js index 0824528d..d4d33ac9 100644 --- a/config/mysqlConfig.js +++ b/config/mysqlConfig.js @@ -15,6 +15,6 @@ function mysql () { this.username = username; this.password = password; }; -}; +} module.exports = new mysql(); diff --git a/config/siteConfig.js b/config/siteConfig.js index 749ec6ea..af5e02f4 100644 --- a/config/siteConfig.js +++ b/config/siteConfig.js @@ -46,6 +46,6 @@ function SiteConfig () { this.customPages = customPages; this.routes = routes; }; -}; +} module.exports = new SiteConfig(); diff --git a/devConfig/sequelizeCliConfig.example.js b/devConfig/sequelizeCliConfig.example.js index 8b91eccb..e17d75a5 100644 --- a/devConfig/sequelizeCliConfig.example.js +++ b/devConfig/sequelizeCliConfig.example.js @@ -1,4 +1,4 @@ -module.exports = { +const sequelizeCliConfig = { development: { username: '', password: '', @@ -21,3 +21,5 @@ module.exports = { dialect : 'mysql', }, }; + +module.exports = sequelizeCliConfig;