Skip to main content

Get started with SmartShelf

This quickstart guide will help you set up SmartShelf on your local machine and start managing inventory right away.

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js version 18 or higher - Download
  • MongoDB version 6 or higher - Download
  • Git - Download
  • npm or yarn package manager (comes with Node.js)
You can verify your installations by running node --version, mongo --version, and git --version in your terminal.

Installation steps

1

Clone the repository

Clone the SmartShelf repository from GitHub:
git clone https://github.com/namish18/SmartShelf.git
cd SmartShelf
2

Set up the backend

Navigate to the backend directory and install dependencies:
cd backend
npm install
Create a .env file from the example:
cp .env.example .env
Edit the .env file with your configuration:
NODE_ENV=development
PORT=5000

MONGODB_URI=mongodb://localhost:27017/smartshelf

JWT_SECRET=your_super_secret_jwt_key_change_this_in_production_minimum_32_characters
JWT_EXPIRE=7d

CLIENT_URL=http://localhost:5173
Make sure to change the JWT_SECRET to a strong, unique secret key. The secret should be at least 32 characters long.
Start the backend server:
npm run dev
The backend API will be available at http://localhost:5000
3

Set up the frontend

Open a new terminal window and navigate to the frontend directory:
cd frontend
npm install
Create a .env file for the frontend:
touch .env
Add the API URL to your .env file:
VITE_API_URL=http://localhost:5000/api
Start the frontend development server:
npm run dev
The frontend will be available at http://localhost:5173
4

Start MongoDB

Make sure MongoDB is running on your system:
net start MongoDB
If you prefer using MongoDB Atlas (cloud database), see the installation guide for detailed setup instructions.
5

Create your first account

Open your browser and navigate to http://localhost:5173Click on the Register link and create a new account:
  • Name: Your full name
  • Email: Your email address
  • Password: A secure password
  • Role: Select from Admin, Manager, or Worker
The first account you create should be an Admin account to have full access to all features.
6

Access the dashboard

After registration, you’ll be automatically logged in and redirected to your role-specific dashboard:
  • Admin Dashboard: System overview, user management, and all features
  • Manager Dashboard: Live alerts, forecasting, FEFO ordering, and inventory management
  • Worker Dashboard: Assigned tasks with status updates

What’s next?

Now that SmartShelf is running, you can:

Add inventory items

Start tracking your warehouse inventory

View FEFO ordering

See items prioritized by expiry date

Check demand forecasts

View 7-day demand projections

Create tasks

Assign tasks to warehouse workers

Quick verification checklist

Verify your installation is working correctly:
  • Backend server running at http://localhost:5000
  • Frontend application accessible at http://localhost:5173
  • MongoDB connection successful (check backend console)
  • User registration and login working
  • Dashboard loads without errors

Troubleshooting

  • Verify MongoDB is running: mongosh or mongo command
  • Check if port 5000 is already in use
  • Ensure all environment variables are set in .env
  • Check the backend console for specific error messages
  • Verify VITE_API_URL in frontend .env is set to http://localhost:5000/api
  • Ensure backend server is running
  • Check browser console for CORS errors
  • Clear browser cache and reload the page
  • Verify MongoDB service is running
  • Check MONGODB_URI in backend .env is correct
  • If using MongoDB Atlas, ensure your IP is whitelisted
  • Verify MongoDB is listening on port 27017
For detailed installation instructions and advanced configuration, see the Installation guide.

Build docs developers (and LLMs) love