Windows Setup Guide

Complete installation and configuration guide for Windows systems

Prerequisites

Before installing InveTrack on Windows, ensure you have the following:

  • Windows 10 or Windows 11 (64-bit recommended)
  • Administrator privileges on your system
  • At least 4GB of RAM (8GB recommended)
  • 2GB of free disk space
  • Internet connection for downloading dependencies

Step 1: Install Node.js

1

Download Node.js

Visit the official Node.js website at https://nodejs.org

Download the LTS version (Long Term Support) which is recommended for production use.

Important

Make sure to download Node.js version 22 or higher as required by InveTrack.

2

Run the Installer

Double-click the downloaded installer file (.msi)

Follow the installation wizard with these recommended settings:

  • Accept the license agreement
  • Choose the default installation path (usually C:\Program Files\nodejs\)
  • Select "Add to PATH" option (this should be checked by default)
  • Install npm package manager (included by default)
3

Verify Installation

Open Command Prompt or PowerShell as Administrator and run:

node --version

You should see output like:

v22.x.x

Also verify npm is installed:

npm --version

Step 2: Install MySQL

1

Download MySQL

Visit the MySQL download page at https://dev.mysql.com/downloads/mysql/

Select "MySQL Community Server" and choose the Windows installer (mysql-installer-community-8.0.x.x.msi)

Version Compatibility

InveTrack requires MySQL 5.7 or higher. MySQL 8.0 is recommended for better performance and security.

2

Install MySQL

Run the MySQL installer and follow these steps:

  • Choose "Developer Default" setup type
  • Install MySQL Server, MySQL Workbench, and MySQL Shell
  • Configure MySQL Server with these settings:
    • Set root password (remember this password!)
    • Enable MySQL as a Windows service
    • Set service to start automatically
    • Configure Windows Firewall if prompted
3

Create Database

Open MySQL Workbench or Command Line Client and create a new database:

CREATE DATABASE invetrack_db;

Or using MySQL Workbench:

  1. Connect to your MySQL server
  2. Right-click in the Navigator panel
  3. Select "Create Schema"
  4. Name it "invetrack_db"
  5. Click "Apply"

Step 3: Install InveTrack Server

1

Navigate to Server Directory

Open Command Prompt or PowerShell and navigate to the server directory:

cd "C:\path\to\inventory-manager\server"

Replace the path with your actual project location.

2

Install Dependencies

Install all required Node.js packages:

npm install

This will install all dependencies listed in package.json including Express.js, Sequelize, JWT, and other required packages.

3

Create Environment File

Create a

.env
file in the server directory with your configuration:

# Database Configuration
DB_HOST=localhost
DB_PORT=3306
DB_NAME=invetrack_db
DB_USERNAME=root
DB_PASSWORD=your_mysql_password

# JWT Configuration
JWT_SECRET=your-super-secure-jwt-secret-key-change-this-in-production
JWT_EXPIRES_IN=24h

# Server Configuration
PORT=3000
NODE_ENV=development

# CORS Configuration
ALLOWED_ORIGINS=http://localhost:5000,http://localhost:3000

# Rate Limiting
RATE_LIMIT_MAX=1000
AUTH_RATE_LIMIT_MAX=1000
API_RATE_LIMIT_MAX=1000

# Logging
LOG_LEVEL=info

# OpenAI Configuration (Optional - for AI-powered reports)
# OPENAI_MODEL=gpt-4o-mini

Security Note

Change the JWT_SECRET to a strong, unique value in production. Use a password manager to generate a secure secret.

AI Features

The OpenAI API key is configured through the application settings after login, not in the .env file. The OPENAI_MODEL variable is optional and defaults to 'gpt-4o-mini' if not specified.

4

Run Database Migrations

Set up the database tables:

npm run db:migrate

This will create all necessary tables in your MySQL database.

5

Seed Initial Data

Add sample data to the database:

npm run db:seed

This will create default users, departments, and sample assets.

6

Start the Server

Start the development server:

npm run dev

You should see output indicating the server is running on port 3000.

Step 4: Configure OpenAI API Key (Optional)

InveTrack includes AI-powered features that generate intelligent reports and insights. To enable these features, you need to configure an OpenAI API key.

AI Features Available

With OpenAI API key configured, you can access:

  • Demand Forecasting: AI-powered predictions for inventory demand
  • Price Optimization: Intelligent pricing recommendations to maximize revenue
  • Product Performance Analysis: AI-generated insights on product trends
  • Cross-sell Recommendations: Suggestions for complementary products
  • Slow Moving Products: AI analysis of inventory that needs attention
  • Stockout Impact Analysis: Predictions on the impact of stockouts
1

Get Your OpenAI API Key

If you don't have an OpenAI API key yet, follow these steps:

  1. Visit https://platform.openai.com
  2. Sign up for an account or log in if you already have one
  3. Navigate to API Keys section in your account settings
  4. Click "Create new secret key"
  5. Give your key a name (e.g., "InveTrack Production")
  6. Copy the API key immediately (you won't be able to see it again)

Important

Keep your API key secure and never share it publicly. OpenAI charges based on usage, so monitor your API usage regularly.

2

Configure API Key in InveTrack

After completing the client setup and logging into the application:

  1. Log in to InveTrack using the default admin credentials
  2. Navigate to Settings from the main menu
  3. Look for the "OpenAI API Key" or "AI Configuration" section
  4. Paste your OpenAI API key into the designated field
  5. Click "Save" to store the configuration

Note

The API key is stored securely in the database and is associated with your company. Each company can have its own API key configuration.

3

Verify AI Features

To verify that the API key is working correctly:

  1. Navigate to the Reports or Analytics section
  2. Try generating an AI-powered report (e.g., Demand Forecast or Price Optimization)
  3. If configured correctly, the report should generate successfully
  4. If you see an error, double-check that the API key is correct and has sufficient credits

Troubleshooting

If AI features are not working:

  • Verify the API key is correctly copied (no extra spaces)
  • Check your OpenAI account has available credits
  • Ensure your API key has not been revoked or expired
  • Check the application logs for detailed error messages

Step 5: Install InveTrack Client

1

Navigate to Client Directory

Open a new Command Prompt or PowerShell window and navigate to the client directory:

cd "C:\path\to\inventory-manager\client"
2

Install Dependencies

Install all required packages:

npm install

This will install React, TypeScript, Tailwind CSS, and other frontend dependencies.

3

Configure API Endpoint

Update the API configuration in

src/config/config.ts
:

export const baseUrl = "http://localhost:3000";
export const apiUrl = `${baseUrl}/api`;

Make sure the port matches your server configuration.

4

Start the Client

Start the development server:

npm run dev

The client will typically run on port 5000. Check the console output for the exact URL.

Step 6: Access the Application

Open your web browser and navigate to:

http://localhost:5000

Default Login Credentials

Use these credentials to log in for the first time:

  • Email: admin@example.com
  • Password: admin123

Important

Change the default password immediately after your first login for security reasons.

Troubleshooting

Common Issues

  • Port already in use: Change the port in your .env file or kill the process using that port
  • MySQL connection failed: Verify MySQL is running and credentials are correct
  • Permission denied: Run Command Prompt as Administrator
  • Node modules not found: Ensure you're in the correct directory and run npm install

Getting Help

If you encounter issues not covered in this guide, check the Troubleshooting page for more detailed solutions.