This is an inventory management system built with Flask. It supports receiving inventory items, printing labels, and managing the inventory through a web interface.
- Python 3.8+
- PostgreSQL
-
Clone the repository:
git clone https://github.com/rekk2/Lot_Tracking.git cd Lot_tracking
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set up the environment variables:
- Create a
.env
file in the root directory of the project and copy the contents of.env.example
into it. - Update the values in
.env
as needed.
- Create a
-
Set up the PostgreSQL database:
- Create a new PostgreSQL database and user.
- Update the
SQLALCHEMY_DATABASE_URI
in the.env
file with your database credentials.
-
Initialize the database:
flask db init flask db migrate -m "Initial migration." flask db upgrade
-
Run the application:
flask run
-
Install PostgreSQL:
- On macOS:
brew install postgresql
- On Ubuntu:
sudo apt-get install postgresql postgresql-contrib
- On Windows: Download from the PostgreSQL website
- On macOS:
-
Create a new database and user:
sudo -u postgres psql CREATE DATABASE inventory_db; CREATE USER inventory_user WITH PASSWORD 'yourpassword'; ALTER ROLE inventory_user SET client_encoding TO 'utf8'; ALTER ROLE inventory_user SET default_transaction_isolation TO 'read committed'; ALTER ROLE inventory_user SET timezone TO 'UTC'; GRANT ALL PRIVILEGES ON DATABASE inventory_db TO inventory_user; \q
-
Update the
.env
file with your database credentials:SQLALCHEMY_DATABASE_URI=postgresql://inventory_user:yourpassword@localhost/inventory_db
-
Run the database migrations:
flask db init flask db migrate -m "Initial migration." flask db upgrade
-
Set up the environment variables:
- Create a
.env
file in the root directory of the project and copy the contents of.env.example
into it. - Update the values in
.env
as needed.
- Create a
-
Example
.env
file contents:# Flask settings FLASK_APP=run.py FLASK_ENV=development SECRET_KEY=your_secret_key # Database settings SQLALCHEMY_DATABASE_URI=postgresql://username:password@localhost/dbname SQLALCHEMY_TRACK_MODIFICATIONS=False # Printer settings PRINTER_IP=192.168.50.12
- Visit
http://127.0.0.1:5000
in your web browser to access the application. - Use the web interface to receive items, print labels, and manage inventory.
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
. - Make your changes and commit them:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature-name
. - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.