Installation
Complete step-by-step guide to download, configure, and run Asset Information Centre locally.
Step 1 — Download the source code
Option A: Git clone (recommended)
git clone https://github.com/Raj010505/Asset-Management.git
cd Asset-Management
Option B: Download ZIP
- Open https://github.com/Raj010505/Asset-Management
- Click Code → Download ZIP
- 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
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
-
Firebase Console → Authentication → Add user
Create a user with email and password. -
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"
}
- Log in at
http://localhost:3000/loginwith those credentials.
Step 7 — Verify installation
| Check | Expected result |
|---|---|
| Login page loads | No console Firebase errors |
| Login succeeds | Redirect to Dashboard |
| Settings visible | Super Admin sees Settings in sidebar |
| Firestore writes | Adding a location creates a document |
Production build (optional test)
npm run build
npm run preview
Build output is in the dist/ folder.
Troubleshooting installation
| Problem | Solution |
|---|---|
npm install fails | Use Node 18+, delete node_modules and retry |
| Blank page / Firebase error | Check .env values match Firebase Console |
| Permission denied on save | Deploy firestore.rules |
| Port in use | Change port in vite.config.ts |