This is an Inventory Management System built with the MERN stack (MongoDB, Express, React, Node.js). This guide provides instructions for developers to run the application.
- Node.js
- Docker (optional for Docker setup)
- MongoDB (if not using Docker)
-
Clone the Repository:
git clone <repository-url> cd <repository-directory> -
Set Up Environment Variables:
Create a
.envfile in the root directory with the following content:DB_HOST=mongodb://localhost:27017/ims JWT_SECRET=your_jwt_secret_string -
Install Dependencies:
Navigate to the
serverandclientdirectories to install dependencies:cd server npm install cd ../client npm install -
Build the Frontend:
cd client npm run build mv build ../server/client -
Run the Application:
Open two terminal windows. In the first terminal, run the backend:
cd server npm startIn the second terminal, run the frontend:
cd client npm start -
Access the Application:
Open your browser and navigate to http://localhost:3000.
-
Ensure Docker is Installed:
Download and install Docker from Docker's website.
-
Create Secret Files:
Create secret files for the database host and JWT secret:
echo "mongodb://mongo:27017/ims" > secrets/db_host.txt echo "your_jwt_secret_string" > secrets/jwt_secret.txt -
Build and Run Docker Containers:
docker-compose up --build -
Access the Application:
Open your browser and navigate to http://localhost:5000.
For any issues, please contact ...