Skip to content

Latest commit

 

History

History
91 lines (61 loc) · 2.72 KB

README.md

File metadata and controls

91 lines (61 loc) · 2.72 KB

Node + Stripe

Build Status Coverage Status

This is a template for you to use on your own projects for processing one-time Stripe charges. Follow the directions below to get started.

main

Looking for a simple example? Node Stripe Example

The back-end API includes:

  1. User auth
  2. Stripe integration
  3. Testing via Mocha and Chai as well as Istanbul for code coverage

Quick Start

  1. Fork/Clone
  2. Install dependencies - npm install
  3. Rename the .env_sample file to .env and update
  4. Create two local Postgres databases - node_stripe_charge and node_stripe_charge_test
  5. Migrate - knex migrate:latest --env development
  6. Seed - knex seed:run --env development
  7. Run the development server - gulp
  8. Server should be listening on http://localhost:3000

Development Workflow

  1. Create feature branch
  2. Develop/test locally
  3. Create PR, which triggers Travis CI
  4. After tests pass, merge the PR
  5. Tests run again on Travis CI

Tests

Without code coverage:

$ npm test

With code coverage:

$ npm run coverage

Changelog

  1. 04/15/2018 - updated dependencies, added bootstrap 4, increased test coverage
  2. 11/14/2016 - refactored all code, updated to es6, moved to postgres from mongo, added tests
  3. 02/09/2016 - refactored passport, tests, error handlers, client-side javascript (view commit)
  4. 04/23/2015 - major refactor
  5. 03/11/2015 - updated to Express 4.x

JSON API Documentation

Admin required for all routes!

Users

  • GET /api/v1/users - get all users
  • GET /api/v1/users/:id - get user
  • POST /api/v1/users - create user
  • PUT /api/v1/users/:id - update user
  • DELETE /api/v1/users/:id - delete user

Products

  • GET /products - get all products
  • GET /products/:id - get products
  • POST /products - create products
  • PUT /products/:id - update products
  • DELETE /products/:id - delete products

Screenshots

Main Page

main

Charge Page

charge

Admin Page

admin