Skip to content
Write your first novel with the world's most helpful writing tool.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Only run CircleCI tests on _dev Jan 23, 2019
api Fix /online checking when user's token expires and build latest May 7, 2019
build Get the landing page working on the new build toolchain Oct 1, 2018
compiled Precompile writingWorkshop.js and Cypress test the settings workshop Feb 9, 2019
config Build gzipped files in production build Apr 6, 2018
dist Fix /online checking when user's token expires and build latest May 7, 2019
legal Update images on press and legal pages Apr 17, 2019
migrations Work on workshop viewer on the composer page Mar 17, 2018
models Change Premium to Author and Gold to Bestseller Apr 16, 2019
passport Don't send passport errors to the front end Mar 28, 2018
press Update images on press and legal pages Apr 17, 2019
public Adjust CTA button width on mobile Apr 19, 2019
src Fix /online checking when user's token expires and build latest May 7, 2019
tests Fix tests, don't autoforward new novels to Novel Quickstart, update C… May 6, 2019
.babelrc Fix cypress tests Dec 12, 2018
.browserslistrc init Sep 29, 2018
.editorconfig Begin with vue-cli webpack template Sep 22, 2017
.eslintignore Begin with vue-cli webpack template Sep 22, 2017
.eslintrc.js Move email/password change to Account page, delete Settings page Mar 26, 2019
.gitignore Fix favicons Dec 12, 2018
.postcssrc.js Begin with vue-cli webpack template Sep 22, 2017
LICENSE.md Clean up license formatting Jul 12, 2018
README.md Fix cypress tests Dec 12, 2018
cypress.json Fix cypress tests Dec 12, 2018
db.js Sketch out app structure with vue-cli 3 Sep 29, 2018
jest.config.js Move email/password change to Account page, delete Settings page Mar 26, 2019
knexfile.js Sketch out app structure with vue-cli 3 Sep 29, 2018
package-lock.json Fix tests, don't autoforward new novels to Novel Quickstart, update C… May 6, 2019
package.json Fix tests, don't autoforward new novels to Novel Quickstart, update C… May 6, 2019
postcss.config.js Sketch out app structure with vue-cli 3 Sep 29, 2018
robots.txt Set up heroku stuff Oct 13, 2017
server.js Increase max cookie age to 30 days Dec 27, 2018
utilities.js Move jest tests to tests/jest/ and add a pretest file for utility com… Oct 16, 2018
vue.config.js Update favicons in PWA Apr 16, 2019

README.md

Edward the App

Write your first novel.

Cypress.io tests

Build Setup

# install dependencies
npm install

# serve client app with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# build and serve full-stack app at localhost:3000
npm run start
# OR
npm run server

# serve Node server app with auto reload at localhost:3000
npm run server-dev

# run Jest unit tests and API integration tests
npm run test

# run Cypress integration tests in the command line (headless)
npm run integration

# run Cypress integration tests in interactive mode
npm run cypress

Environment Variables

For local development, you'll need a root-level .env file with the following keys:

  • DATABASE_URL={connectionString}: A connection string for a local Postgres database. An empty database with a public schema and no tables should be sufficient; the ORM will create the tables and relations automatically.
  • DEBUG_DB={true|false}: When true, all database calls will be logged to the server console.
  • NO_SSL_DB={true|false}: When true, an SSL connection will not be used to connect to the Postgres database. This should be "true" for local development.
  • INSECURE_COOKIES={true|false}: When true, the "secure" parameter will not be set for auth cookies. This should be "true" for local development.
  • RECAPTCHA_SECRET={secret}: A valid Google Recaptcha site secret. If you're developing locally on /auth, you'll also need to set window.recaptchaSiteKey to a valid site key after page load. By default, this is set in auth.html.
  • SESSION_COOKIE_SECRET={secret}: A secret to use for encrypting and decrypting session cookies.
  • BASE_URL=127.0.0.1:8080: The base URL of the app.
  • SMTP_HOST={hostname}: A host for sending emails via SMTP. For development, you might consider using smtp.ethereal.email. NOTE: you can leave the SMTP attributes blank if you're not developing email or signup functionality.
  • SMTP_USER={username}: Your username for accessing the SMTP server.
  • SMTP_PASS={password}: Your password for accessing the SMTP server.
  • STRIPE_SECRET_KEY={key}: A secret key for use with the Stripe API. If you're developing locally on /auth, you'll also need to set window.stripePublicKey to a valid publishable key after page load. By default, this is set in auth.html.

Running the app locally

npm run dev serves the front-end site on port 8080. npm run server-dev runs the API server on port 3000. Run these in separate console windows, and API requests will automatically be proxied from port 8080 to port 3000.

The webpack dev server (port 8080) will automatically redirect from routes like /app and /auth to /app.html and /auth.html. On the express server (port 3000) the original routes work without a redirect.

For best results, it's recommended to visit 127.0.0.1 instead of localhost.

Tests

npm run test is self-contained. Do not try to run it while a local server is already running. Port 3000 must be available.

If tests fail on a fresh install of Edward, it's probably due to missing tables. Run the tests a second time.

The Cypress tests require npm run server to be running in order to function. I recommend that you run this (and npm run cypress) in the Powershell console or Linux Bash, not in the Git Bash.

You can’t perform that action at this time.