Coder Social home page Coder Social logo

prariehill / edward-the-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isaaclyman/edward-the-app

0.0 1.0 0.0 43.29 MB

Write your first novel.

Home Page: http://edwardtheapp.com

License: Other

JavaScript 57.82% HTML 8.13% Vue 32.18% CSS 1.87%

edward-the-app's Introduction

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 Ava 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.

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 both npm run dev and npm run server-dev to be running in order to function. I recommend that you run these (and npm run integration) in the Powershell console or Linux Bash, not in the Git Bash.

edward-the-app's People

Contributors

isaaclyman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.