Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

## Getting Started

### Installation Script

An automated version of this installation process is available to you. To launch it, run './install' from the root directory.

### Install Dependencies

From within the root directory:
Expand Down Expand Up @@ -83,49 +87,65 @@ Import all decks in document/decks/ directory, be careful, it still imports if d

### Tasks

#### build
#### Build

```sh
$ npm run build
```
Builds the entire application to `dist/`. See `package.json` to set environment variables.

#### server-prod
#### Server-prod
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, why do this here?

Copy link
Collaborator Author

@nligon nligon Jun 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style consistency. Many of the headers in this document began with capital letters, some did not. Corrected for uniformity.


```sh
$ npm run server-prod
```
Starts the server in production mode. See `package.json` to set environment variables.

#### watch-server
#### Watch-server

```sh
$ npm run watch-server
```
Builds and watches server files for changes. Builds to `dev/`.

#### watch-client
#### Watch-client

```sh
$ npm run watch-client
```
Builds and watches client files for changes. Builds to `dev/`.

#### run server (development)
### Load Sample Data

From within root directory, import all decks in 'document/decks/':

```sh
npm run import:all
```

Optionally, import only one deck at a time. Note: Running both import commands, or running the same import command more than once, will result in repeat document-entries.

```sh
npm run import math.md
```

Deck files MUST be within documentation/decks/ directory for data to import successfully.

#### Run server (development)

```sh
$ npm run server-dev
```
Starts the server in development mode (runs from `localhost:3000`).

#### test
#### Test

```sh
$ npm run test
```
> **Runs unit tests and coverage report. Ensure `mongod` and the application is built and the server is running.**

#### coverage
#### cCverage

```sh
$ npm run coverage
Expand Down
16 changes: 16 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#This script installs dependencies and imports data. Instructions for manually handling this process can be found in '/README.md'.

echo "Installing production and development dependencies..."
npm install

echo "Building production server..."
npm run build

echo "Importing all decks..."
npm run import:all

echo "Running npm test..."
npm run test

echo "Done! Please see npm test results to resolve installation errors. To build and run development, production, or watch servers, type 'npm run server-dev', 'npm run server-prod', or 'npm run watch-server', respectively."
2 changes: 1 addition & 1 deletion src/client/components/CreateAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CreateAccount extends React.Component {
}

handleError(err) {
Materialize.toast(`Failed to create account: ${err.responseJSON.message}`, 4000);
console.error(err);
}

createAccount(event) {
Expand Down
3 changes: 2 additions & 1 deletion src/client/components/SignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class SignIn extends React.Component {

handleError(err) {
// TODO: don't use global
Materialize.toast(err.responseJSON.message, 5000);
// Materialize.toast(err.responseJSON.message, 5000);
console.error(err);
}

signIn(e) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/DeckProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getRandom = {
},
};

// given a deck id, retrieve a card
// given a deck id and a user id, retrieve a card
const getCard = (deckId, userId) => (
// get the deck
queryDb().getDeck(deckId).then(deck => {
Expand Down