GithubHelp home page GithubHelp logo

addu390 / crud-flask-example Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 935 KB

CRUD Operations of inventory with deletion comments and undeletion for Spotify Fall 2022 Backend Developer Internship

Home Page: https://replit.com/@addu390/shopify-inventory-management

License: MIT License

Python 52.39% HTML 46.42% Shell 1.19%
flask inventory-management-system sqlalchemy

crud-flask-example's Introduction

Inventory Management - Shopify Fall 2022

CRUD Operations of inventory with deletion comments and undeletion.

Requirements

  • Basic CRUD Functionality.
  • When deleting, allow deletion comments and undeletion.

Replit Set-up

  • The .replit file pre-configured to RUN on Replit
  • Or run the below commands in the same order in Replit shell.
pip install -r requirements.txt
export FLASK_APP=setup.py
flask db init
flask db migrate -m "Migrate Tables"
flask db upgrade
flask run --host=0.0.0.0 --port=80

Set export FLASK_DEBUG=1 for auto-reload.

Usage

  • Add action button to add an item to the inventory with details such as Title, Description, and Quantity.
  • After adding, Edit or Delete the item, where Edit is a simple update operation on allowed fields.
  • delete in this context is a soft delete. Ensure to add a comment mentioning the reason for deletion.
  • After deleting, undo the deletion if necessary while keeping track of the delete/restore history; the deletion history record will now be updated to RESTORED
  • Lists are paginated; use < Newer | Older > to navigate across pages.

Note:

  • The history is not limited to the inventory table or delete operation and is extendable for other operations and entities.
  • The Inventory and History tables are always consistent, with "all-or-nothing" atomic transactions.
  • At any given point, there can only be one DELETED record of an item and 1-or-more record of RESTORED.
  • While having individual backend and frontend applications is ideal, the Jinja templating engine is used for simplicity to render the UI.

Low Coupling and High Cohesion:

  • The storage layer is de-coupled; changing the datastore would require changes only in storage.py
  • The resource/API layer routes.py only depends on the services classes (InventoryService and HistoryService) and not the storage layer.

crud-flask-example's People

Contributors

addu390 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

balapitchuka

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.