AFAskar/arms

โ˜… 0Forks 0TypeScriptGitHub โ†—Compare

Project website โ†—

README

๐Ÿš€ ARMS - Asset Readiness Management System

Senior Project - Information Systems Department
Prince Sultan University

A comprehensive digital maintenance tracking system prototype for military and security vehicles and weapons, built with modern web technologies as a senior capstone project.

๐Ÿ“‹ Project Overview

ARMS (Asset Readiness Management System) is a full-stack web application prototype developed as an academic demonstration of modern software development practices. This senior project showcases how traditional paper-based maintenance logs can be replaced with a modern, efficient digital solution.

๐ŸŽ“ Academic Context:

  • University: Prince Sultan University
  • Department: Information Systems
  • Project Type: Senior Capstone Project
  • Purpose: Prototype demonstration of enterprise-level maintenance management system

๐Ÿ’ก Concept Demonstration: This project serves as a proof-of-concept for digital transformation in maintenance management, demonstrating real-world application of learned technologies and methodologies. The system provides real-time tracking, scheduling, and management of vehicle and weapon maintenance across different security sectors (Police, Traffic Police, Military Police).

๐ŸŽฏ Key Features

  • Digital Asset Registry - Complete vehicle and weapon inventory management
  • Maintenance Tracking - Log, schedule, and monitor maintenance activities
  • Real-time Dashboard - Live statistics and maintenance alerts
  • Role-based Access Control - Secure authentication with WorkOS integration
  • Dark/Light Mode - Modern UI with theme switching
  • Mobile Responsive - Optimized for field technicians on mobile devices
  • QR Code Integration - Quick asset identification and access (Coming Soon)
  • AI-Powered Analytics - Predictive maintenance and intelligent reporting (Coming Soon)

๐Ÿ› ๏ธ Tech Stack

Frontend

Backend

  • tRPC - End-to-end type-safe APIs
  • Drizzle ORM - TypeScript ORM for database operations
  • NeonDB - Serverless PostgreSQL database (Coming Soon)
  • WorkOS - Enterprise authentication and user management

Development & Deployment

  • pnpm - Fast, disk space efficient package manager
  • ESLint - Code linting and formatting
  • Prettier - Code formatting
  • Vercel - Deployment and hosting platform

Future Integrations

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm

Installation

  1. Clone the repository

    git clone https://github.com/FahadAljabr/arms.git
    cd arms
  2. Enable pnpm and install dependencies

    corepack enable pnpm
    pnpm install
  3. Set up environment variables

    cp .env.example .env
    # Configure your WorkOS and database credentials
  4. Run the development server

    pnpm dev
  5. Open your browser Navigate to http://localhost:3000

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ dashboard/               # Dashboard page
โ”‚   โ”œโ”€โ”€ maintenance/             # Maintenance tracking page
โ”‚   โ”œโ”€โ”€ vehicles/                # Vehicle management page
โ”‚   โ”œโ”€โ”€ weapons/                 # Weapon management page
โ”‚   โ”œโ”€โ”€ login/                   # Authentication routes
โ”‚   โ”œโ”€โ”€ callback/                # WorkOS callback handling
โ”‚   โ””โ”€โ”€ layout.tsx               # Global layout with navigation
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ ui/                      # Shadcn UI components
โ”‚   โ”œโ”€โ”€ main-navigation.tsx      # Global navigation component
โ”‚   โ”œโ”€โ”€ theme-provider.tsx       # Dark mode theme provider
โ”‚   โ””โ”€โ”€ theme-toggle.tsx         # Dark/light mode toggle
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ api/                     # tRPC API configuration
โ”‚   โ””โ”€โ”€ db/                      # Database schema and connection
โ”œโ”€โ”€ styles/
โ”‚   โ””โ”€โ”€ globals.css              # Global styles with Tailwind CSS
โ””โ”€โ”€ trpc/                        # tRPC client configuration

๐ŸŽฏ Development Roadmap

MVP 1: Basic Digital Logbook โœ… UI Complete - Backend In Progress

  • โœ… Asset registration (vehicles/weapons)
  • โœ… Maintenance record logging interface
  • โœ… Historical record viewing
  • โœ… Role-based authentication (WorkOS)
  • ๐ŸŸก Database integration (NeonDB setup pending)
  • ๐ŸŸก Backend CRUD operations (in progress)

MVP 2: Proactive Operations Center ๐ŸŸก Planned

  • Real-time dashboard with statistics
  • Preventive maintenance scheduling
  • Parts inventory management
  • QR code generation for assets
  • Mobile-optimized interface

MVP 3: Intelligent Readiness System ๐Ÿ”ด Future

  • AI-powered predictive maintenance
  • Intelligent report analysis with Gemini AI
  • Risk scoring and recommendations
  • Natural language query interface

๐Ÿ” Authentication & Security

  • WorkOS Integration - Enterprise-grade authentication
  • Role-based Access Control - Maintenance Technicians vs Responsible Officers
  • Secure Session Management - JWT tokens with proper expiration
  • Audit Trail Logging - Complete activity tracking (Coming Soon)

WorkOS as the Source of Truth (Users & Roles)

This application now delegates all user identities and roles to WorkOS AuthKit and RBAC. The local database no longer stores users or roles. Instead, tables reference WorkOS user IDs (e.g., user_01...).

  • Sign-in, sessions, and logout are handled by @workos-inc/authkit-nextjs.
  • Role checks in the backend use WorkOS role data from the session; see src/server/auth/roles.ts.
  • Tables like maintenance records reference WorkOS user IDs directly; foreign keys to a local users table were removed.

Required environment variables (see src/env.js):

  • WORKOS_API_KEY โ€“ Server-side key for WorkOS SDK
  • WORKOS_CLIENT_ID โ€“ Client ID for AuthKit
  • WORKOS_COOKIE_PASSWORD โ€“ 32+ char cookie secret

Recommended dashboard setup in WorkOS:

  • Create an Organization for your environment (single-tenant) or multiple (multi-tenant).
  • Define roles (e.g., technician, officer) under RBAC.
  • Assign user memberships and roles within the Organization.

Local DB migration (only if you are managing your own Postgres):

pnpm db:generate   # generate migration for schema changes
pnpm db:push       # push changes to your dev database

Note: In development, we've kept compatibility stubs so existing UI compiles while roles/users are removed from the schema:

  • src/server/auth/provision.ts is now a no-op.
  • postRouter.getLatest returns null to keep client types compiling.

๐ŸŽจ UI/UX Features

  • Modern Design System - Clean, professional interface
  • Dark/Light Mode - User preference-based theming
  • Responsive Design - Works seamlessly on desktop and mobile
  • Accessibility - WCAG compliant components
  • Interactive Components - Rich forms, tables, and data visualization

๐Ÿ“ฑ Mobile-First Approach

The system is designed with field technicians in mind:

  • Touch-friendly interface for mobile devices
  • QR code scanning capabilities (coming soon)
  • Offline-capable data entry (future enhancement)
  • Quick access to asset information

๐Ÿค Contributing

This project follows modern development practices:

  1. Code Quality - TypeScript strict mode, ESLint, Prettier
  2. Component Architecture - Reusable Shadcn UI components
  3. Type Safety - End-to-end type safety with tRPC
  4. Modern React Patterns - Server Components, Suspense, Error Boundaries

๐Ÿ“ Available Scripts

# Development
pnpm dev              # Start development server
pnpm build            # Build for production
pnpm start            # Start production server

# Code Quality
pnpm lint             # Run ESLint
pnpm lint:fix         # Fix ESLint issues
pnpm typecheck        # TypeScript type checking
pnpm format:check     # Check Prettier formatting
pnpm format:write     # Apply Prettier formatting

# Database
pnpm db:generate      # Generate Drizzle migrations
pnpm db:migrate       # Run database migrations
pnpm db:push          # Push schema to database
pnpm db:studio        # Open Drizzle Studio

๐ŸŒŸ Key Technical Decisions

  • Next.js App Router - Modern React architecture with server components
  • Shadcn UI - Consistent, accessible component library
  • tRPC - Type-safe API development without code generation
  • Drizzle ORM - Lightweight, type-safe database operations
  • WorkOS - Enterprise authentication without custom user management
  • Tailwind CSS v4 - Latest utility-first CSS framework

๐Ÿ“„ License

Open Source License (Copyleft)

This project is released under an open source copyleft license. You are free to:

  • โœ… Use this software for any purpose
  • โœ… Study and modify the source code
  • โœ… Distribute copies of the software
  • โœ… Distribute modified versions

โš ๏ธ Copyleft Requirement: If you use this software in your own projects, you must also make your project open source under the same license terms. This ensures that improvements and modifications remain available to the community.

๐ŸŽ“ Academic Project

This is a senior capstone project from Prince Sultan University's Information Systems program, designed to demonstrate:

  • Modern full-stack web development practices
  • Enterprise software architecture patterns
  • Real-world problem-solving through technology
  • Integration of multiple modern technologies and APIs

๐Ÿ“ž Support & Contact

Student Developer: Fahad Aljabr Institution: Prince Sultan University - Department of Computer & Information Sciences

For academic inquiries or technical questions about this prototype, please contact through university channels.


Built with โค๏ธ at Prince Sultan University using the T3 Stack and modern web technologies

Contributors

FahadAljabrAFAskar

Issues