A full-stack web application for managing IT assets, users, and departments with real-time tracking and detailed reporting capabilities.
- Complete CRUD Operations: Create, read, update, and delete IT assets
- Asset Categories: Laptop, Desktop, Monitor, Phone, Tablet, Keyboard, Mouse, Printer, Server, Network Device, and more
- Status Tracking: In Use, In Storage, In Repair, Decommissioned
- Detailed Asset Information:
- Purchase date and warranty expiry tracking
- Vendor information
- Technical specifications
- Assignment history
- Custom notes
- Employee Database: Comprehensive user profiles with department assignments
- Asset Assignment: Track which assets are assigned to which users
- Avatar Generation: Automatic color-coded initials for user identification
- Department Integration: Users linked to departments with automatic counts
- Department Hierarchy: Organize users by departments
- Employee Count Tracking: Real-time employee counts per department
- Validation: Prevent deletion of departments with assigned employees
- Real-time Statistics:
- Total assets count
- Assets in use
- Assets in repair
- Total users
- Visual Analytics:
- Asset status distribution (Pie Chart)
- Assets by department distribution (Pie Chart)
- Recent Activity: Quick view of recently added assets
- JWT-based Authentication: Secure token-based authentication
- Admin Profile Management: Update profile information and password
- Protected Routes: All routes require authentication
- Session Management: Persistent login with token refresh
- Dark Mode Support: Toggle between light and dark themes
- Responsive Design: Mobile-friendly interface
- Advanced Filtering:
- Search assets by name or user
- Filter by status
- Filter users by department
- Intuitive Navigation: Clean sidebar navigation with active state indicators
backend/
βββ config/ # Security, CORS, and data initialization
βββ controller/ # REST API endpoints
βββ dto/ # Data Transfer Objects
βββ exception/ # Global exception handling
βββ model/ # JPA entities
βββ repository/ # Spring Data JPA repositories
βββ security/ # JWT authentication & filters
βββ service/ # Business logic layer
frontend/
βββ components/
β βββ admin/ # Admin profile components
β βββ assets/ # Asset management UI
β βββ dashboard/ # Dashboard charts & stats
β βββ departments/# Department management UI
β βββ layout/ # Header, sidebar, navigation
β βββ ui/ # Reusable UI components
β βββ users/ # User management UI
βββ context/ # React context (Auth)
βββ pages/ # Page components
βββ services/ # API service layer
βββ utils/ # Utility functions
- Java 17 or higher
- Node.js and npm/yarn
- PostgreSQL (or Docker)
- Maven 3.9+
Update application-docker.properties in src/main/resources/ with your proper credentials:
spring.application.name=asset-management-api
spring.datasource.url=jdbc:postgresql://postgres:5432/asset_management
spring.datasource.username=postgres_username
spring.datasource.password=postgres_password
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
server.port=8080
cors.allowed-origins=http://localhost:3000Create .env in the frontend directory:
VITE_API_BASE_URL=URLcd backend
mvn clean install
mvn spring-boot:runThe API will be available at http://localhost:8080
cd frontend
npm install
npm run devThe frontend will be available at http://localhost:3000
Username: admin_username
Password: admin_password
Change these credentials
docker-compose up -dversion: '3.8'
services:
postgres:
image: postgres:latest
environment:
POSTGRES_DB: asset_management
POSTGRES_USER: postgres_username
POSTGRES_PASSWORD: postgres_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
backend:
build: ./backend
ports:
- "8080:8080"
environment:
SPRING_PROFILES_ACTIVE: docker
depends_on:
- postgres
frontend:
build: ./frontend
ports:
- "3000:3000"
environment:
VITE_API_BASE_URL: http://localhost:8080/api
volumes:
postgres_data:FROM maven:3.9.9-eclipse-temurin-17 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -DskipTests
FROM eclipse-temurin:17-jdk
WORKDIR /app
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app/app.jar","--spring.profiles.active=docker"]POST /api/auth/login- Admin login
GET /api/assets- Get all assets (with optional filters)GET /api/assets/{id}- Get asset by IDPOST /api/assets- Create new assetPUT /api/assets/{id}- Update assetDELETE /api/assets/{id}- Delete asset
GET /api/users- Get all usersGET /api/users/{id}- Get user by IDPOST /api/users- Create new userPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user
GET /api/departments- Get all departmentsGET /api/departments/{id}- Get department by IDPOST /api/departments- Create new departmentPUT /api/departments/{id}- Update departmentDELETE /api/departments/{id}- Delete department
GET /api/admin/profile- Get current admin profilePUT /api/admin/profile- Update admin profile
- Framework: Spring Boot 3.x
- Security: Spring Security + JWT
- Database: PostgreSQL with Spring Data JPA
- Build Tool: Maven
- Java Version: 17
- Framework: React
- Language: TypeScript
- Build Tool: Vite
- Routing: React Router v6
- HTTP Client: Fetch API
- Charts: Recharts
- Styling: Tailwind CSS
- Icons: Heroicons
- Containerization: Docker
- Orchestration: Docker Compose
- Admin: System administrators
- User: Employees/users
- Department: Organizational departments
- Asset: IT assets
- AssetHistory: Historical tracking of asset changes
- Users belong to Departments (Many-to-One)
- Assets can be assigned to Users (Many-to-One)
- Assets have History entries (One-to-Many)
- Responsive Design: Works on desktop, tablet, and mobile
- Dark Mode: Automatic theme detection with manual toggle
- Color-Coded Status: Visual indicators for asset status
- Interactive Charts: Real-time data visualization
- Modal Dialogs: Clean, focused editing experience
- Search & Filters: Quick data access
- Form Validation: Client and server-side validation
- JWT token-based authentication
- Password encryption with BCrypt
- CORS configuration
- Protected API endpoints
- Session management
- Automatic token expiration handling
- Asset QR code generation
- Bulk import/export (CSV, Excel)
- Role-based access control (RBAC)
- Asset depreciation tracking
Mohamed Boussas
- GitHub: @boussas
- Spring Boot team for the excellent framework
- React team for the powerful UI library
- Tailwind CSS for the utility-first CSS framework
- Heroicons for the beautiful icon set