AassetTrack: Easily manage your inventory https://candifloss.cc
Go to file
2025-03-17 12:03:23 +05:30
definitions remove: Temporarily remove "compareto" feature 2025-03-17 10:35:58 +05:30
functions remove: Temporarily remove "compareto" feature 2025-03-17 10:35:58 +05:30
routes SQL table-based auth 2025-03-17 10:14:04 +05:30
static Added "Edit using CSV" feature 2025-03-06 11:39:41 +05:30
templates SQL table-based auth 2025-03-17 10:14:04 +05:30
.gitignore Add config.py to gitignore 2025-03-17 12:03:23 +05:30
app.py Remove commented code 2025-03-08 14:12:53 +05:30
config.sample.py Add sample config 2025-03-17 10:45:45 +05:30
LICENSE Initial commit 2025-01-29 04:57:29 +00:00
README.md Added user login functionality 2025-03-08 11:53:34 +05:30
requirements.txt Initialize 2025-01-29 10:57:19 +05:30

Python Flask CRUD Application

A minimal python flask app for inventory management, with some basic functionality:

  • Fetch and display items from the MySQL db as an html table
  • Add new items to the db (individually) using a form
  • Edit existing (individual) items in the db using a form
  • Delete (individual)items in the db
  • Add a batch of new items from a csv file
  • Edit a batch of existing items with new data from a csv file
  • Let the user preview and edit the csv data in a table before submission
  • Use an admin-defined configuration to decide the attributes of an item, and how to manage the db and data

Acknowledgment

This project was originally forked from this project, although it has undergone significant improvent, and resembles nothing like it.

File structure:

.
├── app.py                     # Main application file
├── config.py                  # Application configuration (database, item attributes)
├── definitions/               # Definitions for attributes and database models
│   ├── attribute.py           # Attribute types (text, integer, date, select)
│   └── models.py              # SQLAlchemy models and dynamic table creation
├── functions/                 # Helper functions
│   ├── process_csv.py         # Extract and process CSV data
│   ├── validate_config.py     # Validate configuration file
│   └── validate_values.py     # Validate user input and CSV data
├── routes/                    # Flask routes
│   ├── confirm_save.py        # Save validated CSV data to the database
│   ├── create.py              # Add new items
│   ├── delete.py              # Delete items
│   ├── export_csv.py          # Export data as CSV
│   ├── update.py              # Edit existing items
│   ├── upload.py              # Upload and process CSV files
│   └── viewall.py             # View all items in the database
├── static/                    # Static files (e.g., JavaScript)
│   └── edited_csv.js          # JavaScript for editing CSV preview tables
└── templates/                 # HTML templates
    ├── csv_preview.html       # Preview and edit CSV data
    ├── delete.html            # Confirm item deletion
    ├── item_form.html         # Form for adding/editing items
    ├── upload.html            # Upload CSV file
    └── viewList.html          # Home page (view all items)