Thanks to visit codestin.com
Credit goes to github.com

Skip to content

rharmanca/CustodialCommand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงน Custodial Command

A comprehensive custodial inspection and management system built for educational institutions. This Progressive Web App (PWA) enables custodial staff to conduct inspections, report concerns, and track building cleanliness standards.

โœจ Features

  • ๐Ÿ“ฑ Progressive Web App (PWA) - Install on mobile devices for offline access
  • ๐Ÿข Building Inspections - Complete whole-building or single-room inspections
  • ๐Ÿ“ Custodial Notes - Report and track custodial concerns
  • ๐Ÿ“Š Data Analytics - View inspection data and generate reports
  • ๐Ÿ”’ Admin Panel - Administrative oversight and management
  • ๐Ÿ“ฑ Mobile Optimized - Touch-friendly interface for mobile devices
  • โšก Real-time Updates - Live data synchronization

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL database (or use free options like Supabase/Neon)
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone <repository-url>
    cd CustodialCommand-1
  2. Install dependencies

    npm install
  3. Set up environment variables

    # Copy the example environment file
    cp .env.example .env
    
    # Edit .env and add your database URL
    DATABASE_URL=postgresql://username:password@host:port/database
  4. Set up the database

    # Push the database schema
    npm run db:push
  5. Start the development server

    npm run dev
  6. Open your browser

๐Ÿ—„๏ธ Database Setup

Option 1: Supabase (Recommended - Free)

  1. Go to supabase.com and create an account
  2. Create a new project
  3. Get your connection string from Settings โ†’ Database
  4. Update your .env file with the connection string

Option 2: Neon (Alternative Free Option)

  1. Go to neon.tech and create an account
  2. Create a new database
  3. Copy the connection string
  4. Update your .env file

Option 3: Local PostgreSQL

  1. Install PostgreSQL locally
  2. Create a database named custodial_command
  3. Update your .env file with local connection details

๐Ÿ“ฑ PWA Installation

On Mobile Devices

iPhone/iPad:

  1. Open the app in Safari
  2. Tap the Share button (โ–กโ†—)
  3. Select "Add to Home Screen"
  4. Tap "Add"

Android:

  1. Open the app in Chrome
  2. Tap the menu (โ‹ฎ)
  3. Select "Add to Home screen" or "Install app"
  4. Tap "Add" or "Install"

๐Ÿงช Testing

Run Comprehensive Tests

# Run all tests
npm run test:forms

# Health check
npm run test:health

# Debug mode
npm run test:debug

Manual Testing

See TESTING_GUIDE.md for detailed testing instructions.

๐Ÿ—๏ธ Project Structure

โ”œโ”€โ”€ src/                    # Frontend React application
โ”‚   โ”œโ”€โ”€ components/         # Reusable UI components
โ”‚   โ”œโ”€โ”€ pages/             # Main application pages
โ”‚   โ”œโ”€โ”€ hooks/             # Custom React hooks
โ”‚   โ”œโ”€โ”€ utils/             # Utility functions
โ”‚   โ””โ”€โ”€ assets/            # Static assets
โ”œโ”€โ”€ server/                # Backend Express server
โ”‚   โ”œโ”€โ”€ routes.ts          # API route definitions
โ”‚   โ”œโ”€โ”€ security.ts        # Security middleware
โ”‚   โ”œโ”€โ”€ monitoring.ts      # Performance monitoring
โ”‚   โ””โ”€โ”€ logger.ts          # Logging utilities
โ”œโ”€โ”€ shared/                # Shared code between frontend/backend
โ”‚   โ”œโ”€โ”€ schema.ts          # Database schema
โ”‚   โ””โ”€โ”€ custodial-criteria.ts # Business logic
โ””โ”€โ”€ uploads/               # File upload storage

๐Ÿ”ง Available Scripts

# Development
npm run dev              # Start development server
npm run dev:client       # Start frontend only
npm run dev:server       # Start backend only

# Building
npm run build            # Build for production
npm run preview          # Preview production build

# Database
npm run db:push          # Push schema changes to database

# Testing
npm run test:forms       # Run comprehensive form tests
npm run test:health      # Health check test
npm run test:debug       # Debug mode testing

# Production
npm start                # Start production server

๐Ÿ”Œ API Endpoints

Inspections

  • GET /api/inspections - Get all inspections
  • POST /api/inspections - Create new inspection
  • GET /api/inspections/:id - Get specific inspection
  • POST /api/room-inspections - Create room inspection

Custodial Notes

  • GET /api/custodial-notes - Get all notes
  • POST /api/custodial-notes - Create new note

Admin

  • POST /api/admin/login - Admin authentication
  • GET /api/admin/inspections - Admin inspection data

System

  • GET /health - Health check
  • GET /metrics - Performance metrics

๐Ÿ›ก๏ธ Security Features

  • Rate Limiting - API request throttling
  • Input Sanitization - XSS protection
  • CORS Configuration - Cross-origin request security
  • Security Headers - Helmet.js security middleware
  • Request Validation - Input validation and sanitization

๐Ÿ“Š Performance Monitoring

  • Request Timing - Track slow requests
  • Memory Usage - Monitor memory consumption
  • Error Tracking - Comprehensive error logging
  • Health Checks - System health monitoring

๐Ÿš€ Deployment

Railway (Recommended)

  1. Connect your GitHub repository to Railway
  2. Set environment variables in Railway dashboard
  3. Deploy automatically on push to main branch

Other Platforms

  • Vercel - Frontend deployment
  • Heroku - Full-stack deployment
  • DigitalOcean - VPS deployment

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support

Common Issues

Database Connection Errors:

  • Verify DATABASE_URL is set correctly
  • Check database server is running
  • Ensure database exists

Port Conflicts:

# Kill processes on port 5000
kill -9 $(lsof -ti:5000) 2>/dev/null

Form Submission Failures:

  • Check server logs for error details
  • Verify all required fields are filled
  • Check network connectivity

Getting Help

  1. Check the TESTING_GUIDE.md
  2. Review server logs for error details
  3. Verify environment configuration
  4. Test database connectivity

๐Ÿ† Acknowledgments

  • Built for educational institutions
  • Designed for custodial staff efficiency
  • Optimized for mobile-first usage
  • "For the People!" - Shared Service Command

Version: 1.0.0
Last Updated: January 2025
Maintainer: Shared Service Command

Railway deployment trigger Mon Oct 20 15:04:38 CDT 2025

Force redeploy Mon Oct 20 15:16:20 CDT 2025

Trigger Railway rebuild - Sun Nov 2 18:52:47 CST 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9