Skip to content

A starting point for OrderCloud applications with universal b2b e-commerce features

License

Notifications You must be signed in to change notification settings

esitarz/angular-buyer

 
 

Repository files navigation

OrderCloud Angular Buyer

An open-source starter application for custom OrderCloud buyer applications built on AngularJS. Ideally, solution implementers will fork or clone this repository to maintain their customized version of the buyer application through merges and pull requests after new versions are released in the base fork (this repository).


Getting started

Prerequisites

Installation

Install the project dependencies:

$ npm install

If for some reason the post-install script fails, reattempt the bower install manually:

$ bower install

Local Development

To view your application locally while you work, run the following gulp command:

$ gulp build

This will pull together everything in the projects ./src/ directory and put the result into a new ./build/ folder (ignored by source control).

After the build succeeds, an express server will fire up and open the app in your default browser @ http://localhost:3000/. Additionally, a watch is initiated so that BrowserSync can automatically refresh the app when changes to the ./src/ directory are made.

Running Unit and E2E Tests

Karma, Jasmine, and Protrator (e2e test framework for AngularJS) are our test frameworks of choice, everything you need to run unit or E2E tests should already be installed via npm.

Task File Extension Description
gulp test:unit *.spec.js Runs only the unit tests
gulp test:e2e *.test.js Runs only the E2E tests
gulp test *.spec.js or *.test.js Runs both the unit and E2E tests

Compiling for Production

You can run the following command to compile your code to a production-ready state:

$ gulp compile

This will concat all similar file types into a single file, minify the code, and drop the result into a new ./compile/ folder. Images in the ./src/assets/ directory are compressed for web optimization and template file contents are stringified and added to the angular $templateCache for faster load times.

While we've worked hard to ensure that your app will behave the same on both build and compile, it is always recommended that the compiled code be thoroughly tested before moving to production.

When the compile is complete, the express server will fire up again and open the app @ http://localhost:3000/. For performance reasons the watch is not fired on compile like it is on build.

Deploying to GitHub Pages

Having worked in the B2B world for over 15 years we know that showing development progress is extremely important, especially during large projects. That is why we've provided an easy way for you to deploy your compiled code directly to a gh-pages branch for fast and easy demos!

$ gulp deploy

This will push a compiled version of your working copy directly to your default git remote and can be viewed at username.github.io/repository-name.

Important Note! Your angular app must not be in HTML5 mode for the routing on gh-pages to work properly. This can be changed in ./src/app/app.constants.json prior to running the task.

Github pages can take a few minutes (about 10) to propagate before your app will become available.

Of course, this is not the only deployment option available. Angular-based OrderCloud applications are preconfigured to be deployed on Heroku using their GitHub integration and the ./compile directory is made up of entirely static files that can be easily deployed to any hosting provider.

Contributors

The OrderCloud team welcomes any and all open-source contributors to create a pull request for bug fixes, enhancements, or new features (pending review).

Prior to writing any code, be sure to open an issue with a detailed description of your problem or proposed enhancement. We may already be on our way to delivering what you want!

The OrderCloud team uses GitHub's standard fork, branch, pull request workflow and we expect any contributors to follow a similar workflow. Always provide a passing unit test for any fix or enhancement.

Thank you for being a part of the OrderCloud Community and helping make our resources the best they can be!

Further Reading

About

A starting point for OrderCloud applications with universal b2b e-commerce features

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 59.9%
  • HTML 25.9%
  • CSS 14.2%