A modern, responsive web application for tracking personal or organizational assets with QR scanning, lending management, and role-based administration.
"AssetTracker - Physical Asset Management System"
A modern, responsive web application for tracking personal or organizational assets with QR scanning, lending management, and role-based administration.
- Dual-Role Authentication:
- Secure Email/Password Login (JWT).
- OAuth Integration (Google & Microsoft).
- Split Login Flow: Dedicated "Admin Login" vs. "Standard Sign In".
- Admin Dashboard:
- Visual statistics (Total Users, Items, Value).
- User Management Table (View all users, Delete users).
- Role-based route protection (
RequireAdmin).
- Asset Management:
- Create, Read, Update, Delete (CRUD) items.
- Organize items by Locations.
- Search & Filter functionality.
- Advanced Tools:
- QR Code/Barcode Scanning (for quick lookup).
- Lending System (Track borrowed/lent items).
- PayPal Integration (for payments/subscriptions).
- Dark Mode support.
- Frontend: React, Vite, Tailwind CSS, Lucide React (Icons), React Router v6.
- Backend: Node.js, Express, Sequelize ORM.
- Database: PostgreSQL.
- Security: BCrypt (hashing), JWT (tokens), CORS.
- Node.js (v16 or higher)
- PostgreSQL installed and running
- Git
git clone https://github.com/yangpeisen/asset-tracker.git
cd asset-tracker- Open your PostgreSQL tool (e.g., pgAdmin or command line).
- Create a new database named
asset_tracker.
CREATE DATABASE asset_tracker;Navigate to the backend directory and install dependencies:
cd backend
npm installCreate a .env file in the backend directory based on the template below:
# Server Configuration
PORT=5002
NODE_ENV=development
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=asset_tracker
DB_USER=postgres
DB_PASSWORD=your_password_here
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key
JWT_EXPIRES_IN=7d
# OAuth Configuration (Optional)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
MICROSOFT_CLIENT_ID=your_microsoft_client_id
MICROSOFT_CLIENT_SECRET=your_microsoft_client_secret
# CORS Configuration
FRONTEND_URL=http://localhost:5173Run database migrations (if applicable) or start the server to sync models:
npm run migrate
# OR
npm run devOpen a new terminal, navigate to the project root (frontend), and install dependencies:
cd ..
# or cd asset-tracker if opening a new terminal
npm installCreate a .env.local file in the root directory if needed (for frontend-specific vars):
VITE_API_URL=http://localhost:5002/apiStart the frontend development server:
npm run dev- Backend: Runs on
http://localhost:5002 - Frontend: Runs on
http://localhost:5173
Access the application at http://localhost:5173.
- Developer: Yang Peisen
- Email: [email protected]
- GitHub: Yang Peisen