Code Monkey home page Code Monkey logo

pup's Introduction

Pup

The Ultimate Boilerplate for Products.

Read the Documentation

CircleCI

Want to work side-by-side with an experienced, trusted mentor? Check out Clever Beagle.


NOTE: The following represents example README.md content for your product. The information below should be customized for your product.


  1. Infrastructure
  2. Settings & Configuration
  3. Dependencies
  4. Commands
  5. Git & Branching
  6. Testing
  7. Releasing

1. Infrastructure

The following explains how the production and staging environments for this app are managed and configured.

Where is DNS configured for this app?

DNS for the app is configured and managed via DNSimple.

Where does the database live?

The database is hosted via Compose. A single deployment cleverbeagle exists with a pup database for the production environment and a pup-staging database for the staging environment. Additionally, the "Oplog Access" add-on has been enabled to improve the performance of Meteor in production.

Where does this app live?

The app is deployed to https://galaxy.meteor.com. It has two versions:

  1. staging which is accessed via https://pup-staging.cleverbeagle.com and is used to test a release in a production environment before being deployed to production.
  2. production which is accessed via https://pup.cleverbeagle.com and is the live, customer-facing server.

Deployment to these domains is controlled via NPM scripts defined in the package.json file at the root of the project, npm run staging and npm run production.

How does the SSL work?

SSL certificates are generated via the UI at https://galaxy.meteor.com/cleverbeagle. Each application's certificates are managed via the app's settings page:

SSL certificates are auto-generated by Galaxy using the Let's Encrypt Certificate Authority and shouldn't require any maintenance. If maintenance or edits are required, locate the "Domains & Encryption" section of the app's settings page (linked above) and click on the domain you'd like to manage.

2. Settings & Configuration

Settings for the app are defined in three files at the root of the project:

  • settings-development.json contains the settings specific to the development environment (i.e., when running the app on your computer).
  • settings-staging.json contains the settings specific to the staging environmnet (i.e., when deploying the app to pup-staging.cleverbeagle.com).
  • settings-production.json contains the settings specific to the production environment (i.e., when deploying the app to pup.cleverbeagle.com).

Each settings file should only be used in conjunction with the environment it's intended for. Further, each settings file's contents should be restricted to that specific environment (i.e., don't use an API key intended for the production environment in development and vice-versa—only break this rule when a given service's API key provisioning makes this prohibitive).

How do I load the settings file?

Settings files are automatically loaded for you as part of the NPM commands listed below. It's best to rely on these instead of doing it manually.

How do I access the accounts used in the settings files?

If you need to obtain an API key, password, or other secret information, you can find this in the Clever Beagle 1Password Vault. If you do not have access to this, send a direct message to @rglover in Slack or email him [email protected].

3. Dependencies

Dependencies for pup.cleverbeagle.com are installed via NPM and Meteor's Atmosphere package system. Atmosphere dependencies are installed automatically on app startup. NPM dependencies can be installed with the following command before the first startup of the application:

meteor npm install

4. Commands

The following NPM commands can be used when working on the app.

dev

$ npm run dev

Runs the app development server at http://localhost:3000 and loads the settings-development.json file.

staging

$ npm run staging

Deploys the app to the staging server at https://pup-staging.cleverbeagle.com and loads the settings-staging.json file.

production

$ npm run production

Deploys the app to the production server at https://pup.cleverbeagle.com and loads the settings-production.json file.

test

$ npm run test

Runs all Jest test suites in the app once and then quits.

test-watch

$ npm run test-watch

Runs all Jest test suites in the app in watch mode and reruns whenever a test or file in the app changes.

test-e2e

$ npm run test-e2e

Runs all end-to-end tests using TestCafe once and then quits.

5. Git & Branching

Read the "Managing branches in Git" tutorial in the Pup docs

6. Testing

There are two types of testing performed in relation to the app: manual and automated. Manual testing is any testing where you're manually clicking around the app yourself to test things out. Automated testing is any where you're relying on the automated test suites in the app to test things out.

Test Users

When you start the app for the first time in development and staging mode, we create a set of test users to use when testing different permissions:

Email Address Password Roles Notes
[email protected] password admin Full access to the application.
[email protected] password user Access to user-only features.
[email protected] password user Access to user-only features.
[email protected] password user Access to user-only features.
[email protected] password user Access to user-only features.
[email protected] password user Access to user-only features.

Test Data

When you start the app for the first time, we create test data for all collections in the application. If you ever want to "start over" with fresh data in your development environment, stop the app and in your terminal run:

meteor reset

Upon restarting the app, the databased will be reseeded with the default test data.

FAIR WARNING: This command will PERMANENTLY ERASE (😈) any data that you've added to the app manually. If you've added something that you will need/want after the reset, make sure to back it up first.

Writing Tests

Read the "Writing and running automated tests" tutorial in the Pup docs

7. Releasing

Releasing the app to both the staging and production environment should be performed primarily via continuous integration. This is configured via Circle CI and the .circleci/config.yml file at the root of the app.

If an emergency deployment is required, the npm run staging and npm run production commands detailed in the "NPM Commands" section above can be utilized.

Performing a release

In order for a release to be pushed to either the staging or production environment via continuous integration, code must be pushed to:

  • The master branch when releasing new code into production.
  • The staging branch when releasing new code to the staging server.

When code is pushed, the continuous integration service should pick this change up and automatically deploy per the rules in the .circleci/config.yml file in the app.

Tagging releases on master

When code has been tested and confirmed ready for production, it's important to tag the release in Git so that it's clear when and where certain code is introduced. In order to tag a release, it's recommended that the Git Extras library be used, specifically, the git release <Semantic Version Number> command be utilized.

This pushed the code to the master branch while also creating a tag locally and remotely, all simultaneously.

For more information on Semantic Versioning, visit the official documentation site.

pup's People

Contributors

cleverbeagle avatar fredmaiaarantes avatar merlinstardust avatar ninjapixel avatar pilararr avatar rglover avatar rglovercb avatar toinevk avatar zodern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pup's Issues

OAuth Callback

I noted that currently for OAuth the callback function (in OAuthLoginButton) only sends a message during failure and does nothing during success (e.g. push to /documents). Is that intentional or am I missing something obvious? I would've thought it would be desirable to have the OAuth logins/signup consistently show a message / push to /documents as well.

Thanks, I appreciate the insight.

Add better handling for schema errors in Methods

Took me ages to finally track this down. If collection2 denies an insert/update based on schema validation, nothing happens at all on the client, and nothing is printed in the server console.

This can be resolved by changing the best practice method code to listen for the error from collection2 as per its documentation

try {
  const documentId = doc._id;
  Documents.update(documentId, { $set: doc }, (error) => {
    if (error) throw new Meteor.Error('500', error.message);
  });
  return documentId; // Return _id so we can redirect to document after update.
} catch (exception) {
  throw new Meteor.Error('500', exception);
}

I think the boilerplate code should be updated accordingly?

react-bootstrap Form not rendering properly.

If I import the necessary react-bootstrap components and replace the App.js/App function with:

const App = props => (
  <Form inline>
    <FormGroup controlId="formInlineName">
      <ControlLabel>Name</ControlLabel>
      {' '}
      <FormControl type="text" placeholder="Jane Doe" />
    </FormGroup>
    {' '}
    <FormGroup controlId="formInlineEmail">
      <ControlLabel>Email</ControlLabel>
      {' '}
      <FormControl type="email" placeholder="[email protected]" />
    </FormGroup>
    {' '}
    <Button type="submit">
      Send invitation
    </Button>
  </Form>
);

The form doesn't render per the react-bootstrap component docs. See (https://react-bootstrap.github.io/components.html#forms-inline). Specifically, the ControlLabel components do not render inline.

Add transactional email support

This is an oversight. We have configuration for the app's SMTP url, but in order to actually send email—independent of the accounts emails—you have to install the email package (or another provider's package) on your own. Ideally, we should configure some stuff like a welcome email so it's clear how to put it to use.

Mocks library

There's a lot of internal code for Meteor that will need mocking. There are quite a few third-party solutions to this already, but they're a bit piecemeal. It'd be best to sample from these existing implementations and combine them into something that we can manage and expand under Pup.

Need mocking for:

  • Meteor internals (e.g., Meteor.users, Accounts, etc) <-- the "big one"
  • Mocking MongoDB collections
  • NPM packages used in Pup
  • Example third-party request (Github?) library

Required object in pages retrieving from database throw a warning

Currently, when you try to access a document by typing random id (localhost:3000/documents/sdqlifhqsdhlfh/edit) for example, you will get this warning :

printer.js:170 Warning: Failed prop type: The prop doc is marked as required in EditDocument, but its value is undefined.
in EditDocument (created by ReactMeteorDataComponent)
in ReactMeteorDataComponent (created by Route)
in Route (created by Authenticated)
in Authenticated (created by App)
in Switch (created by App)
in div (created by Grid)
in Grid (created by App)
in div (created by App)
in Router (created by BrowserRouter)
in BrowserRouter (created by App)
in App (created by ReactMeteorDataComponent)
in ReactMeteorDataComponent

(Removing the required type of the proptypes and setting a default value would fix it ? is it the cleanest way ?)

Make logout happen on logout page

Right now the logout page is just a stylized way to promote something to users on logout. It'd be neat if this page actually performed the logout event on componentDidMount(). This way we could redirect to that page (without having it do so in the <Authenticated /> component) directly while also getting the desired outcome of logging out.

Unit tests

Add unit tests for Pup features (where it makes sense) and ensure we have clear documentation for how these work and how developers can expand upon them.

Integration tests

Add integration tests for Pup features (where it makes sense) and ensure we have clear documentation for how these work and how developers can expand upon them. It may be helpful to include an example of a third-party module (e.g., GitHub API) being integrated into some code and show how to mock it, etc.

Pull actual code from GitHub in docs

To ensure that the documentation stays in sync with the repo, it'd be nice if we could just specify a file path on GitHub and load the raw content of the file into the docs. This way we don't have to fight with manually updating snippets/things getting out of date.

npm run has some problem

I complete following the "Getting Started", but when I get to npm start, I saw the following information.

 npm start

> pup@ start /Users/simon/workspace/MyProject/MakerLab
> meteor --settings settings-development.json

[[[[[ ~/workspace/MyProject/MakerLab ]]]]]    

=> Started proxy.                             
=> Started MongoDB.                           
=> Errors prevented startup:                  
   
   While loading package fourseven:[email protected]:
   error: Command failed: /Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm rebuild --update-binary
   Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/darwin-x64-46_binding.node": 
   
   socket hang up
   
   Hint: If github.com is not accessible in your location
   try setting a proxy via HTTP_PROXY, e.g. 
   
   export HTTP_PROXY=http://example.com:1234
   
   or configure npm proxy via
   
   npm config set proxy http://example.com:8080
   gyp info it worked if it ends with ok
   gyp verb cli [ '/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node',
   gyp verb cli   '/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js',
   gyp verb cli   'rebuild',
   gyp verb cli   '--verbose',
   gyp verb cli   '--libsass_ext=',
   gyp verb cli   '--libsass_cflags=',
   gyp verb cli   '--libsass_ldflags=',
   gyp verb cli   '--libsass_library=' ]
   gyp info using [email protected]
   gyp info using [email protected] | darwin | x64
   gyp verb command rebuild []
   gyp verb command clean []
   gyp verb clean removing "build" directory
   gyp verb command configure []
   gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
   gyp verb download using dist-url https://nodejs.org/dist
   gyp verb check python checking for Python executable "python2" in the PATH
   gyp ERR! UNCAUGHT EXCEPTION 
   gyp ERR! stack TypeError: Property description must be an object: Error: not found: python2
   gyp ERR! stack     at getNotFoundError
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:13:12)
   gyp ERR! stack     at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:19)
   gyp ERR! stack     at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
   gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
   gyp ERR! stack     at Function.defineProperty (native)
   gyp ERR! stack     at EventEmitter.<anonymous>
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:185:14)
   gyp ERR! stack     at EventEmitter.<anonymous>
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:281:23)
   gyp ERR! stack     at Object.<anonymous>
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/lib/configure.js:389:18)
   gyp ERR! stack     at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:16)
   gyp ERR! stack     at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
   gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
   gyp ERR! System Darwin 16.6.0
   gyp ERR! command "/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node"
   "/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose"
   "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
   gyp ERR! cwd /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/.temp-1rbbfhm/node_modules/node-sass
   gyp ERR! node -v v4.8.3
   gyp ERR! node-gyp -v v3.6.2
   gyp ERR! This is a bug in `node-gyp`.
   gyp ERR! Try to update node-gyp and file an Issue if it does not help:
   gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
   Build failed with error code: 7
   npm ERR! code ELIFECYCLE
   npm ERR! errno 1
   npm ERR! [email protected] postinstall: `node scripts/build.js`
   npm ERR! Exit status 1
   npm ERR! 
   npm ERR! Failed at the [email protected] postinstall script.
   npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
   
   npm ERR! A complete log of this run can be found in:
   npm ERR!     /Users/simon/.npm/_logs/2017-07-12T14_29_12_877Z-debug.log
   Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/darwin-x64-46_binding.node": 
   
   socket hang up
   
   Hint: If github.com is not accessible in your location
   try setting a proxy via HTTP_PROXY, e.g. 
   
   export HTTP_PROXY=http://example.com:1234
   
   or configure npm proxy via
   
   npm config set proxy http://example.com:8080
   gyp info it worked if it ends with ok
   gyp verb cli [ '/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node',
   gyp verb cli   '/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js',
   gyp verb cli   'rebuild',
   gyp verb cli   '--verbose',
   gyp verb cli   '--libsass_ext=',
   gyp verb cli   '--libsass_cflags=',
   gyp verb cli   '--libsass_ldflags=',
   gyp verb cli   '--libsass_library=' ]
   gyp info using [email protected]
   gyp info using [email protected] | darwin | x64
   gyp verb command rebuild []
   gyp verb command clean []
   gyp verb clean removing "build" directory
   gyp verb command configure []
   gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
   gyp verb download using dist-url https://nodejs.org/dist
   gyp verb check python checking for Python executable "python2" in the PATH
   gyp ERR! UNCAUGHT EXCEPTION 
   gyp ERR! stack TypeError: Property description must be an object: Error: not found: python2
   gyp ERR! stack     at getNotFoundError
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:13:12)
   gyp ERR! stack     at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:19)
   gyp ERR! stack     at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
   gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
   gyp ERR! stack     at Function.defineProperty (native)
   gyp ERR! stack     at EventEmitter.<anonymous>
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:185:14)
   gyp ERR! stack     at EventEmitter.<anonymous>
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:281:23)
   gyp ERR! stack     at Object.<anonymous>
   (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/lib/configure.js:389:18)
   gyp ERR! stack     at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:16)
   gyp ERR! stack     at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
   gyp ERR! stack     at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
   gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
   gyp ERR! System Darwin 16.6.0
   gyp ERR! command "/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node"
   "/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose"
   "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
   gyp ERR! cwd /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/.temp-1rbbfhm/node_modules/node-sass
   gyp ERR! node -v v4.8.3
   gyp ERR! node-gyp -v v3.6.2
   gyp ERR! This is a bug in `node-gyp`.
   gyp ERR! Try to update node-gyp and file an Issue if it does not help:
   gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
   Build failed with error code: 7
   npm ERR! code ELIFECYCLE
   npm ERR! errno 1
   npm ERR! [email protected] postinstall: `node scripts/build.js`
   npm ERR! Exit status 1
   npm ERR! 
   npm ERR! Failed at the [email protected] postinstall script.
   npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
   
   npm ERR! A complete log of this run can be found in:
   npm ERR!     /Users/simon/.npm/_logs/2017-07-12T14_29_12_877Z-debug.log
   
   
=> Your application has errors. Waiting for file change.
                                              

Fix email verification being displayed for OAuth logins and re-verify new email address when updating in profile

I noticed that when you change the email in the profile page, it doesn't prompt you to verify that email since it only changes the address field and the verified stays true.

Also when you log in with Facebook or Google. It prompts you send a verification email to an empty field. I'm not sure what would be the way around that. If assuming the email if already verified by Facebook or re check the verification.

Throw Exception from actions always return same error code

Hi, when creating an action within a meteor method, if you throw an Meteor.Error with a custom code, when you catch from the client, the error code is always 500 because the catch on the method always return 500

} catch((exception) => {
  throw new Meteor.Error('500', exception);
});

I changed it on my code, but I though it was a good idea to adjust it here as well

Thanks

Need help with checkboxes

Thank you so much for open sourcing this boilerplate. I'm really enjoying it and am learning a lot. I'm fairly new when it comes to React and Meteor so my question may be very basic.

How would you recommend adding a <Checkbox> to DocumentEditor.js for example?

I have a checkbox "working" with Meteor, but relying on state for the checkbox leaves the view out of sync when I refresh the page. ref= doesn't seem to work either as it does for other inputs on the form.

Thank you kindly!

Acceptance tests

Add acceptance tests for Pup features (where it makes sense) and ensure we have clear documentation for how these work and how developers can expand upon them. This will rely heavily on Enzyme.

Fix @cleverbeagle deps breaking startup

Hi there!

I'm trying to install pup but I'm getting the following error:

npm ERR! path /Users/willy/Coding/learning/tutorials/pup/node_modules/.staging/@cleverbeagle/seeder-3f2800ee/node_modules/abab
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/willy/Coding/learning/tutorials/pup/node_modules/.staging/@cleverbeagle/seeder-3f2800ee/node_modules/abab' -> '/Users/willy/Coding/learning/tutorials/pup/node_modules/.staging/abab-d5a1be50'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/willy/.npm/_logs/2017-08-03T10_12_21_407Z-debug.log

Are there any issues for NPM 5.3.0 and Node v8.2.1 which I'm using? My operating system ist OSX Sierra 10.12.6

NOTE:
Afterremoving cleverbeagle/seeder & cleverbeagle/dates from the package.json, the installation completed.

There might be an issue with these packages and my configuration.

When I'm trying to install these packages manually, I'm getting these log files for cleverbeagle/dates and cleverbeagle/seeder

2017-08-03T10_21_01_633Z-debug.txt
2017-08-03T10_23_32_196Z-debug.txt

PropTypes warning

An issue is being printed to the console that reads Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.. This error is coming from the react-bootstrap package that's a dependency of Pup.

The authors of this package will need to fix this error and release an update. Once they do, we'll upgrade and this error should be removed.

Update actions to rely on a single action.reject with throw messages for individual methods

In your docs says, when executing an action

If a piece of code fails, it can pass its error to the action.reject() method, which stops the JavaScript Promise and sends the error back to the client. If an action is successful, it can call to action.resolve() to resolve the JavaScript Promise and send a response back to the client.

Is that true? Because as per my understanding, JS will execute all remaining code, if any, before actually returning the promise value.

So if I have a reject and then I call another action, it will run the 2nd action even if the 1st one has been rejected

const action1 = ({ ... }) => {
  try {
    throw new Meteor.Error('500', 'Error msg');
  } catch (exception) {
    action.reject(`[handler.action1] ${exception}`);
  }
};

const handler = ({ ... }, promise) => {
  try {
    action = promise;

    action1(...);
    action2(...); //this will be executed 
    action.resolve();
  } catch (exception) {
    action.reject(`[handler] ${exception}`);
  }
};

What would be the best way to prevent further execution after a promise has been rejected?

Thanks

How add fix size to a Container ?

I'm trying to add a google-maps-react to pup, using [https://github.com/istarkov/google-map-react] (Test outside Pup all goes ok, but inside Pup the map is no showed, I think because the "container" has not a fix size (and maps needs his parent have a fix size, or maps goes 0x size)

I try add a SimpleMap.scss file like this to component:

/* CSS declarations go here */
.SimpleMap {
  width: 800px;
  max-width: 100%;
  height: 500px;
}

But without results.... Another idea, thanks ?

Full code of component SimpleMap.js:

import { Meteor } from 'meteor/meteor';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { render } from 'react-dom';
import GoogleMapReact from 'google-map-react';
import { createContainer } from 'meteor/react-meteor-data';
import Markers from '../../../api/Markers/Markers';
import Loading from '../../components/Loading/Loading';

// Read from settings.development.json.
const APIKEY = Meteor.settings.public.APIKEY;

// ES5 users
function _onClick(obj){
  console.log(obj.x, obj.y, obj.lat, obj.lng);
  //console.log(Object.getOwnPropertyNames(obj));
}

const AnyReactComponent = ({ text }) => (
  <div  style={{
    position: 'relative', color: 'white', background: 'red',
    height: 40, width: 60, top: -20, left: -30,
  }}>
  {text}
  </div>
);

const GoogleMapConfig = {
	key: APIKEY,
  language: 'es'
};

const SimpleMap = ({  loading, markers, defaultProps, match, history }) => (!loading ? (
      <div className="SimpleMap">
        <GoogleMapReact
          bootstrapURLKeys={GoogleMapConfig}
          onClick={_onClick}
          defaultCenter={defaultProps.center}
          defaultZoom={defaultProps.zoom}
        >
          <AnyReactComponent
            lat={40.436374}
            lng={-3.694358}
            text={'Another anodyne point over map'}
          />
        </GoogleMapReact>
      </div>
    ) : <Loading />);

SimpleMap.propTypes = {
  loading: PropTypes.bool.isRequired,
  markers: PropTypes.arrayOf(PropTypes.object).isRequired,
  match: PropTypes.object.isRequired,
  history: PropTypes.object.isRequired,
  defaultProps: PropTypes.object.isRequired,
};

export default createContainer(() => {
  const subscription = Meteor.subscribe('markers');
  return {
    loading: !subscription.ready(),
    markers: Markers.find().fetch(),
    defaultProps: {
      center: {lat: 59.95, lng: 30.33},
      zoom: 8},
  };
}, SimpleMap);

Error when I build for production: TypeError: Cannot read property 'slice' of null

I try to build the boilerplate for probuction on a Ubuntu GNU/Linux 16.04 machine. To do that I used these commands:

git clone https://github.com/cleverbeagle/pup.git pup2
cd pup2
npm install
meteor build ~/builds
cp settings-development.json  ~/builds/settings.json

Afterwards I went to folder ~/builds and I did typed these commands:

cd ~/builds
tar -xvf pup2.tar.gz
cd bundle
cd programs/server
npm install
cd ../../
export MONGO_URL="mongodb://localhost:27017/tesedb"; 
export  ROOT_URL="192.168.30.137:3821"; 
export PORT=3821; 
export METEOR_SETTINGS="$(cat ../settings.json)"
node main.js

The last command (node main.js) returns the following error:

/home/pcmagas/builds/bundle/programs/server/boot.js:391
}).run();
^

TypeError: Cannot read property 'slice' of null
at packages/meteor.js:1221:19
at packages/meteor.js:1233:4
at packages/meteor.js:1380:3
at /home/pcmagas/builds/bundle/programs/server/boot.js:338:34
at Array.forEach (native)
at Function..each..forEach (/home/pcmagas/builds/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
at /home/pcmagas/builds/bundle/programs/server/boot.js:158:5
at /home/pcmagas/builds/bundle/programs/server/boot.js:387:5
at Function.run (/home/pcmagas/builds/bundle/programs/server/profile.js:510:12)
at /home/pcmagas/builds/bundle/programs/server/boot.js:386:11

deployment issue

trying to deploy Pup to heroku and i got this error:

2017-06-21T06:12:21.023519+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node $NODEJS_PARAMS .meteor/heroku_build/app/main.js`
2017-06-21T06:12:24.740982+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:280
2017-06-21T06:12:24.741010+00:00 app[web.1]: 						throw(ex);
2017-06-21T06:12:24.741023+00:00 app[web.1]: 						^
2017-06-21T06:12:24.741025+00:00 app[web.1]: 
2017-06-21T06:12:24.741032+00:00 app[web.1]: TypeError: Cannot read property 'OAuth' of undefined
2017-06-21T06:12:24.741039+00:00 app[web.1]:     at meteorInstall.imports.startup.server.accounts.oauth.js (imports/startup/server/accounts/oauth.js:4:23)
2017-06-21T06:12:24.741040+00:00 app[web.1]:     at fileEvaluate (packages/modules-runtime.js:333:9)
2017-06-21T06:12:24.741040+00:00 app[web.1]:     at require (packages/modules-runtime.js:228:16)
2017-06-21T06:12:24.741041+00:00 app[web.1]:     at meteorInstall.imports.startup.server.accounts.index.js (imports/startup/server/accounts/index.js:1:14)
2017-06-21T06:12:24.741042+00:00 app[web.1]:     at fileEvaluate (packages/modules-runtime.js:333:9)
2017-06-21T06:12:24.741042+00:00 app[web.1]:     at require (packages/modules-runtime.js:228:16)
2017-06-21T06:12:24.741049+00:00 app[web.1]:     at meteorInstall.imports.startup.server.index.js (imports/startup/server/index.js:1:14)
2017-06-21T06:12:24.741050+00:00 app[web.1]:     at fileEvaluate (packages/modules-runtime.js:333:9)
2017-06-21T06:12:24.741050+00:00 app[web.1]:     at require (packages/modules-runtime.js:228:16)
2017-06-21T06:12:24.741051+00:00 app[web.1]:     at meteorInstall.server.main.js (server/main.js:1:14)
2017-06-21T06:12:24.850781+00:00 heroku[web.1]: State changed from starting to crashed
2017-06-21T06:12:24.843187+00:00 heroku[web.1]: Process exited with status 1

even though i have set my settings-production.json file it is running into this ugly error. what else is causing this issue?

Building for mobile got 'Starting app' till the infinite

(UPDATE--UPDATE)

PUP for Mobile

Note: Previously, I had install: https://dl.google.com/android/repository/tools_r25.2.3-linux.zip android sdk tools, to avoid this issue (linux and mac)
meteor/meteor#8464

SOLUTION FOR development/debug MODE

meteor build ../out_apk --debug --verbose --server=192.168.43.20:3000
(note: change 192.168.43.20 by your local ip)

Then copy into mobile and can execute it. All Ok.

But if I try without --debug, then I can build apk, but mobile doesn't install it (says "application damaged". I have the option 'install from unknows origins" activate into my android phone )

Maybe the problem (I don't know how test that) is when run command: meteor run android-device ..... This meteor command try to install the apk (with not debug option, so this apk is NOT SIGNED) and mobile lock installation.....

SOLUTION FOR production MODE

You MUST use 'meteor build' command (not use 'meteor run android-device') and you must sign your app before upload to the mobile terminal. (See https://guide.meteor.com/mobile.html#submitting-android)

Example to got a signed apk:
( Note: The id of apk is com.meteor.examples.pup, that must be set into file mobile-config.js)

meteor build ../out_apk  --verbose   --server=192.168.43.20:3000
(note: change 192.168.43.20 by your local ip)

keytool -genkey -alias com.meteor.examples.pup -keyalg RSA -keysize 2048 -validity 10000

cd ../out_apk

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 release-unsigned.apk com.meteor.examples.pup

Finally, to see SHA1 key (and others keys from signed apk, you need it to configure google oauth services)

keytool -exportcert  -list -v

Example of file 'mobile-config.js'

App.info({
  author: 'cleverbeagle',
  description: 'Testing mobile PUP',
  email: '[email protected]',
  id: 'com.meteor.examples.pup',
  name: 'test-pup',
  website: 'http://cleverbeagle.com/pup/v1',
  version: '1.0.0',
});

Note:
I think that maybe this is not a issue, but would be good add a 'note',addendum, or tutorial (or add to original tutorial) for users to try compile PUP for mobile.

(END UPDATE--END UPDATE)

NOTE: Below this note is described the older issue when I try to compile and install PUP for mobile. Above this note, you have the correct way to compile and install PUP for mobile.

Trying to compile PUP for android device will got 'Starting app', but nothing more, nothing happens with mobile.
NOTE: Compiling basic Meteor example ( https://github.com/meteor/simple-todos) for mobile is all OK (so I think enviroment is ok for mobile compilation)

Note: I had use: https://dl.google.com/android/repository/tools_r25.2.3-linux.zip android sdk tools, to avoid this issue (linux and mac)
meteor/meteor#8464

echo $ANDROID_HOME
/home/juanma/Android/Sdk

java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
(Note: Try it also with Oracle SDK, same result :( )

ifconfig wlp4s0
wlp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.20 netmask 255.255.255.0 broadcast 192.168.43.255
inet6 fe80::4d22:82cd:365c:ab63 prefixlen 64 scopeid 0x20
ether ac:b5:7d:b2:ca:61 txqueuelen 1000 (Ethernet)
RX packets 144317 bytes 199849276 (190.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 50004 bytes 5046455 (4.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/juanma/Android/Sdk/tools:/home/juanma/Android/Sdk/platform-tools

cat mobile-config.js
App.info({
author: 'cleverbeagle',
description: 'Testing mobile PUP',
email: '[email protected]',
id: 'com.meteor.examples.pup',
name: 'test-pup',
website: 'http://cleverbeagle.com/pup/v1',
version: '1.0.0',
});

meteor add-platform android
Subproject Path: CordovaLib
android: added platform

meteor run android-device --settings settings-development.json --mobile-server=192.168.43.20

=> Started proxy.
%% support for subdirectories is deprecated and will be removed in Cordova@7
Subproject Path: CordovaLibns [==== ] 14% 134.6s
Subproject Path: CordovaLibns [=============== ] 57% 20.5s

WARNING: It looks like you are using OAuth2 login in your app. Meteor's OAuth2 implementation does not currently work with mobile apps in local
development mode, except in the iOS simulator. You can run the iOS simulator with 'meteor run ios'. For additional workarounds, see
https://github.com/meteor/meteor/wiki/OAuth-for-mobile-Meteor-clients.

WARNING: You are testing your app on a remote device. For the mobile app to be able to connect to the local server, make sure your device is on the
same network, and that the network configuration allows clients to talk to each other (no client isolation).

Starting your app (Till infinite......... :( )

Here the same, but added --verbose option:
output_log_pup_verbose.txt

Move getUserName method into its own file

This is a lil' function used in <App /> to determine whether we're rendering a name object with name.first and name.last or a string (password-based users vs. OAuth).

documents.insert causes ViewDocument to render without new document ID

The console throws an error because doc is a required prop of ViewDocument and the return statement setup causes ViewDocument to render before the new ID is truly returned. There is a subsequent render after the erroneous one that passing in the doc prop so the app still functions.

I am not enough of an expert to know if what I did is the correct fix, but here is it:

Error in console:

Warning: Failed prop type: The prop `doc` is marked as required in `ViewDocument`, but its value is `undefined`.

Problematic code found in imports/api/Documents/methods.js

'documents.insert': function documentsInsert(doc) {
    check(doc, {
        title: String,
        body: String,
    });

    try {
        return Documents.insert({owner: this.userId, ...doc});
    } catch (exception) {
        throw new Meteor.Error('500', exception);
    }
},

Changing the return statement to this alleviated the issue:

const documentId = Documents.insert({owner: this.userId, ...doc});
return documentId;

Import and document usage of onCreateUser hook (in /imports/startup/server/accounts/on-create-user.js)

Hey there,

Just moving some of my code from my prototype to this as the base (your login/signup is much nicer than the thing I built!) and I noticed that by default the on-user-create.js file isn't imported anywhere in the base template meaning the code is never actually executed. Not sure if this is meant or not but I didn't see it documented anywhere so I figured I'd mention it.

Maybe I missed it, but hopefully, this helps anyone in the future that puts stuff in there not realising.

Add support for email verification

This comes up far too often and is common in nearly all products. Need to implement a simple verification flow and display a message to users in the app until they verify.

Why is document methods located oustide of the server folder ?

Since the methods of the documents are imported on the startup of the server :

import '../../api/Documents/methods';

Seems clearer to me if the methods are located in the server folder since we don't import this file on client anymore. (Like we used to do with base)

found a very weird bug when modifying pup, how do i diagnose what is wrong?

so i have been trying to modify pup to merge the New Document and Edit document pages into basically one Upsert document page (since the editor is the exact same i figured it would be easy) but it is very strange: when I merge them (this potentially supplying a doc that is null) the fields have their defaultValue populated correctly but they arent displaying in the actual browser. I have googled around this problem and apparently it could potentially be due to some sort of javascript clearing the field without my knowledge? how can I diagnose what is going on here?

sorry for the very open ended question, hoping someone familiar with meteor is able to point me in the right direction.

For mobile, must add whitelist to show puppy image and load css from external sources

If you try build for mobile don't forget add whitelist to load external sources need it by Pup.

Example of mobile-config.js:

App.info({
  author: 'cleverbeagle',
  description: 'Testing mobile PUP',
  email: '[email protected]',
  id: 'com.meteor.examples.test_pup_heroku',
  name: 'test-pup',
  website: 'http://cleverbeagle.com/pup/v1',
  version: '1.0.0',
});
// Target Android 4.2 version
App.setPreference('android-targetSdkVersion', '17');
// Whitelist enable access  to img file from amazon
App.accessRule('https://s3-us-west-2.amazonaws.com');
// Whitelist enable access to css file from bootstrapcdn
App.accessRule('https://maxcdn.bootstrapcdn.com');

Suppose, you have mondoDB into mlab server and your meteor server app into heroku.
The build command example will be(debug mode):

MONGO_URL=mongodb://user:[email protected]:35532/meteor meteor build ../out_apk --debug --verbose --server=https://test-pup.herokuapp.com

That command will create a ../out_apk/debug.apk file to install into our mobile phone.

NOTE: change "user" and "password" with your credentials ;) and your target version for Android.

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.