Git Product home page Git Product logo

shopify-image-repo's Introduction

shopify-image-repo

Shopify Winter 2020 Developer Intern Challenge Question

Lovingly made by Ben Chapman-Kish :)

This is a demonstrative image repository with capacity for selling products.

This project has been implemented in Python using Flask to serve a web interface and sqlite3 to track product information and transactions. Please note that as this is a backend interview role, I have invested no time whatsoever into making a beautiful user interface, although I could have if time permitted. ;)

Usage

To use this application, simply run python3 server.py from the command line. This will create the appropriate database tables and start the Flask server.

After this, open a web browser at the address given by Flask (usually http://127.0.0.1:5000). You will see a listing of products with associated data, such as their name, price, stock, and, of course, the image for said product. All of this data is pulled directly from a DB table and generated live with an HTML template. The images themselves are served from a static images folder.

A user can also try to buy any product by clicking the BUY button next to its image. This will verify that there are any left in stock, and will record the transaction (including time, product, and value) in our transactions table, while decrementing the product's inventory appropriately. Note that on the home page, we can see the total value of all transactions we have processed to date.

Possible Features

We could add a feature such as adding/removing products. This would be straightforward to implement using a simple HTTP form that would POST an image and its data to our server, allowing us to save the image to our images folder and update our products table. Another complimentary form would let us remove products from the database and delete the image from disk.

Another feature would be access control, allowing us to have different users of the image repository. One such user could be a vendor and another could be a customer. We could verify vendors by a login form that would give the browser an access token, allowing the application to serve administrative tools to the user such as adding/removing products, viewing earnings, and managing inventory. Customers could save payment information allowing them to easily buy products without having to enter their payment data again each time.

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.