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
| Tool | Command |
|---|---|
| TypeScript | npx tsc --noEmit |
| ESLint | npm run lint |
| Build | npm 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
- Add to
Permissiontype insrc/types/index.ts - Add to
PERMISSION_GROUPSandDEFAULT_ROLE_PERMISSIONSinsrc/utils/rbac.ts - Add to
ProtectedRouteandLayout.tsxnav item - Document in
documentation/docs/configuration/role-permissions.md
Adding a Firestore collection
- Create service in
src/services/ - Add TypeScript interface in
src/types/ - Update
firestore.rules - Document in
documentation/docs/architecture/firestore-collections.md - Deploy rules:
firebase deploy --only firestore:rules
Documentation
When adding features, update:
documentation/docs/features/— user-facing guideREADME.md— if install or quick start changes
Run docs locally:
cd documentation
npm install
npm start
Testing checklist before PR
-
npm run buildpasses - No new ESLint errors
- Tested with Super Admin and at least one limited role
- Firestore rules updated if collections changed
- Documentation updated