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:

  1. Logs in using admin credentials.
  2. Accesses the dashboard with options to manage assets.
  3. Creates categories, adds new assets, and generates QR codes.
  4. Reviews and resolves reported issues.
  5. Updates or deletes assets when required.

User:

  1. Logs in as a regular user.
  2. Scans a QR code or searches for an asset.
  3. Reports an issue with the asset.
  4. 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 and Report 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 assets
  • GET /api/assets/:id – Get asset by ID
  • POST /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 categories
  • POST /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!