Easyassets Wiki - NovaJam/EasyAssets GitHub Wiki
π EasyAssets - GitHub Wiki
π Overview
EasyAssets is an asset management system designed to simplify the tracking, updating, and issue reporting of assets within an organization. It leverages QR code scanning for easy asset identification and is built with scalability and role-based access in mind.
π₯ Roles:
- Admin
- User
πΆββοΈ User Journey (General)
Admin:
- Logs in using admin credentials.
- Accesses the dashboard with options to manage assets.
- Creates categories, adds new assets, and generates QR codes.
- Reviews and resolves reported issues.
- Updates or deletes assets when required.
User:
- Logs in as a regular user.
- Scans a QR code or searches for an asset.
- Reports an issue with the asset.
- Views status updates if available.
π» Frontend (React + Vite + Tailwind)
π Pages / Routes:
/login
β Login page for Admins and Users/dashboard
β Main dashboard (redirects based on role)/asset-management
β Admin-only page to add/edit/delete assets/categories
β Admin-only page to manage categories/issue-tracker
β Admin-only page to see reported issues/scan
β User-accessible QR scanning interface/report-issue
β Form page to report an issue
π User Journey (Frontend):
Admin:
- Authenticated through login
- Sidebar shows routes:
Dashboard
,Asset Management
,Categories
,Issue Tracker
- Can navigate to any of the above to perform management tasks
User:
- Authenticated through login
- Sidebar only shows
Scan
andReport Issue
- Scans QR to fetch asset details and reports an issue
π§ Backend (Express + TypeScript)
π¬ Required API Endpoints:
π§Ύ Auth
POST /api/auth/login
β Login and get JWT token
π¦ Assets
GET /api/assets
β Get all assetsGET /api/assets/:id
β Get asset by IDPOST /api/assets
β Create asset (Admin only)PUT /api/assets/:id
β Update asset (Admin only)DELETE /api/assets/:id
β Delete asset (Admin only)
ποΈ Categories
GET /api/categories
β Get all categoriesPOST /api/categories
β Add new category (Admin only)DELETE /api/categories/:id
β Remove category (Admin only)
π οΈ Issues
POST /api/issues
β Report new issue (User)GET /api/issues
β Get all issues (Admin)PUT /api/issues/:id
β Update issue status (Admin)
π§± Suggested Schema (Mongoose / Prisma style):
Asset
{
assetId: string;
name: string;
category: string;
location: string;
status: 'available' | 'in_use' | 'maintenance' | 'retired';
description?: string;
qrCodeUrl?: string;
assignedTo?: string;
purchaseDate?: Date;
warrantyExpiry?: Date;
lastMaintained?: Date;
nextMaintenance?: Date;
createdBy: string;
createdAt: Date;
updatedAt: Date;
}
Issue
{
issueId: string;
assetId: string;
reportedBy: string;
description: string;
status: 'open' | 'resolved';
createdAt: Date;
updatedAt: Date;
}
Category
{
categoryId: string;
name: string;
createdAt: Date;
}
β Best Practices
- Protect all sensitive routes with role-based middleware
- Use environment variables for secrets
- Apply strong validation (Zod or Joi)
- Use Toasts/snackbars for all UI actions
- Ensure QR code scanning is mobile-friendly
Feel free to expand on this document as the project grows!