Skip to content

nstrings/inventory_tracker_flask

Repository files navigation

Flask Inventory/Asset Tracker

A minimal but production-ready starter for tracking inventory and assets with Flask on macOS using Visual Studio Code.

Features

  • Items: name, category, serial number, quantity, location, condition/status, notes, purchase date
  • Locations: manage locations and assign items
  • CRUD UI with Flask-WTF forms and Bootstrap 5
  • Search + simple filters
  • CSV export/import (basic)
  • SQLite by default; swap DB via DATABASE_URL
  • Migrations with Flask-Migrate
  • REST-style JSON endpoints for items/locations (basic read/create/update/delete)

Quick Start (macOS + VS Code)

  1. Open in VS Code
  • Unzip the project.
  • In VS Code, File > Open... the project folder.
  1. Create venv
python3 -m venv .venv
source .venv/bin/activate
  1. Install deps
pip install -r requirements.txt
  1. Environment
  • Copy .env.example to .env and set a SECRET_KEY.
cp .env.example .env
  1. Initialize DB
flask db init
flask db migrate -m "init"
flask db upgrade
  1. Run
flask run

VS Code Debugging

  • A launch.json is provided. After activating your venv, press F5 to run the app in debug mode.

CSV Import Format

CSV headers for items (case-insensitive): name,category,serial_number,quantity,location,condition,status,purchase_date,notes

  • quantity defaults to 1 if blank
  • purchase_date accepts YYYY-MM-DD

Switching Databases

Set DATABASE_URL in .env. Examples:

  • SQLite (default): sqlite:///inventory.db
  • Postgres: postgresql+psycopg2://user:pass@localhost:5432/inventory
  • MySQL: mysql+pymysql://user:pass@localhost/inventory

Project Structure

inventory_tracker_flask/
├─ app.py
├─ models.py
├─ forms.py
├─ requirements.txt
├─ .env.example
├─ README.md
├─ templates/
│  ├─ base.html
│  ├─ dashboard.html
│  ├─ items_list.html
│  ├─ item_form.html
│  ├─ locations_list.html
│  ├─ location_form.html
├─ static/
│  └─ styles.css
└─ .vscode/
   └─ launch.json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages