Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Generics (Stripe)

Store front for the band Generics that makes bank through the super-cool Stripe API!

Hosted at: https://generics.herokuapp.com

Stripe test card numbers: https://stripe.com/docs/testing#cards

Running the app locally

  1. Install Node Package Manager (NPM) by installing Node.js

  2. From the terminal go to the project folder and run

npm install
  1. Ensure you have the following settings in an .env file in the project folder (or in .bashrc)
STRIPE_SECRET_KEY=<Stripe secret key>
STRIPE_PUBLIC_KEY=<Stripe Public key>
  1. Run the following command to start the app
npm start
  1. in the browser type localhost:3000

Synopsis

Stripe APIs used

  1. Checkout
  2. Charges

Approaching the problem

I focused mainly on demonstrating how Stripe enables a technical win for the business use case of E-commerce payments. To that end,

  1. I looked at relevant Stripe docs.
  1. Found a basic template for a store front online.

  2. Integrated required Stripe APIs in the right places to enable an end-to-end payments workflow:

  • index.js: 49, 83
  • index.ejs: 8
  • server.js: 50
  1. Hosted the demo on Heroku

Technology stack

While I'm quite comfortable with these technologies, the reason I picked them is they work well together as part of an ecosystem to deliver value. Agile Manifesto #10 comes to mind:

Simplicity - the art of maximizing the amount of work not done - is essential

Building Robustness

While the app demonstrates the value proposition, if I had to broaden the immediate scope:

  1. I'd rewrite the HTML/JQuery front-end template in a component based technology like React or Angular to enhance responsiveness and maintainability.
  2. Separate the Stripe code into modules and add unit tests (in Jest or Mocha, maybe use Sinon.JS for fakes). This could also have value as documentation for unit testing with Node.js + Stripe API integration.
  3. Move the data to a DB, as opposed to having it come from items.json. The DB could be built out to serve as a central store for other apps demoing E-commerce use cases.

About

Store front with payments through Stripe

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages