Giter Club home page Giter Club logo

banksy_trading_co's Introduction

Logo

An E-commerce web application for selling men's suits and accessories. This project is created with the MERN (MongoDB, Express, React, Node) stack.

Table of contents

Motivations

  • Solve a modern business problem
    • E-commerce
  • Dive deep into JS and ES2015+ features
    • Promises
    • Currying
    • Scope/Closures
    • Async / Await
    • Generators

Screenshots

Front Page

Front Page

Shop Page

Shop Page

Technologies

Architecture

Tech Stack

Libraries and tools

Libraries and tools

GraphQL

GraphQL is a query language for APIs and a runtime for fulfilling queries with existing data. In our application, we used it as an API to fetch data from our MongoDB database.

You can play with GraphQL on the playground here.

Here is how playground looks like with query example:

GQL Playground Example

Setup

npm install
npm run launch

In order to run GraphQL API to fetch data in api directory, run:

npm install
npm start

Building

Build script will create a build directory with a compiled JavaScript code which will be compatible with most modern browsers. We are using create-react-app as a strating point in our app, which under the hood uses babel as a transpiler.

npm run build

Testing

As a testing frameworking we are usng Jest. Just run test script to run tests

npm run test

Code Examples

All components are functional and written in Typescript:

interface CartIconProps {
  toggleCartHidden: (event: any) => void
  itemCount: number
}

export const CartIcon = ({
  toggleCartHidden,
  itemCount
}: CartIconProps): JSX.Element => (
  <div className='cart-icon' onClick={toggleCartHidden}>
    <ShoppingIcon className='shopping-icon'></ShoppingIcon>
    <span className='item-count'>{itemCount}</span>
  </div>
)

Features

  • Users can be authenticated using Google Sign-In or by creating a new account
  • Cart data persists throughout browser sessions using localStorage
  • Payments are handled via external Stripe API
  • Clothing/accessory models are stored in Mongo and retrieved dynamically

Considerations for improvement:

  • Expand inventory models with options for stock quantity, size, alt angles
  • Save cart persistence on database for logged in users
  • Better pop-up messages for error handling

Landing Page and Deployment

Landing page: here

Project is deployed on Heroku!

Banksy-Trading-Co

Inspiration

Andrei Neagoie and Yihua Zhang's Intro to React course on Udemy

Contact

Created by:

banksy_trading_co's People

Contributors

tuvo1106 avatar narnat avatar dependabot[bot] avatar

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.