Skip to main content

Development Guide

Guide for developers contributing to Asset-Management.

Setup

git clone https://github.com/Raj010505/Asset-Management.git
cd Asset-Management
npm install
cp .env.example .env
# Configure Firebase
npm run dev

Code standards

ToolCommand
TypeScriptnpx tsc --noEmit
ESLintnpm run lint
Buildnpm run build

Conventions

  • TypeScript strict mode — no implicit any
  • Components — functional components with hooks
  • Services — Firestore access in src/services/, not in components
  • Permissions — use hasPermission() from Auth context, not hardcoded roles
  • Audit — call writeAuditLog() for admin actions

Branch workflow

git checkout -b feature/my-feature
# Make changes
npm run lint
npm run build
git commit -m "Add my feature"
git push origin feature/my-feature

Open a Pull Request against main.

Adding a permission

  1. Add to Permission type in src/types/index.ts
  2. Add to PERMISSION_GROUPS and DEFAULT_ROLE_PERMISSIONS in src/utils/rbac.ts
  3. Add to ProtectedRoute and Layout.tsx nav item
  4. Document in documentation/docs/configuration/role-permissions.md

Adding a Firestore collection

  1. Create service in src/services/
  2. Add TypeScript interface in src/types/
  3. Update firestore.rules
  4. Document in documentation/docs/architecture/firestore-collections.md
  5. Deploy rules: firebase deploy --only firestore:rules

Documentation

When adding features, update:

  • documentation/docs/features/ — user-facing guide
  • README.md — if install or quick start changes

Run docs locally:

cd documentation
npm install
npm start

Testing checklist before PR

  • npm run build passes
  • No new ESLint errors
  • Tested with Super Admin and at least one limited role
  • Firestore rules updated if collections changed
  • Documentation updated

Repository

https://github.com/Raj010505/Asset-Management