Skip to main content

Installation

Complete step-by-step guide to download, configure, and run Asset Information Centre locally.

Step 1 — Download the source code

git clone https://github.com/Raj010505/Asset-Management.git
cd Asset-Management

Option B: Download ZIP

  1. Open https://github.com/Raj010505/Asset-Management
  2. Click Code → Download ZIP
  3. Extract and open a terminal in the folder

Step 2 — Install dependencies

npm install

This installs all packages listed in package.json (React, MUI, Firebase, Vite, etc.).

Expected time: 1–3 minutes depending on network speed.

Step 3 — Configure environment variables

Copy the example environment file:

Windows (PowerShell):

Copy-Item .env.example .env

macOS / Linux:

cp .env.example .env

Edit .env and fill in your Firebase web app credentials from the Firebase Console → Project Settings → Your apps → Web:

VITE_FIREBASE_API_KEY=AIza...
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
VITE_FIREBASE_APP_ID=1:123456789:web:abc123
VITE_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX
Alternative configuration

Super Admin can also save Firebase config from Settings → Platform → Firebase Backend Setup in the running app. That writes to .env via the dev server API.

Step 4 — Deploy Firestore security rules

From the project root:

firebase init firestore
# Select existing project, use firestore.rules and firestore.indexes.json

firebase deploy --only firestore:rules

Rules file: firestore.rules at repository root.

Step 5 — Start the development server

npm run dev

Output:

VITE v5.x.x ready in xxx ms
➜ Local: http://localhost:3000/

The browser should open automatically. If port 3000 is busy, Vite uses the next available port (e.g. 3001).

Step 6 — Create the first Super Admin

  1. Firebase Console → Authentication → Add user
    Create a user with email and password.

  2. Firestore → Create collection users
    Document ID = the user's Firebase Auth UID:

{
"email": "admin@yourcompany.com",
"firstName": "Super",
"lastName": "Admin",
"role": "super_admin",
"portalAccess": "Yes",
"createdAt": "<timestamp>",
"updatedAt": "<timestamp>",
"createdBy": "system",
"updatedBy": "system"
}
  1. Log in at http://localhost:3000/login with those credentials.

Step 7 — Verify installation

CheckExpected result
Login page loadsNo console Firebase errors
Login succeedsRedirect to Dashboard
Settings visibleSuper Admin sees Settings in sidebar
Firestore writesAdding a location creates a document

Production build (optional test)

npm run build
npm run preview

Build output is in the dist/ folder.

Troubleshooting installation

ProblemSolution
npm install failsUse Node 18+, delete node_modules and retry
Blank page / Firebase errorCheck .env values match Firebase Console
Permission denied on saveDeploy firestore.rules
Port in useChange port in vite.config.ts

Common Issues

Next step

Quick Start